Cowboy in the desert.

Azure Environments

Shannon Lewis

Over the past few months we've had an increasing number of requests to support Azure environments other than AzureCloud, e.g. Azure Germany, Azure China, Azure US Gov etc.

Recently we accepted a Pull Request for Calamari, so that it could use the alternate endpoints for connecting to the other Azure environments. The configuration for this is done through the setting of special variables that get passed through to Calamari when the deployment executes. For example,

This approach worked, but had 2 limitations. Firstly, the names and values for the variables wasn't easily discoverable and secondly the changes only allowed Calamari to cope with the different Azure environments. The implication of that latter limitation was that you couldn't use the selectors in the UI for the Azure steps, e.g. to select a Resource Group or Web App, because they didn't know about the special variables or what to do with them. The workaround for that was to insert variables containing string literals for Resource Group names etc, i.e. you just had to know the string names of the things you were deploying to. For example, for an Azure Web App you'd have to have something like this

So as you may have guessed from all my past tense talk, we've updated Octopus Deploy server to better handle Azure environments. The update (available in Octopus Deploy 3.9) builds on the previous work but allows you to specify the environment and endpoint overrides as part of your Azure Account definition. In this way both the server and Calamari can see and use the values when connecting to Azure. Here's an example of the new Azure Account page

For those currently using the variables to pass the values to Calamari, that method should continue to work after the upgrade, you just don't HAVE to do it that way now. The server will automatically set the same variables now based on the account settings, so post upgrade you can progressively move towards using the accounts and then you'll have the advantage of being able to select values in the UI.

It's all good, in theory

You may have noticed a couple of "should"s in that previous section. Fully testing this type of feature is tricky, we don't have a subscription in any of the alternate Azure environments, so it is entirely possible there may be some minor wrinkles to iron out. This is also an initial version of the functionality. We'd ultimately like the ability to just have the user select the environment from a drop down and populate all of the endpoint overrides behind the scenes, but we haven't got a reliable method for programmatically loading that data as yet. For now, this should unblock those who need to deploy into these Azure environments and we will look at further improving the UI over time.

We'll be monitoring feedback and trying to be as responsive as possible to issues in this space.

If you need to deploy to an alternate Azure environment

Learn more about configuring Azure environments.


Tagged with: Azure
Loading...