Visual Studio - deploy existing website/webAPI to Azure - asp.net

In my VS(2015) solution, I have a ASP.Net website and a WebAPI project. For normal development, I want to use IIS on local machine for dev/test. However, I also want the option to be able to deploy the same sites to Azure on demand.
I know I can 'Convert' an existing project to Azure project from VS. But then it'll become a cloud project only. I don't want to convert it to cloud project.
Is there a way I can use my existing projects in VS and deploy/publish them to Azure?
Thanks

You don't need to "convert" your project to an Azure project, you can simply create a publishing profile in Visual Studio and push the build to Azure.
The Microsoft documentation explains how to do this, follow the steps from the "Publish to Azure" section onwards.

Related

Azure .Net WebApp Deployment Failed but it works locally on VS

I am new to .Net and Unable to understand some weird behaviour with Azure.
I am trying to publish a .Net Project to Azure Web App. And It is throwing very silly errors. I assume thats becoz of new C# version.
Here is the log file.
Use Case 1: When trying to build from Visual Studio Team Services and then deploy using Continuous delivery Works.
Use Case 2: When trying to publish directly using Visual Studio using App Service profile and it works.
Use Case 3: When trying to deploy through repository that is hosted at Visual Studio Team Services. And it fails and thats the error.
Any lead will be helpful.
Do let me know, if the information provided is not enough.
To compile C# 7.0 code, we need msbuild 15 installed. Currently, msbuild15 is not enabled on Azure Web App.
For Use Case 1 and 2, the C#(7.0) code is build on your development side on which
Visual Studio 2017(msbuild 15) is installed.
For Use Case 3, the code will be complied on Azure Web App, so it will throw errors.
Microsoft engineers are in the process of building these tools for Azure, they should be out soon. you could stay updated on github

Publish scripts not generated by visual studio

I am trying to figure out how to best deploy my web apps to azure using something like Jenkins. So I thought i should investigate publishing using deploy scripts.
In all tutorials on deploy scripts for azure you should start with some scripts generated by visual studio when creating your web app. This doesn't seem to happen for me. Am I missing something or is that just not true anymore?
I am using Visual Studio 2015 and I am building ASP.Net web apps.
According to the tutorials I am supposed to get a folder on solution level called "PublishScripts".

Visual Studio Online continuous deploy ASP.NET web pages to Azure Websites without build

How can I continuous deploy an ASP.NET web pages project to Azure Websites(Web App) without building it by hosted build controller(provided by Visual Studio Online)?
My project contains web pages and do not need to build in order to work. The web pages will be build dynamically when it is live. Also, I don't want to waste my build minutes in order to publish it since it is not required to build. However, I can't found any setting regarding this in Visual Studio. I had set up and wanted to use continuous deployment in Azure Websites.
Please help!
If you install the Azure SDK stuff for Visual Studio you can publish directly to an Azure Website from Visual Studio. You don't need to run your build on a build server, just build locally. Left click on your web project then select "Publish..." then you should see a "Publish Web" wizard that lets you select your azure website and push your built to it.

how to Create Setup of Web application in asp.net?

How to Create Web Application Set up in asp.net ?
I have a web site in a Visual studio.I want to create a single web setup project which should install the web site.So how to create a single web setup project which supports multiple web application installation?
You can use Installshield to do that. When you go to add new project you will see that option under Other Project Types --> Setup and Deployment
http://learn.flexerasoftware.com/content/IS-EVAL-InstallShield-Limited-Edition-Visual-Studio?lang=1033&ver=prem
There are many 3rd party tools that can perform this for you (We use Anthill Pro to deploy between our various environments).
I've used the full version of InstallShield in the past but there was a bit of a learning curve to get it right.
The free alternative is to use the Web Setup Project template in Visual Studio (This uses the 'lite' version of InstallShield I believe). You can also check out this link, which describes many different options for you to deploy your website. Extract from the last link:
Visual Studio, ASP.NET, and IIS provide tools that can help you with
the process of deploying your web application or web site. Some of the
Visual Studio tools work only with web application projects, while
others work only with web site projects. (All MVC projects are web
application projects.)
Hopefully this walkthrough should provide you a good starting point should you choose to go down the Visual Studio route.

Do I have to convert my website project into a web application project to migrate to Azure?

I have a current website project that I need to migrate to Windows Azure. Back in 2009 we had to convert the website project to a web application project. Is that still the case today?
Your life will probably be a lot easier if you use web application projects, but you can use website projects. At the very least, you can use cspack from the command line and point it at any directory. You can also use the physicalDirectory attribute in ServiceDefinition.csdef to point to an arbitrary directory. That directory can be your website project.
I'm not sure if there are better ways from within Visual Studio to use a website project as a web role.
You can add any project to the Windows Azure Visual Studio project. I like to create a new Windows Azure project first, and then add existing projects to it (rather than the other way around).

Resources