Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Bicep templates let you define and deploy Microsoft Graph resources, like groups and applications, using infrastructure as code. To get started, you need:
- Bicep files or templates: Templates are written in the Bicep language, a ___domain-specific language that uses declarative syntax to deploy resources for your infrastructure as code solutions.
- Bicep tools: Tools that let you author, deploy, and manage supported Microsoft Graph resources through the Bicep templates.
Scenario: Suppose you want to call custom APIs from Azure Logic Apps and secure your web app with Microsoft Entra ID. Instead of manually creating the two application identities for the logic app and web app, define Microsoft Graph application and service principal resources in a Bicep file. In the same file, also define the Azure logic app and Azure web app resources. This approach lets you deploy both Azure and Microsoft Graph resources together, so you maintain consistency throughout your development lifecycle.
This article explains how Bicep templates and the Microsoft Graph Bicep extension let you automate and deploy Microsoft Graph resources consistently throughout your development lifecycle.
Microsoft Graph Bicep extension
Built on the Bicep extensibility feature, the Microsoft Graph Bicep extension lets you author, deploy, and manage a limited set of Microsoft Graph resources (currently Microsoft Entra ID resources) in Bicep template files with Azure resources. The following image shows this interaction.
This foundation lets you:
- Use familiar tools to deploy Azure resources with the Microsoft Graph resources you need, like applications and service principals, using infrastructure as code (IaC) and DevOps practices.
- Use Bicep templates and IaC practices to deploy and manage your tenant's Microsoft Graph resources.
Benefits of the Microsoft Graph Bicep extension
- Authoring experience: You get the same first-class authoring experience in the Bicep Extension for VS Code and Bicep extension for Visual Studio when you use it to create your Bicep files. The editor gives you rich type safety, IntelliSense, and syntax validation.
Support for both beta and v1.0 API versions: The Microsoft Graph Bicep extension lets you reference both beta and v1.0 versions of supported Microsoft Graph resource types in the same Bicep file.
Repeatable results: Deploy your infrastructure throughout the development lifecycle and know your resources deploy in a consistent way. Bicep files are idempotent, so you deploy the same file many times and get the same resource types in the same state. Create one file that represents the desired state instead of creating separate files for each update.
Orchestration: You don't need to worry about the order of operations. Resource Manager orchestrates the deployment of interdependent resources so they're created in the right order. When possible, Resource Manager deploys resources in parallel so your deployments finish faster than serial deployments. Deploy the file with one command instead of running multiple commands.
License requirements
You need the right licenses to deploy Microsoft Graph resources by using Bicep. If you also deploy Azure resources, you need a valid Azure subscription.
National cloud support
In addition to the public cloud, Bicep extensibility and the Microsoft Graph Bicep extension are supported in these clouds.
Cloud environment | Bicep extensibility | Microsoft Graph Bicep extension |
---|---|---|
Microsoft Cloud for US Government | ||
Microsoft Azure and Microsoft 365 operated by 21Vianet |
Get started
Topic | Resources |
---|---|
Try out your first quickstart | Start by installing Bicep tools, then author and deploy your first Bicep file with Microsoft Graph resources in minutes. |
Learn more from the community | John Savill's technical training on YouTube This resource is from the community, and Microsoft doesn't officially maintain it. |
Learn more about Bicep | - Bicep overview - Training modules for Bicep |
Learn more about Microsoft Graph | - Microsoft Graph overview - Authentication and authorization principles - Microsoft Graph tutorials |
Explore Microsoft Graph Bicep types | Microsoft Graph Bicep resource reference |