Closed emoranchel closed 1 year ago
synced offline, for dogfood enviroment, the credentialScope is not ${endpoint}/.default
which is our current logic for default credentialScopes when endpoint is set. you can try to set credentialScope as "https://management.azure.com/.default" when create the client in dogfood environment to make it work.
const resourcesClient = new ResourceManagementClient(credential, subscriptionId, {
endpoint: 'https://api-dogfood.resources.windows-int.net',
credentialScopes: ["https://management.azure.com/.default"]
});
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
The error happened again with latest identity. This is the log:
RestError: The access token has been obtained for wrong audience or resource 'https://api-dogfood.resources.windows-int.net'. It should exactly match with one of the allowed audiences '[https://management.core.windows.net/','https://management.core.windows.net','https://management.azure.com/','https://management.azure.com'.](https://management.core.windows.net/%27,%27https://management.core.windows.net%27,%27https://management.azure.com/%27,%27https://management.azure.com%27.)
at handleErrorResponse (D:\development\AD-IAM-Services-ADIUX\src\ADRBACExtension\Extension.E2ETests\node_modules\@azure\core-client\dist\index.js:1305:19)
at deserializeResponseBody (D:\development\AD-IAM-Services-ADIUX\src\ADRBACExtension\Extension.E2ETests\node_modules\@azure\core-client\dist\index.js:1240:45)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
The error happened again with latest identity. This is the log:
RestError: The access token has been obtained for wrong audience or resource 'https://api-dogfood.resources.windows-int.net'. It should exactly match with one of the allowed audiences '[https://management.core.windows.net/','https://management.core.windows.net','https://management.azure.com/','https://management.azure.com'.](https://management.core.windows.net/%27,%27https://management.core.windows.net%27,%27https://management.azure.com/%27,%27https://management.azure.com%27.) at handleErrorResponse (D:\development\AD-IAM-Services-ADIUX\src\ADRBACExtension\Extension.E2ETests\node_modules\@azure\core-client\dist\index.js:1305:19) at deserializeResponseBody (D:\development\AD-IAM-Services-ADIUX\src\ADRBACExtension\Extension.E2ETests\node_modules\@azure\core-client\dist\index.js:1240:45) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5)
Offline confirmed this was resolved by manually adding the credentialScopes
as "https://management.azure.com/.default"
Close as it resolved.
Describe the bug Hi I am trying to use the @azure/arm-resources nodeJS library to connect to dogfood but I am encountering an error. my code to connect is:
But I am getting an error:
And the full log:
To Reproduce Steps to reproduce the behavior:
try to use:
To connect and get resources.
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.