With the introduction of Azure Resource Manager integration in 3.3. I have a question usage.
If i was to have a new project. On which we build azure resource manager templates (.json). If our first step in our OD project was to deploy the infrastructure. And the second step was to deploy to an azure web app.
How could the octopus deploy process reference a web app that does not yet exist? As far as i know, when adding an azure web app to the deployment process, you have to select a subscription, and then web app from the dropdown. I am unable to use variables etc to define these values.
You’ll need to know the name of your App upfront and put it in a variable for the Web App field. This happens a lot as one usually expects to put the app name the exact way you do it on the ARM template, but the actual string that azure expects doesn’t have spaces and sometimes has unexpected parenthesis (when using slots)
The easiest way to make sure you have the right name is:
Run a deployment where the Azure Resource Manager (ARM) step runs successfully so your site exists. Don’t mind about the Azure web app step failing after that.
Once the site was created, go back to your deployment process and on your azure step, click on the WebApp dropdown and select your site. Then click on the button at the right to show the custom expression as shown on 1.getAzureAppName.gif. The value you see on that field is what your variable needs to hold.
Create a variable with that value (2.variable.jpg) and then use it as a custom expression on the WebApp field (3.fieldWithVariable.jpg)
You need to click on the “Custom Expression” button right next to the dropdown as I did on the GIF. That’ll change the dropdown for a free text field where you can enter a variable.