Simple Deploy to Azure from Command Line
September 1, 2017 in Azure DevOpsI’m currently working on moving our product from AWS to Azure and as part of the planning for that move, one of the problems I needed to solve was deployment. Our current deployments are handled by an automated build on Bamboo, but Bamboo doesn’t have a “Deploy to Azure” task. I needed to do the deploy from the command line (CMD or Powershell), and I wanted to avoid including publish profiles in the projects.
The first part, running from the command line was easy to find through with a Google search. You can just tell MSBuild to publish to Azure
msbuild MyWeb\MyWeb.csproj /t:TransformWebConfig;Publish /p:TargetProfile=ProdMyWebApp /p:Configuration=AzDev
But the catch is that you can’t do it without a publish profile as part of your project or at least I wasn’t able to make it work.