Azure WebApp Dynamically Deploy

Using the old process for deploying to Azure cloud we ware able to set dynamically the name of the Web app and the azure account.

Now, as the documentation says, we need to have deployment target for each webApp. Now this is hard to maintain because we have different environments and many tenants.
Even If we dynamically create the target roles using the New-OctopusAzureWebAppTarget command we cannot specify dynamically the name of the target Role in deployment process

There is any possibility to specify dynamically the name of the target role or to deploy the web App without creating a deployment target for each teanant/environement ?


Hi Constantin,

Thanks for getting in touch.

The process you already have in place should be the correct one. I assume that you have the infrastructure process (creating an Azure Web App via PowerShell) in the same process as your application deployment.

First up, the steps that you had in place before the upgrade should continue to operate as they did before, please let me know if this is not the case.

The roles that you assign to a deployment target should be static. If you have many tenants requiring the same application then they should all have the same role name as per the role specified on the application deployment step.
Each time you release a new version of the application you will deploy it to one or more tenants, this will then create one deployment task per tenant, which will deploy the requested application version for each tenant.

There are additional concepts in Octopus which help you deal with tenants in different groups, such as using Tenant Tags. You can then use the tenant tags to specify different versions of the application get deployed to a select group of tenants using Channels.

If you send me back a process export (available on the overflow menu on the process page, called Download as JSON), and screenshots of your setup, along with a description of what you are trying to achieve, I will help you get over any hurdles you are getting.

Additionally, there is a legacy mode on the Azure Web App step which will ensure you can continue to use the step as you were accustomed to previously.

One last thing is a blog post which contains a walkthrough of working with Azure deployment targets and using the dynamically.


Hi Ben,

Thanks for your answer,
First, I want to let you know that my deployment To Azure steps are working as they did before octopus upgrade, which is very good.
Second, I understand the concept of the target roles, I tried the example from blog post for deploying dynamically the application to Azure, and works well. Using this approach it will be created one deployment target per tenant for each environment. In my case I have few environments, dozens of tenants and multiple applications. It will be painful to maintain hundred of deployment targets even if I used multiple types of tags, and it will be also expensive.
My question is… Exist any other solution to not generating so many deployment targets but also to have the flexibility to deploy a specific version of the app to a specific tenant?
Can you also please tell me where can I find the legacy mode on the Azure Web App step?

Thanks, Constantin