azure CLI beta uses Azure AD Graph
See original GitHub issueDescribe 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:
- Created a year ago
- Comments:9 (4 by maintainers)
Top 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 >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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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!
I am doing that right now! 😉