Azure Environment Selection for Azure Subscription Account not populating fields and may break accounts
Severity
Affects anyone trying to Configure an Isolated Azure Environment connection
Version
2023.4.8196, 2024.2.534, does not exist in 2023.3.13181
Latest Version
None
What happened?
When setting up a new Azure Subscription account in Infrastructure > Accounts, in the Azure Environment section after selecting Configure Isolated Azure Environment connection, the environment drop-down selection doesn't populate with the selected environment, and the AD Endpoint Base Uri remains blank:
In earlier versions of Octopus (e.g. 2023.3.13181), the environment and AD Endpoint Base Uri are populated:
Attempting to Save and Test the account in this state can break the account, and it can't be fixed via the UI.
Reproduction
- Go to Infrastructure > Accounts > Add Account > Azure Subscription
- Go to Azure Environment section and tick
Configure Isolated Azure Environment connection - Select one of the Azure Environments
- See that the
Azure Environmentfield doesn't populate, andAD Endpoint Base Uriis blank with the shadow textSelect an Azure Environment to be able to edit this field
If this is an existing account, clicking Save and Test or Save in the UI will commit the selection, and the fields can no longer be changed via the UI.
Error and Stacktrace
No response
More Information
Possibly related to: https://github.com/OctopusDeploy/Issues/issues/8509
Workaround
The account can be updated via the API instead of the portal/UI. The URLs to populate the Azure Environment fields can be found at:
https://your_octo_url/api/accounts/azureenvironments
The JSON body for an existing account can be found at:
https://your_octo_url/api/Spaces-##/accounts/
At the bottom of the account JSON body will be the fields that need edited, AzureEnvironment and ActiveDirectoryEndpointBaseUri:
"AzureEnvironment": "",
"ResourceManagementEndpointBaseUri": "https://management.azure.com/",
"ActiveDirectoryEndpointBaseUri": ""
Use either the REST API (e.g. SwaggerUI) to PUT the whole account JSON body with the edited section to accounts/<accountid>. The new section would look something like the following:
"AzureEnvironment": "AzureCloud",
"ResourceManagementEndpointBaseUri": "https://management.azure.com/",
"ActiveDirectoryEndpointBaseUri": "https://login.microsoftonline.com/"
Initially found here [internal]: https://octopus.zendesk.com/agent/tickets/170790
Another user affected (internal) - https://octopus.zendesk.com/agent/tickets/172830