The Octopus Deploy Q2 release includes a new Deploy an Azure App Service step. This step delivers major improvements for deploying Azure web applications, including:
- Deploying to Linux app service plans (without obscure configuration hacks).
- Deploying container images.
- Executing deployments on Linux Octopus workers.
- Configuring application settings and connection strings.
What's changed?
The Deploy an Azure App Service step is designed to supersede the existing Deploy an Azure Web App step, however, the original step is still available.
The Deploy an Azure Web App step relied on Microsoft Web Deploy as the deployment mechanism. This restricted the step to executing on Windows workers, required special configuration to work with Linux app service plans, and didn't support container images. The new step relies on the zip deploy API for file-based packages (zip, nupkg, war), and also supports deploying container images.
App settings and connection strings
The new step also brings the ability to configure the Azure application settings and connection strings.
This is done by supplying the settings and/or connection strings as JSON.
The benefits of using the JSON format are:
- It is the same JSON format as the bulk-edit feature in the Azure portal, making it easy to move existing app settings into Octopus.
- These fields accept Octopus variable expressions, allowing advanced scenarios such as conditionally including values, and iterating over collections of Octopus variables to build the app settings or connection strings.
In the future we hope to add a friendlier UI over these fields, and maintain the JSON configuration as an 'advanced' mode.
Transforming configuration files
When deploying applications packaged as zip, nupkg, or war files, multiple options are available for transforming configuration files within the package. Octopus will extract the package and perform these transforms before pushing to Azure.
The following options for transforming configuration files are provided:
- Performing variable substitution on templated files, containing Octopus variable expressions (e.g.
#{MyVariable}
). - Using structured configuration variables to transform YAML, JSON, XML, and other structured configuration files.
- Performing .NET XML configuration transforms.
Conclusion
We tip our hats to our friends at Clear Measure for their help in developing this new Azure App Service integration.
The Deploy an Azure App Service step is available now in both Octopus Cloud instances and in Octopus 2021.1 on the self-hosted downloads page. We hope this makes it easier than ever to deploy your Azure web applications.
Happy deployments!