We have a custom cloud registered like so:
az cloud register --name OurCloud ..
We'd like to use it in conjunction with the azure-webapp-maven-plugin, configured like so:
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>2.14.1</version>
<configuration>
<auth>
<type>azure_cli</type>
</auth>
...
But this throws an IllegalArgumentException when calling mvn azure-webapp:deploy:
...
Caused by: java.lang.IllegalArgumentException: Unknown azure environment.
at com.microsoft.azure.toolkit.lib.auth.AzureEnvironmentUtils.getCloudName (AzureEnvironmentUtils.java:44)
at com.microsoft.azure.toolkit.lib.auth.cli.AzureCliAccount.setupAfterLogin (AzureCliAccount.java:74)
at com.microsoft.azure.toolkit.lib.auth.Account.login (Account.java:99)
at com.microsoft.azure.toolkit.lib.auth.AzureAccount.login (AzureAccount.java:127)
...
The AzureEnvironmentUtils only supports the default clouds: Azure, China, Germany, USGov:
|
static { |
|
// the first alias is the cloud name in azure cli |
|
// the second alias is the display name, all other aliases are only used in our toolkit |
|
putAliasMap(AzureEnvironment.AZURE, "AzureCloud", "azure", "azure_cloud", "GLOBAL"); |
|
putAliasMap(AzureEnvironment.AZURE_CHINA, "AzureChinaCloud", "azure_china", "AzureChina", "azure_china_cloud", "CHINA"); |
|
// the TYPO:azure_german comes from azure cli: https://docs.microsoft.com/en-us/azure/germany/germany-get-started-connect-with-cli |
|
putAliasMap(AzureEnvironment.AZURE_GERMANY, "AzureGermanCloud", "azure_germany", "azure_german", |
|
"azure_germany_cloud", "azure_german_cloud", "AzureGerman", "AzureGermany", "GERMAN"); |
|
putAliasMap(AzureEnvironment.AZURE_US_GOVERNMENT, "AzureUSGovernment", "azure_us_government", "US_GOVERNMENT"); |
|
} |
Considering that we're logging in using the az CLI, I don't see why the exact cloud name matters - az has already validated that this cloud exists/is valid.
We have a custom cloud registered like so:
We'd like to use it in conjunction with the
azure-webapp-maven-plugin, configured like so:But this throws an
IllegalArgumentExceptionwhen callingmvn azure-webapp:deploy:The
AzureEnvironmentUtilsonly supports the default clouds: Azure, China, Germany, USGov:azure-maven-plugins/azure-toolkit-libs/azure-toolkit-auth-lib/src/main/java/com/microsoft/azure/toolkit/lib/auth/AzureEnvironmentUtils.java
Lines 22 to 31 in f173242
Considering that we're logging in using the
azCLI, I don't see why the exact cloud name matters -azhas already validated that this cloud exists/is valid.