Description
openedon Jul 2, 2021
- Package Name: @azure/identity
- Package Version: 1.3.0
- Operating system: Linux
- nodejs
- version: 14
- browser
- name/version:
- typescript
- version: 4.4.0
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
A clear and concise description of what the bug is.
When attempting to use the @azure/identity package in an Azure Function (Linux) with a VNet integration the GET
request to the /msi/token
endpoint fails with a 500
status code and the following error message:
More details:
unknown_error(status code 500).
More details:
An unknown error occurred and no additional details are available.
at ManagedIdentityCredential.<anonymous> (/home/site/wwwroot/node_modules/@azure/identity/dist/index.js:1301:23)
at Generator.throw (<anonymous>)
at rejected (/home/site/wwwroot/node_modules/@azure/identity/node_modules/tslib/tslib.js:115:69)
at process._tickCallback (internal/process/next_tick.js:68:7)
statusCode: 500,
errorResponse:
{ error: 'ManagedIdentityCredential authentication failed.',
errorDescription:
'unknown_error(status code 500).\nMore details:\nAn unknown error occurred and no additional details are available.',
correlationId: undefined,
errorCodes: undefined,
timestamp: undefined,
traceId: undefined },
name: 'AuthenticationError' }
I can see that the request is made to the following endpoint: http://169.254.129.5:8081/msi/token?resource=https%3A%2F%2Fstorage.azure.com&api-version=2017-09-01
To Reproduce
Steps to reproduce the behavior:
- Create a function app with a system-assigned managed identity
- Integrate function app with VNet
- Attempt to retrieve a token using the
@azure/identity
library (const defaultAzureCredential = new DefaultAzureCredential();
)
Expected behavior
A clear and concise description of what you expected to happen.
The function app should successfully retrieve a token.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.