Azure / Microsoft.Azure.StackExchangeRedis

Azure-specific wrapper for the StackExchange.Redis client library
MIT License
17 stars 14 forks source link

Tenant 'xxxxxxxxxxxxxx' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. #20

Closed chenzheng1988 closed 1 year ago

chenzheng1988 commented 1 year ago

I encountered the following error when connecting to China Azure Redis using AAD: var configurationOptions = ConfigurationOptions.Parse($"{cacheHostName}:6380").ConfigureForAzureWithServicePrincipalAsync(clientId!, principalId!, tenantId!, secret!).GetAwaiter().GetResult();

AADSTS90002: Tenant 'xxxxxxxxxxxxxxxxx' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Check with your subscription administrator, this may happen if there are no active subscriptions for the tenant. Trace ID: ff96b70b-5f00-496a-80e4-7ab7c0f38500 Correlation ID: db509495-a670-47fe-ab16-65b43808a328 Timestamp: 2023-08-30 03:14:04Z

It seems that there is no endpoint specified to connect to China AAD. How can we specify this parameter?

philon-msft commented 1 year ago

Thanks for pointing this out. We'll add an optional parameter to specify other clouds (including China) in the next release of the extension.

chenzheng1988 commented 1 year ago

That's great. When will the next SDK version be released? Because this feature has already been previewed on the Azure portal in China. There may be many customers who want to use this feature.

philon-msft commented 1 year ago

v2.0.0 has been released, and includes support for authenticating with Service Principals in Azure clouds other than the Public cloud. In the China cloud, you can pass AzureCloudInstance.AzureChina to ConfigureForAzureWithServicePrincipalAsync()

Please let us know if you see any issues.