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

GraphRbacManagementClient fails when not setting baseUri explicitly #3191

Closed
2 of 6 tasks
johlrich opened this issue May 24, 2019 · 4 comments
Closed
2 of 6 tasks

GraphRbacManagementClient fails when not setting baseUri explicitly #3191

johlrich opened this issue May 24, 2019 · 4 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Graph Mgmt This issue is related to a management-plane library.

Comments

@johlrich
Copy link

  • Package Name: @azure/graph
  • Package Version: 4.3.0
  • Operating system:
  • nodejs
    • version: 10.15.0
  • browser
    • name/version:
  • typescript
    • version: 3.4.5
  • Is the bug related to documentation in

Describe the bug
When using a GraphRbacManagementClient, requests will fail if you do not explicitly set the baseUri to "https://graph.windows.net"

Error: {"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"Invalid domain name in the request url."},"requestId":"566b2d93-3895-4946-9cc8-8799bef068be","date":"2019-05-24T18:08:39"}}

To Reproduce
Steps to reproduce the behavior:

  1. create GraphRbacManagementClient
  2. call client.signedInUser.get()

Expected behavior
Expect to not need to set this explicitly.

Additional context
Add any other context about the problem here.

I believe the issue is the credentials I'm getting does have an environment (azcli based auth), which causes the base class to set the resourceManagerEndpointUrl as the baseUri: https://github.com/Azure/ms-rest-azure-js/blob/master/lib/azureServiceClient.ts#L46-L49
which prevents the Graph specific default from being respected: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/graphrbac/graph/src/graphRbacManagementClientContext.ts#L50

@kurtzeborn kurtzeborn added the Mgmt This issue is related to a management-plane library. label May 24, 2019
@kurtzeborn
Copy link
Member

Thank you for opening this issue! We are routing it to the appropriate team for follow up.

@kurtzeborn kurtzeborn added Graph customer-reported Issues that are reported by GitHub users external to the Azure organization. labels May 24, 2019
@amarzavery
Copy link
Contributor

That is true. As a workaround, please pass the baseUri in the options object for now, till we figure out a solution for this.

@ramya-rao-a
Copy link
Contributor

@willmtemple The latest version 5.0.1 of the @azure/graph package shouldn't have this issue. If so, please close this issue

@willmtemple
Copy link
Contributor

Yes, the 5.0.1 patch for the AAD Graph SDK @azure/graph fixed this issue. It was a code-generation issue that only manifested in graph when an Azure environment wasn't configured in the credential (as the issue mentioned in the original report). Setting baseUri manually should not be required as of @azure/graph 5.0.1.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Graph Mgmt This issue is related to a management-plane library.
Projects
None yet
Development

No branches or pull requests

5 participants