Quick way to deploy an Azure App Service from Visual Studio


This article has most to do with #AzureGermany #GermanCloud however the approach can be used in all Azure platforms.

The point here is that there are numerous steps one must take in order to configure Visual Studio to connect to non-Public Azure instance.  I mentioned some of those requirements here and here.

There is also now an Azure Environment Selector, see here, which may make things a bit more friendly, but still not a “click-ity, click that’s real quick” experience you get with the public Azure cloud.

I was reading this article and saw this Azure PowerShell cmdlet:  Get-AzureRmWebAppPublishingProfile and as I know ARM is fully functional in Azure Germany and ASM is not, that this cmdlet had a good chance of getting what I wanted, I.e. a *.publishsettings file that I could import into VS to publish.  And that is just what it did.

I already discussed “How to connect a PowerShell client to the German Cloud” here so I simply executed the following cmdlet that logged me into my Azure Germany subscription.

Login-AzureRmAccount -EnvironmentName AzureGermanCloud

Then, once logged in, I executed the Get-AzureRmWebAppPublishingProfile cmdlet: for example, see Figure 1:

Get-AzureRmWebAppPublishingProfile -Name "deploy" -ResourceGroupName "GERMANY-CENTRAL-RG"

image

Figure 1, output of Get-AzureRmWebAppPublishingProfile for Azure Germany Visual Studio deployment

I cut and pasted that output into a file with the extension .publishsettings.  *NOTE: I did have to shape it up a little, some of the lines contained returns and needed to straighten them all out.  I.e. make it into a correctly formatted XML file.

image

I wrote this article here about “How to make a local deployment and create a zip file for drag and drop deployment”, but instead of selecting Folder, select Import Profile as seen in Figure 2.

image

Figure 2, deploy to Azure App Service Germany using Visual Studio

Select the Publish button, then the *.publishsettings file or if this is not the first publish profile, select Create New Profile –> Import Profile –> OK.

The project is then published to Azure Germany.

You can also use the contents of the Publish Setting to access KUDU (see here) and to reset FTP credentials (see here).

Comments (0)

Skip to main content