Hi,
Thanks for getting in touch.
Because Azure US Government is a separate instance of the global Azure cloud, the endpoints for certain services are different, so the account “Save and Test” method that ships with Octopus Server will not work if you’re communicating with Azure US Government, China or Germany.
You can still save your account in the Octopus web portal, you just won’t be able to use the test functionality in the account screen.
Once you’ve saved your account and Azure has your management certificate uploaded, that leads you to the next problem … any Azure-related deployment steps that you create ( Deploy an Azure Cloud Service or Deploy an Azure Web App ) will not work unless you tell Octopus about the Azure US Government endpoints it needs to communicate with.
We added a fix for this issue that allows you to override these URLs in version 3.7.14 of Octopus Server, so you will need to be running at least this version in order to continue.
In order to tell Octopus about these US Government endpoints, firstly we need to determine what name Azure has set for the various non-global environments. To do this, you’d run this command in PowerShell:
Get-AzureEnvironment |Select Name
We can see a value named AzureUSGovernment
in that list, which is what you’re interested in.
To then determine the list of endpoints, you would run this PowerShell command:
Get-AzureEnvironment -Name AzureUSGovernment
That will give you this list of US Government endpoints:
Name : AzureUSGovernment
EnableAdfsAuthentication : False
ActiveDirectoryServiceEndpointResourceId : https://management.core.usgovcloudapi.net/
AdTenant :
GalleryUrl : https://gallery.usgovcloudapi.net/
ManagementPortalUrl : https://manage.windowsazure.us
ServiceManagementUrl : https://management.core.usgovcloudapi.net/
PublishSettingsFileUrl : https://manage.windowsazure.us/publishsettings/index
ResourceManagerUrl : https://management.usgovcloudapi.net/
SqlDatabaseDnsSuffix : .database.usgovcloudapi.net
StorageEndpointSuffix : core.usgovcloudapi.net
ActiveDirectoryAuthority : https://login-us.microsoftonline.com/
GraphUrl : https://graph.windows.net/
TrafficManagerDnsSuffix : usgovtrafficmanager.net
AzureKeyVaultDnsSuffix : vault.usgovcloudapi.net
AzureKeyVaultServiceEndpointResourceId : https://vault.usgovcloudapi.net
You are interested in the ResourceManagerUrl
and ServiceManagementUrl
values.
When you’re setting up your deployments, you will need to set the following variables (as part of your project to their equivalent value from the list above:
Octopus.Action.Azure.ResourceManagementEndPoint
Octopus.Action.Azure.ServiceManagementEndPoint
Then when your deployments are executing, they will call out to those correct US Government endpoints.
We are still in the process of updating our documentation to help explain this, and we have a current issue where we aim to improve support for this a via the UI, but for now those steps above should do the trick.
Hope this helps.
Cheers
Mark