Rolling Deployments with Azure Web Applications

I’m running into some confusion over setting up my process for our Azure Web App deployment and wondering how I can streamline the deployment process using rolling deployments rather than having dozens of steps. However I can’t find a way in the rolling deployment “Azure Web App” step to define which actual web app this gets deployed to.

So our environment is like this:

Beta
|-> Beta AE
|-> Beta AS
Prod
|-> Prod AE
|-> Prod AS

I have a step set up called “Deploy app” and under it the following actions are undertaken:
1) Stop web app
2) Deploy web app
3) Start web app.

It’s step 2 that I’m having trouble with. In the Deploy Azure Web App section you specifically say which Azure Web Application you want to deploy (eg; our site names are PR-WEB-Beta-AE, PR-WEB-Beta-AS etc.). So I can’t “genericise” step 2. It seems that with rolling deployment I need to use the following step formula:

1) Stop website
2) Deploy PR-WEB-Beta-AE
3) Deploy PR-WEB-Beta-AS
4) Deploy PR-WEB-Prod-AE
5) Deploy PR-WEB-Prod-AS
6) Start website

Each of the steps 2-5 have the actual Azure website to deploy to, they’re all in the “PR-Web-Application” role and they each have an environment linked against them (Beta / Prod) so the steps should be executed / skipped depending on which environment I’m deploying to. But basically I want to deploy to Beta-AE AND Beta-AS in one step, for a Beta release and Prod-AE and Prod-AS for a Prod release.

How can I set this up so it’s back to the example at the top with the 3 steps? The Rolling Deployment in the cloud region documentation doesn’t really go into detail about actually defining which web app to target. An example is in this image here: https://i.octopus.com/blog/201604-2016-04-0723_25_07-cloud_region_deploy_log-ZR4J.png.

The 3 steps at the end show that it’s deployed to Australia East (AE), US West (UW) and Northern Europe (EN). How Do I specifically tell that Step 1 “Deploy Azure Website” that the US West region is actually my web application named PR-WEB-Prod-UW?

To add this our project (suite) is made up of a number of applications (Website, web service, Windows service etc.) and I’d like to add a Rolling Deployment step for each deployment (eg; Deploy Website, Deploy Windows Service).

I seem to be able to only create one rolling deployment and can’t make multiple children steps under another one. I basically want the steps to be like this:

  1. Deploy Website
    1.1) Stop Website
    1.2) Deploy Website
    1.3) Start Website
    1.4) Clear Cache
  2. Deploy Windows Service
    2.1) Backup folder
    2.2) Stop Service
    2.3) Deploy new files
    2.4) Start service
  3. Deploy web service
    3.1) Stop Website
    etc.

It seems I can only make one rolling deployment (ie; 1) Deploy Website above) and can’t make another with subsequent steps (ie; 2) Deploy windows service). Using latest version of Octopus Server.

Hi David,

Thanks for getting in touch! Cloud Regions is the way go here and you are very close to a working solution. I’m assuming you are using our built-in step template to deploy your Azure Web Apps. If so, please take the following steps to reduce your deployment process to just one Deploy web app step.

  1. Create a Cloud Region for every Azure Web Apps you want to deploy.
  2. Assign each cloud region to an appropriate environment (Beta or Prod)
  3. Assign each cloud region to the same role (e.g. AzureWebApp)
  4. As per step #5 create a variable (e.g. WebApp) that will represent the real name of your Azure Web App and specify value for each Cloud Region via Scope field.
  5. Use AzureWebApp role in your step
  6. Use WebApp variable as in the Web App field in your step. Have a look at the screenshot for more details.

Now when you deploy to Prod only Octopus will only deploy cloud regions assigned to Prod environment.

Please let me know how you go.

Regards,

Pawel