My preferred method of deploying to an Azure Web Site is using git, partially because this is a feature I’ve been involved with from the beginning (it’s known as Kudu).
However, in some cases, I just need to deploy a bunch of files from my local machine with minimal fuss, and using git is overkill. For these scenarios WebDeploy (aka msdeploy) really shines.
The challenge with WebDeploy is that using it from the command line can take some getting used-to. After you download the publishing profile (from the Azure Websites dashboard), you have to extract a bunch of chunks from it. From those chunks, you can piece together this charming command line, which will deploy a local folder to your Azure Website:
msdeploy.exe -verb:sync -source:contentPath=”c:FolderToDeploy” -dest: contentPath=’MyAzureSite’, ComputerName=”https://waws-prod-blu-001.publish.azurewebsites.windows.net:443/msdeploy.axd?site=MyAzureSite”, UserName=’$myazuresite’, Password=’fgsghfgskhBigUglyPasswordjfghkjsdhgfkj’, AuthType=’Basic’ |
That’s quite a mouthful, isn’t it? Well…
WAWSDeploy to the rescue
To make things easier, I wrote a little tool which makes this as simple as it can be. You still need to download the Publish Profile from the Azure portal, but then you simply run the following simple command:
WAWSDeploy c:FolderToDeploy MyAzureSite.PublishSettings |
So basically, you tell the tool where your files are, and it learns where they need to go from your profile. The tool can even deploy directly from the content of a zip file, e.g.
WAWSDeploy c:MyFiles.zip MyAzureSite.PublishSettings |
To get the tool, you can either build it yourself from the sources, or get it from Chocolatey.
Random notes:
- The tool is best used for simple sites that don’t need any build steps (so not for ASP.NET MVC)
- It’s just a fun little tool I wrote on the side, and not officially supported or sponsored by Microsoft.
- WebDeploy only works on Windows, so WAWSDeploy has the same limitation
Be sure to visit my blog for more information about Kudu and developing for Azure Websites!