ApiManagement SDK v8.1.1 unable to get access token with @azure/identity library
See original GitHub issue- Package Name: @azure/arm-apimanagement
- Package Version: 8.1.1
- Operating system: whatever
- [ X] nodejs
- version: 16.14.2
- browser
- name/version:
- typescript
- version:
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug After switching from version 8.0.1 to version 8.1.1, the library is unable to get an access token using the @azure/identity library (version 3.0.0).
To Reproduce
const apimClient = new ApiManagementClient( new DefaultAzureCredential(), <subscriptionId> ) apimClient.user.listByService(<rgName>, <serviceName>).next()
This throw the following error:
AuthenticationError: EnvironmentCredential authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot. Status code: 400 More details: invalid_scope: 1002012 - [2022-10-04 12:28:20Z]: AADSTS1002012: The provided value for scope undefined is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI).
It seems that @azure/arm-apimanagement calls getToken method of @azure/identity without setting the scope parameter.
This was work fine with version 8.0.1
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (5 by maintainers)
It may be better if we don’t have to specify this when running on public clouds as options.credentialScopes is optional.
@qiaozha : I confirm that release 8.1.2 fix the issue. Thanks