Wednesday, September 21, 2016

Azure Web App: Publishing Web Site/Service Forgot Deployment Password (introducing Cloud Explorer)

Publishing a web site to Azure (or on-prem IIS for that matter) is extremely convenient as it is integrated within Visual Studio. What make it beautiful on Azure is that a the password used for deployment is created automatically so a developer never needs to remember said password. Golly that sounds swell until during attempt to publish the following dialog is displayed during publishing:

The problem with the previous dialog is that an Azure developer typically has no idea what is the password to enter. This post demonstrates  where to acquire the missing password required in order to deploy a web site and/or web service.

To publish a site/server to Azure or IIS for that matter, select the Build menu's Publish <project name> option which kicks off publish wizard. 

Alternatively by right clicking on the web site/service project within Solution Explorer, the context menu displayed contains the Publish option:

Invoking the Publish wizard (as demonstrated above) display the Publish dialog show below:

When the Publish button on the Publish dialog is clicked, the configuration displayed in the drop down will be used during publishing. For Azure web sites/services no prompt is typically given to enter a password in order to publish as the credentials are saved. Every so often the following dialog appears prompting the user to enter a password they may not even know:

The pass can readily be acquired using Cloud Explorer which is an extension to Visual Studio 2015. The Cloud Explorer extension can be found at Cloud Explorer for Visual Studio 2015. In order to install Cloud Explorer the following prerequisits must be installed:

  • Microsoft Visual Studio 2015
  • Microsoft Azure SDK for .NET (VS 2015) - 2.7 or later

Once installed, Cloud Explorer can be invoked using Visual Studio's View menu as follows:

The Cloud Explorer tab appears as follows when it is accessed for the first time and hence does not remember current Azure login/subscription:

The previous screen is rather sparse because there no currently logged into Azure account. By clicking on Select an account a user can initiate login and after login a user can select the appropriate Azure subscription associated with a login.

Once logged into a specific user name and a specific subscription, Cloud Explorer can be configured to display the contents of a resource group as is demonstrated below:

Once the resource group containing the Web App to publish to and select the Download Publish Profile option at the bottom of the Cloud Explorer. The file download will be found in the Downloads folder and will be named for the web application name with the extension "publishsettings" as is shown below:

The publish settings files can be opened with any text editor such sa Notepad+:

The publish settings appear as follows when displayed in Notepad++:

Notice that the previous screenshot contains the userPWD element. The value stored in the userPWD element is the password that was prompted for by the publishing wizard.

The Cloud Explorer Visual Studio add-in demonstrated itself to be quite useful. Looking at the page used to download Cloud Explorer (Cloud Explorer for Visual Studio 2015), the extensions is given a review rating of 2.1 of 5 stars. This low rating is ironic given how handy Cloud Explorer at retrieving the password used to deploy a web site/service to Azure:

No comments :

Post a Comment