Publishing ASP.net to Azure VM - asp.net

There is LOTS of information on publishing asp to Azure Cloud Web Service and so forth but I cannot find a lot on publishing it to an azure VM.
Also another problem is anything I find assumes I have started a project with azure enabled from the start. Which I haven't done, so I would have to somehow convert it, again I have seen many ways of doing this on the web based on different requirements.
So how would I publish an ASP.net project (that has no reference to azure) to an azure VM.
Thanks

Install Web Deploy into your VM and publish directly through Visual Studio
http://www.iis.net/downloads/microsoft/web-deploy

Related

How to deploy an ASP.NET project to Azure with WebDeploy

A little background (before I get downvoted to oblivion!)
I'm working on an intranet-hosted ASP.NET web application in a highly secure environment. At the moment it's deployed by building a package in Visual Studio, the zip file is copied onto the server and installed in IIS using WebDeploy (right-click -> Deploy -> Import Application).
What I'd like to do is deploy a sanitised version of this application to an Azure Web Site for demonstration purposes, however most of the standard Azure deployment methods do not apply to me because:
I work on a secure network so Visual Studio is blocked from connecting to Azure (rendering 95% of documentation irrelevant!)
installable software is strictly controlled on this network so I cannot install the Azure SDK needed to create Service Definitions, Configurations and Packages
The only machine I have access to which can connect to Azure is woefully underpowered and can only run puTTY, PowerShell and basic text editors.
At the moment, I have a Windows VM in Azure just running IIS and WebDeploy - this works but seems like overkill (and a good way to burn through my credit) when Web Apps in theory do everything I need.
What can I do?
Another option may be to checkin the WebDeploy package to a free subscription of Visual Studio Team Services (VSTS = TFS in the cloud) and then create a deployment pipeline in VSTS using the new Release Management features.
https://www.visualstudio.com/features/release-management-vs.aspx
in that case:
1) FTP from your machine using your own FTP client or i would recommend to use PSFTP from Putty package.
2) Still WebDeploy, but use that to generate the needed files, then you can use PowerShell like that.
You can also use https://www.microsoft.com/web/webmatrix/ to connect to azure websites. It works with HTTP, only problem could be a corporate proxy.

How to publish ASP.Net website to remote machine?

I am trying to publish the ASP.Net site in IIS to a remote machine.
Presently I am publishing the site local file system and copying that folder to remote machine using mstsc tool.
Is there any way I can directly publish to remote machine?
Sure there is,
You have to make sure web deployment service is running on your server. You can check these articles to find out how to install the web deployment. Here or here.
Once your web deployment service is running and configured you need to configure your publishing settings. In Visual Studio right click on your solution project, choose Publish and select the Web deploy or Web deploy package as your publish method setting. Good article describing web deployment scenarios can be found here.
Hope that helps you.

How to only deploy changed project files in Windows Azure?

I am working on a web project in ASP.NET which is integrated with Salesforce. I have published my web project in Windows Azure. Now I have some changes in particular files and I want to deploy these changes only rather than complete project.
If you are using Web Deploy from within Visual studio, it will automatically only deploy the changed files in a differential manner. Alternatively, if you are using Azure VM's or a Cloud Service (which is actually VM's), you can connect to the machine(s) using RDP and update select files manually. You can get the RDP information to the machine from the Azure Portal.
http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-log-on-windows-server/

Deploy to an Azure WebRole without Visual Studio

Is there a way I can deploy my entire website/webapp to an Azure WebRole without the need of Visual Studio?
Context: We have a test environment where there's an IIS hosted web app where our testers test (of course). The thing is, we want to grab that exact tested web app folder and deploy it "as is" to a WebRole.
Please avoid commenting on our procedure, we have been looking at it and we will eventually change it if we have to, I just need a 'simple' yes(how)/no answer.
IIS Web Deploy can be used to package/migrate/restore IIS applications. It can be enabled while deploying a web role as described in this article and allows to update the web role with the application as deployed in your test environment.
Be aware that only single instance cloud services are supported and that in case of a maintenance operation by the fabric controller, your service will be rolled back to the state created by the initial azure package deployment. (There once was a tool for syncing between multi-instance web deployments but sadly that did not work out too well and is no longer supported. Do not attempt to use or rebuild it.)
Installing and Configuring Web Deploy shows the steps to get web deploy for your local testing IIS while articles on using web deploy like this one show examples for calling the tool.
Another option to evaluate are azure websites and git deployment. This could provide you with a documented and reproducible form of deployment that is not prone to unwanted rollbacks while allowing the service to scale to multiple instances. This option might not work out if the application it too tied to the web roles infrastructure or contains code not suitable for the more restricted web sites environment.
A third option to look at is using CSPack as presented in this article. You basically create a service definition and package up the webapp manually without building it in Visual Studio or TFS.
Yes - make sure you have enabled Remote Access on your webrole. Then copy your web app from your local IIS folder to F:\sitesroot\0 (NOTE - may be E:\sitesroot\0 on same web roles).
Yes, you can write a programmatic interface against Web Deploy from your C# code. If you're deploying to Azure Web Sites, you could also use the Windows Azure Management Libraries to spin up new web sites or clouand deploy them.

Difference Between Azure Web Site and Azure Cloud Service

I'm about to migrate several separate ASP.NET 4.0 Web Forms applications to Azure. Several are apps using SQL Server 2008. I'm seeing "conflicting" tutorials for this:
Deploying an ASP.NET Web Application to a Windows Azure Web Site and SQL Database
vs
Deploying an ASP.NET Web Application to a Windows Azure Cloud Service and SQL Database
This StackOverflow question goes some way towards explaining this. However, there have been several changes to Azure in recent months and I'm not sure how up to date the information is.
I want as simple a migration process as possible because of the number of sites I have to migrate. Is there a situation where I would have to use the Cloud Service route?
Aside from what the linked-to answer provides: You have to go the Cloud Service route if there are apps you need to install (e.g. an MSI, COM object, etc.). There's simply no facility to do this with Web Sites. In Web Sites, you cannot alter the VM instance at all. With Cloud Services, you have lots of flexibility to install software, alter IIS behavior, pretty much anything you need to do (as long as the installs can be automated).
One point which can be very valuable if you consider migration of ASP.NET 4.0 Web Forms applications - Microsoft Azure Websites do no support SSL for custom domains yet. That might be a blocker for your migration work to the Websites service.
Note that Windows Azure is very dynamic environment with great number of new features coming every new release. In order to be up-to-date I would suggest following ScottGu's Blog to find out about new features and their release dates.
EDIT
Windows Azure Website supports SSL for custom domains now. SSL Certificates and SSL bindings can be configured in Configure tab.
You can also read more about SSL configuration for Azure Website at Configuring an SSL certificate for a Windows Azure web site.

Resources