ApplicationRegion parameter does not work with output from ARM
See original GitHub issueDescribe the bug I have a compute resource in Azure, lets say an AKS cluster. Doesn’t really matter which one since the problem is the same across multiple services:
In my deployment pipeline I run a CLI command to retrieve the region, for instance:
az aks show --resource-group my-rg -n mycluster --query "location" --output tsv
This outputs something like northeurope
or eastus2
. This seems consistent across many Azure resources.
Now, I want to use that output to feed into an app setting which I then want to use to configure my Cosmos DB client with ApplicationRegion:
CosmosClientBuilder clientBuilder = new CosmosClientBuilder(SysConfig.CosmosEndpointUri, SysConfig.CosmosPrimaryKey);
var builderOptions = clientBuilder.WithApplicationRegion(Environment.GetEnvironmentVariable("AZURE_REGION"));
Turns out, you can’t. Because the SDK wants North Europe
or East US 2
. I don’t see any way how to programmatically split this up
To Reproduce See above.
Expected behavior
The SDK should accept standard naming input for Azure regions like northeurope
.
Actual behavior See above.
Environment summary SDK Version: 3.14.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:21 (19 by maintainers)
Top GitHub Comments
Should we expect this to be fixed? It is going to be two-year anniversary of this request soon. Does it really take that long to hard code a table or use equality comparer on the existing one that will do
.ToLowerInvariant().Replace(" ", "")
?@ealsur your example is a
"regionType": "Logical"
, I think you can disregard those. Looking at the output I would say only"regionType": "Physical"
is important as those are actual regions.Physical ones seeem to follow the logic, lowercase, no spaces, not special chars