question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

azure CLI beta uses Azure AD Graph

See original GitHub issue

Describe the bug

The Azure CLI beta described here says it uses the MS Graph API. When I run the Azure CLI command with the debug switch enabled, the CLI beta still uses the old Azure AD Graph API address.

Service Principals which are granted only MS Graph API permissions cannot be used with the Azure CLI beta to make changes in Azure AD. This can be demonstrated when trying to use an SP in an automation pipeline that will create an Azure AD Group.

To Reproduce

  • create an Azure AD Service Principal that has the MS Graph Application API Permissions described here.
  • Install the Azure CLI beta per the instructions above.
  • Sign in to Azure as the Service Principal via the Azure CLI using this command: az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant "GUID HERE" --allow-no-subscriptions --debug
  • Attempt to create an Azure AD Group with this command: az ad group create --display-name "YOUR GROUP NAME HERE" --mail-nickname "YOUR GROUP NAME HERE" --debug
  • Note the response that the request is not authorized
  • Note in the debug output that the Azure CLI shows the CLI passing API requests to https://graph.windows.net (the legacy Azure AD Graph API) and not the new API at https://graph.microsoft.com (the new MS Graph API). Per this documentation here.

Expected behavior

The Azure CLI beta uses the correct APIs that the documentation says it does.

Environment summary

  • Mac OS 12.3.1
  • Python 3.10 via HomeBrew
  • Azure CLI beta installed per instructions here.

Additional context

Premier Support Case #: 2205030030000806

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ausfestivuscommented, May 5, 2022

You are still calling the Azure CLI installed by Homebrew.

You are correct sir. My bad. Too many terminal windows open with different environments in them. I can confirm that the issue is now resolved.

Thank you!

1reaction
jiaslicommented, May 5, 2022

I am doing that right now! 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure CLI MS Graph Migration - (Beta)
Beginning with the move from ADAL to MSAL, Azure CLI has been working towards migrating from the Azure Active Directory (AAD) Graph API...
Read more >
Microsoft Graph migration
Learn about the Microsoft Graph migration of Azure CLI.
Read more >
Azure AD to Microsoft Graph migration for Azure command ...
Availability and next steps · October 2021. Public preview of Azure CLI using MSAL (pre-requisite to migrating to MS Graph) · December 2021:....
Read more >
Azure CLI Microsoft Build 2022 Highlights
Now Azure CLI is officially migrated to Microsoft Graph in 2.37.0. As mentioned in Beta version, MS Graph CLI does have breaking changes...
Read more >
Azure AD to Microsoft Graph migration changes in Azure ...
This migration guide contains a list of Azure PowerShell changes for the Azure AD to Microsoft Graph migration in Az.Resources 5.1.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found