Search code examples
azureazure-storageweb-deploymentazure-web-app-serviceazure-deployment

Upload package to windows azure web site programmatically using C#


My goal is to be able to deploy a package of ASP.NET website stored in Azure Storage as Azure Web Site programmatically (using C# ASP.NET) with just a click of a button. I know this can be done if I will deploy it as Azure Cloud Service by using Service Management API or azure powershell.

I dig into the source code of azure powershell and I see that it can only deploy from local Git and GitHub repo. Does anyone have any idea of how to do it from Azure Storage?

Note: I want to be able to manage all the Web Deploy Packages (stored in Azure Storage) online. I have an ASP.NET MVC website deployed as Azure web site and I will be using this one to automate deployments.


Solution

  • How are you packaging your site in blog storage? One way to publish to Windows Azure Web Sites is to use web deploy. You could package your site as a web deploy package as part of your build, and then use msdeploy.exe to push your bits to the site: http://technet.microsoft.com/en-us/library/dd569106(v=ws.10).aspx

    This would be no different from using web deploy to publish to an IIS Server.

    It looks like someone else has used this approach with success: http://robdmoore.id.au/blog/2013/06/01/windows-azure-web-sites-programmatic-web-deploy/

    Hope this helps!