Blog Post

Azure Tools Blog
3 MIN READ

Azure AD to Microsoft Graph migration for Azure command line tools.

dcaro's avatar
dcaro
Icon for Microsoft rankMicrosoft
Oct 12, 2021

Because of the retirement of Azure AD Graph has been announced, all applications using the service need to switch to Microsoft Graph, which provides all the functionality of Azure AD Graph along with new functionality. This also apply to the Azure command-line tools (Azure CLI, Azure PowerShell, and Terraform) and we are currently updating our tools to use Microsoft Graph and make it available to you as early as possible to give you enough time to update your code.

 

Impact on existing scripts

Our principle is to minimize the disruption to existing scripts. Therefore, whenever possible, we will keep the same command signature so that a version upgrade of your tool will be sufficient with no additional effort.

 

In few cases, the behavioral difference of the Microsoft Graph API from the AzureAD Graph API will induce a breaking change. For example, when creating an Azure AD application, the associated password can no longer be set at creation time. If you want to specify this secret, it must be updated afterward. Along with the preview versions of the tools, we will publish a full list of these breaking changes and instructions how to update your commands.

 

Azure vs Microsoft Graph command-line tools

AzureAD capabilities in the Azure command-line tools are provided to simplify the getting started experience for script developers, hence the limited scenarios covered with those commands.

 

While we plan keep supporting a subset of the AzureAD resources in the upcoming releases of our tools, we will implement new Graph capabilities as it pertains to fundamentals like authentication. For resources not supported with the Azure CLIs tools, we recommend using the Microsoft Graph tools: either the Microsoft Graph SDK PowerShell modules or the Microsoft Graph CLI.

 

Availability and next steps

To help you plan your migration work before the deadline, we are sharing our current timeline:

 

For Terraform, HashiCorp has already completed the migration to Microsoft graph with the AzureAD provider v2. Additional information here: https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/guides/microsoft-graph

Please comment on this article or reach out to the respective teams if you have any questions for Azure CLI (@azurecli) or Azure PowerShell (@azureposh).

 

Additional resources

While we update the official documentation for Azure tools, you can use the following resources for additional guidance on migrating to Microsoft Graph.

Further information regarding the migration to MSAL and its importance in the migration to MS Graph:

The content provided for Terraform, is very useful to understand the API changes:

Open issues in the respective repositories if you face any:

Let us know what you think in the comment section below.


Damien
on behalf of the Azure CLIs tools team

 

Updated Apr 06, 2022
Version 4.0

4 Comments

  • edwinvdb's avatar
    edwinvdb
    Copper Contributor

    I don't think the Graph API is completely on par with the AD API. We use the New-AzADAppCredential with the -Password parameter to set the same credentials for dev/tst sometimes and when a secret is accidentally deleted or expired and needs some extra time, we can generate the same secret.

     

    Those use cases don't seem to be possible with the Graph API, or is there a workaround? And the UI only supports a maximum of 2 years for the password expiration...

  • LockTar's avatar
    LockTar
    Copper Contributor

    dcaro  Thank you for the link of the blogpost. I wasn't aware of the new module. I need this module on the Azure DevOps agents so I created a new issue https://github.com/actions/virtual-environments/issues/4268 and PR https://github.com/actions/virtual-environments/pull/4274. Hopefully it will be approved.

  • The Az PowerShell module does not aim at replacing the AzureAD module or the Microsoft Graph module so overall there will be AzureAD cmdlets that will not be in Az.  The following article has more information about the plans for the future of the AzureAD PowerShell module: https://techcommunity.microsoft.com/t5/azure-active-directory-identity/automate-and-manage-azure-ad-tasks-at-scale-with-the-microsoft/ba-p/1942489.

    Also if you think that we are missing a command, feel free to open a feature request on GitHub for Azure PowerShell or Azure CLI

  • LockTar's avatar
    LockTar
    Copper Contributor

    dcaro what about the PowerShell cmdlets that are available in the AzureAD PowerShell module but not in the Az PowerShell module? Are those added? I maintain an Azure DevOps pipeline extension that manages Azure AD Applications. I use for a lot cmdlets the Az module but a few are still not available...