Setting azure WebApp name with octopus variables

Is there any way to set up the Web App name with a octopus variables so I don’t have to create different “Deploy to an azure web app” steps to deploy to different webapps ?

Thanks,
Ale

Hi Ale,

Thanks for getting in touch! That is totally possible! First you will need multiple variables with the same name and values reflecting the names of your web apps. Then scope them accordingly. In your Deploy an Azure Web App step configuration, you can select the checkbox on the right in the Web App section and select Use a custom expression. The variable can be called using the syntax: #{VariableName}. Feel free to refer to our Binding syntax doc page.

For example, scoping to individual environments will then mean a different app is deployed based on which environment you’re deploying to.

When you use a custom expression for the web app in your step, you will also need to specify the resource group that the web app is in. You can bind the resource group to a variable as well in the same way.

Alternatively, you can use system variables. For example, say your resource groups are named ResourceGroup-Development, ResourceGroup-Testing, and so on, which reflect environments in Octopus. You can bind the group name using the syntax ResourceGroup-#{Octopus.Environment.Name}.

I hope that helps! Let me know if you have any further questions.

Kind regards,

Kenny

Hi Kenny, yes it worked :slight_smile:

Would be good to improve a little bit the UX there… IMO is not intuitive enough I completely missed.

Thanks,
Ale