-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Text Analytics]It will return error when use textAnalyticsClient with AAD authentication to run integration tests on UsGov cloud and China cloud #17563
Comments
@deyaaeldeen I would imagine other SDKs for cognitive services would have this issue as well, like Form Recognizer and Metrics Advisor
It is worth checking with the feature crews to see if our SDKs in other languages would have the same problem as well |
/cc @witemple-msft @joheredi @KarishmaGhiya. I am digging deeper into this and will share my findings. |
cc @witemple-msft and @KarishmaGhiya if they can share any history around this from the perspective of Form Recognizer and Metrics Advisor |
@ramya-rao-a @deyaaeldeen FYI the You can see example usage from the NET tests: |
@benbp The ARM template will only help with the deployment. The problem here is that we are passing the wrong scope when trying to authenticate the client |
@ramya-rao-a I see. If you set that scope dynamically as an ARM template output, then you can load it in from the environment when you construct it, something like:
This is easier than having to do a switch on authority host, but also probably doesn't make it easier for customers, so perhaps it is better to do the switch. EDIT: looks like something similar is done here: https://github.com/Azure/azure-sdk-for-js/pull/17443/files#diff-7a62be417c0ab079a338a0153787d9522a6246ec46b5e05bde866d0366fb7a2aR56 |
@sarangan12 fyi, you will likely face the same problem in |
Quick update: The scopes for TA are: AzCloud: cognitiveservices.azure.com I looked at using the authority host to infer the scope but found that you can actually use the authority host for Azure Cloud to authenticate into a sovereign cloud resource. I found that container registry exposes an audience option that can be used to determine the scope: azure-sdk-for-js/sdk/containerregistry/container-registry/src/containerRegistryClient.ts Lines 36 to 41 in 809f05c
|
@deyaaeldeen Germany is a deprecated cloud that we don't support for testing. |
@schaabs confirmed that it is not likely but it is valid for the authority host to be in one cloud while the resource being authenticated into is in another. |
@benbp When we run text analytics integration tests in pipeline, some environment variables used in tests are not imported. For more details please check here. Please help to add these variables when you are free? These variables are shown as following: |
@deyaaeldeen @ramya-rao-a We did not run the Metrics Advisor tests on Sovereign or US Gov, I don't think the service team expected any customers using their service on these clouds. |
@deyaaeldeen @ramya-rao-a Is there any progress on this issue? When is it planned to be fixed? |
.NET TA client library added an audience option to support other clouds in Azure/azure-sdk-for-net#26583. I am planning on doing the same and will try to finish it in this milestone. |
@deyaaeldeen Is there any progress on this issue? |
@v-xuto There is still in discussion, we need to design a way to support of sovereign clouds in the library. |
Hi @zzhxiaofeng, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support. |
We are running live Tests against other clouds like US Gov and Azure China Cloud. The goal is to check whether new azure sdk package work with other clouds or not.
Error Description:
When we use
textAnalyticsClient
with azure active directory credential to run integration tests on UsGov cloud and China cloud, it will return an error. The error message is shown as following, for more details please check here:Error Track:
The failed reason is that when we use azure active directory credential, the scope of credential is just supported on Public cloud. The scope of credential defines the set of permissions being requested by the application. In text analytics client, the value of scope is here.
Expected Behavior:
Add different scopes for different clouds in Text Analytics SDK.
The value of the scope in different clouds is follow:
Public cloud: https://cognitiveservices.azure.com/.default
UsGov cloud: https://cognitiveservices.azure.us/.default
China cloud: https://cognitiveservices.azure.cn/.default
@benbp, @deyaaeldeen, @ramya-rao-a, @meeraharidasa for notification.
The text was updated successfully, but these errors were encountered: