Advertisements

Archive

Posts Tagged ‘Azure’

Azure Deployment Slots – Deploy and Swap

September 10, 2017 Leave a comment

Assume that you have your live application deployed on Azure running and you must deploy a hot fix.

The option you got is, you might want to take your application down for some time till your hot fix deployed.

How about you deploy the hot fix with no downtime, the answer is Azure “Deployment Slots”.

Create a Deployment Slot:

To use ‘Deployment Slots’, make sure you are running with Standard or Premium Azure Service Plan before adding a slot

  • Connect to Azure subscription and open your existing ‘App Service’
  • Under ‘DEPLOYMENT’ section, select ‘Deployment Slots’ and click on “Add Slot”

Azure - Deployment Slot

  • In the next screen, provide Slot name and choose ‘Configuration Source’. I gave my Slot name ‘Staging’ and in the ‘Configuration Source’:
    • If you choose your existing ‘App service’ all the settings including ‘Application Settings/Diagnostic Settings/…’ will be copied to this slot
    • Or you can choose ‘Don’t clone configuration….’ Option, if you want your slot to be clean and no carry over settings.

Deployment Slot - Add

  • Click ‘Ok’
  • After few seconds, you would get notification that your slot is ready
  • Once slot setup completed, your main App name will come as prefix of your slot (Ex: If ABC is my web app; my Slot name is ABC-staging)

Deployment Slot - Created

Publish Website to Slot:

  • Use Visual studio “Publish Web” option

Deploy - Connect Azure App Service

  • Select “Microsoft Azure App Service” and choose your main “App Service” and “Deployment Slots -> {Slot}”

Deploy - Slot

  • Click “Publish”
  • After publishing, your slot would work as any other Web App. You can give the slot URL to test to run BVT

Deployment Slot - Open Staging

Swap Slot:

  • Once you feel your slot is fine and can be promoted as main App
  • Click on ‘Swap’

Swap - 1

  • Select ‘Source’ and ‘Destination’
    • Main Web App would always represent as “production”
    • “Staging’ is the name of your slot

Swap - 2.PNG

  • Click Ok
  • It would take couple of minutes to complete Swap
  • Once Swap completes, end users who are accessing would start getting new build with virtually no down time.

Useful points:

  • If any errors are identified in production after a slot swap, roll the slots back to their pre-swap states by swapping the same two slots immediately
  • You can check your available ‘Deployment Slots’ by opening your Service Plans.

Check you available Slots.PNG

 

 

 

🙂

Advertisements

Azure Web Deploy – Time out errors

September 10, 2017 Leave a comment

Recently when we were trying to publish a web site to Azure ‘Deployment Slot’ using Visual Studio “Web Deploy” option, we encountered either Time out exception or VS hung after few files push.

Azure - Web Deploy - Visual Studio

Reason for this exception could be due to the enormous transactions on main (Prod) web app of the ‘Deployment Slot’.

Work around:

  • We found a work around by using Drag and Drop feature of Kudu service deploying to wwwroot folder directly.

Steps:

  • Publish the web site to your machines local drive

Publish Website - Local drive

  • ZIP the files (***You must select all the files and Zip it; Don’t zip the folder)

Publish Website - Zip folder

  • Open the Deployment Slot’s Kudu Service (Go to ‘Advanced Tools’ -> Go)

Web App - Advanced Tools

  • On the Kudu page, navigate to Home -> site -> wwwroot
  • Drag and drop the zipped folder of your published web site.

Kudu wwwroot - Drag and Drop

  • Wait for the process to complete publish.

🙂

Categories: ADX Tags: , , ,

Access and Edit Web App files hosted in Azure

January 26, 2017 Leave a comment

I have an Asp.Net Web application hosted as a Web App in my Azure instance.

One of the requirement I frequently get is to view or edit the published ‘Web App’ files from Azure Portal.

azure-web-apps

As we cannot access the ‘Web App’ files from Azure portal, one of the simpler way to access the files is by using the Visual Studio ‘Server Explorer’.

  • From the Visual Studio, open the ‘Server Explorer’ window

visual-studio-server-explorer

  • Connect to the Azure Subscription
  • Select the Web App under ‘App Services’ node and access the files.

server-explorer-access-files

Pre-requisites:

  • You need to have Azure SDK 2.7 installed.
  • Visual studio 2013 or higher version.

🙂

Categories: Azure Tags: , ,

‘Publish Web’ option not showing up existing Azure Web Apps – Visual Studio 2015

December 7, 2016 Leave a comment

I am using VS 2015 to publish my web application to one of my Azure web apps.

But all sudden the “Publish Web” window was not listing the existing web apps.

Not listing existing web apps

Not listing existing web apps

Fix:

  • Install latest Microsoft Azure SDK 2.9.6 for VS 2015 (Download)
  • You can also use ‘Microsoft Web Platform Installer’ for installation.
Install azure SDK 2.9.6

Install azure SDK 2.9.6

  • Open the VS 2015 and choose ‘Publish’ and you would get existing web apps listed.
Publish-web-new-azure-web-apps

Publish-web-new-azure-web-apps

🙂

Categories: Azure Tags: ,

‘The given share name\prefix is not a valid name’ error – Azure ‘New-AzureStorageShare’ command

Other day, while I was creating a shared location in Azure using Azure Power Shell cmdlets, I got below error

The given share name/prefix ” is not a valid name for a file share of Microsoft Azure File Service

share name/prefix is not a valid name

share name/prefix is not a valid name

Reason:

  • “New-AzureStorageShare” command accepts share name only in lower case.

Fix:

  • Update the command $s = New-AzureStorageShare “telcoip” -Context $ctx

Refer this Create shared drive using azure  article on steps to share a location in Azure.

🙂