Skip to content
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

Removal of UUID module causing token Generation to fail #25532

Closed
6 tasks
jyotirmoypan opened this issue Apr 11, 2023 · 3 comments
Closed
6 tasks

Removal of UUID module causing token Generation to fail #25532

jyotirmoypan opened this issue Apr 11, 2023 · 3 comments
Assignees
Labels
Azure.Core Azure.Identity bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team

Comments

@jyotirmoypan
Copy link

jyotirmoypan commented Apr 11, 2023

  • Package Name: @azure/core-rest-pipeline
  • Package Version: 1.10.3
  • Operating system: Windows 8 x64
  • nodejs
    • version: 14.16.1
  • browser
    • name/version: 111.0.5563.147 (Official Build) (64-bit)
  • typescript
    • version: NA
  • Is the bug related to documentation in

Describe the bug
A clear and concise description of what the bug is.

While trying to using @azure/identity, version 2.1.0, we are seeing below error:

azure:identity:info ManagedIdentityCredential - Azure Arc MSI => ManagedIdentityCredential - Azure Arc MSI: The environment variables needed are: IMDS_ENDPOINT and IDENTITY_ENDPOINT
azure:identity:info ManagedIdentityCredential - Fabric MSI => ManagedIdentityCredential - Fabric MSI: Unavailable. The environment variables needed are: IDENTITY_ENDPOINT, IDENTITY_HEADER and IDENTITY_SERVER_THUMBPRINT
azure:identity:info ManagedIdentityCredential - AppServiceMSI 2019 => ManagedIdentityCredential - AppServiceMSI 2019: Unavailable. The environment variables needed are: IDENTITY_ENDPOINT and IDENTITY_HEADER. 
azure:identity:info ManagedIdentityCredential - AppServiceMSI 2017 => ManagedIdentityCredential - AppServiceMSI 2017: Unavailable. The environment variables needed are: MSI_ENDPOINT and MSI_SECRET.
azure:identity:info ManagedIdentityCredential - CloudShellMSI => ManagedIdentityCredential - CloudShellMSI: Unavailable. The environment variable MSI_ENDPOINT is needed.
azure:identity:info ManagedIdentityCredential - Token Exchange => ManagedIdentityCredential - Token Exchange: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through 
the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE
azure:identity:info ManagedIdentityCredential - IMDS => ManagedIdentityCredential - IMDS: Error when creating the WebResource for the Azure IMDS endpoint: uuidFunction is not a function

This started happening as azure identity changed the version of @azure/core-rest-pipeline from 1.10.1 to 1.10.3. This caused UUID function to be not available and the token fetch failing.

To Reproduce
Steps to reproduce the behavior:

  1. Use azure identity to fetch the token with the @azure/core-rest-pipeline version updated to 1.10.3
  2. This will cause the above error if the application does not have uuid pulled from any other package

Expected behavior
A clear and concise description of what you expected to happen.

The removal of UUID needs to be accounted for if it causes an issue with other libraries or failures across other azure based libraries which it is dependent on. This is a breaking change. This is fixed if we manually add the UUID package internally or add the @azure/core-rest-pipeline 1.10.1 version in application dependencies.

Screenshots
If applicable, add screenshots to help explain your problem.
Azure_Error

Additional context
Add any other context about the problem here.

@github-actions github-actions bot added Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 11, 2023
@brianpham93
Copy link

brianpham93 commented Apr 12, 2023

I'm experiencing same issue with @azure/identity 3.1.3 with managed identity

CredentialUnavailableError: ManagedIdentityCredential: Authentication failed. Message uuidFunction is not a function
    at ManagedIdentityCredential.getToken (D:\home\site\wwwroot\node_modules\@azure\identity\dist\index.js:2294:23)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

the detail version of dependencies is as below

/@azure/identity@3.1.3:
    resolution: {integrity: sha512-y0jFjSfHsVPwXSwi3KaSPtOZtJZqhiqAhWUXfFYBUd/+twUBovZRXspBwLrF5rJe0r5NyvmScpQjL+TYDTQVvw==}
    engines: {node: '>=14.0.0'}
    dependencies:
      '@azure/abort-controller': 1.1.0
      '@azure/core-auth': 1.4.0
      '@azure/core-client': 1.7.2
      '@azure/core-rest-pipeline': 1.10.3
      '@azure/core-tracing': 1.0.1
      '@azure/core-util': 1.3.0
      '@azure/logger': 1.0.4
      '@azure/msal-browser': 2.35.0
      '@azure/msal-common': 9.1.1
      '@azure/msal-node': 1.17.0
      events: 3.3.0
      jws: 4.0.0
      open: 8.4.2
      stoppable: 1.1.0
      tslib: 2.5.0
      uuid: 8.3.2
    transitivePeerDependencies:
      - supports-color
    dev: false

@xirzec
Copy link
Member

xirzec commented Apr 12, 2023

Related to #25538 and #25541, the issue seems to be that you are using Node 14.16.1, but the API we're using was introduced in 14.17.0: https://nodejs.org/dist/latest-v18.x/docs/api/crypto.html#cryptorandomuuidoptions

14.17.0 was released 11-May-2021 and the 14 series falls out of Node LTS support at the end of the month: https://github.com/nodejs/release#release-schedule

I do apologize for the unexpected error. I don't believe we anticipated the number of customers using older runtime versions.

@mpodwysocki perhaps we could borrow from your react-native implementation to provide temporary compatibility? https://github.com/Azure/azure-sdk-for-js/blob/2f87259849b9b481ba17136257dca5f915aff759/sdk/core/core-util/src/uuidUtils.native.ts

@xirzec xirzec added bug This issue requires a change to an existing behavior in the product in order to be resolved. Azure.Core and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that needs-team-triage Workflow: This issue needs the team to triage. labels Apr 12, 2023
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Apr 12, 2023
mpodwysocki added a commit that referenced this issue Apr 13, 2023
### Packages impacted by this PR

- @azure/core-util

### Issues associated with this PR

- #25501
- #25541 
- #25538 
- #25532

### Describe the problem that is addressed by this PR

Adds the native implementation if missing in older Node.js

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [x] Added a changelog (if necessary)
@mpodwysocki
Copy link
Member

Closing as fixed per #25555

@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Azure.Identity bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team
Projects
None yet
Development

No branches or pull requests

4 participants