Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Deployments can be scoped so that the resources defined in a Bicep template are deployed to a specific Azure scope such as a management group, subscription, or resource group. These scopes all require an Azure subscription.
There are several scenarios where you need to use Bicep templates to deploy Microsoft Graph resources, but:
Using a tenant-scoped deployment, it's possible to deploy Microsoft Graph resources without an Azure subscription.
This article demonstrates how to scope your deployments to a tenant scope and without using an Azure subscription. It only applies if your Bicep template file contains Microsoft Graph resources only. If your template file contains Azure resources in addition to Microsoft Graph resources, you need a valid Azure subscription.
Important
Microsoft Graph Bicep is currently in PREVIEW. See the Supplemental Terms of Use for Microsoft Azure Previews for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
The following steps show how to deploy Microsoft Graph resources at the tenant scope without requiring an Azure subscription.
Assign the requisite deployment permissions to the principal performing the deployment.
<principalId>
of the user or service principal, <principalType>
, that needs to deploy the templates. The /
scope refers to a tenant-wide scope. The following options indicate ways to assign the deployment permissions to the principal, listed in the order of least to highest privileged.
Microsoft.Resources/deployments/*
permission.Microsoft.Resources/deployments/*
permission.az role assignment create --assignee-object-id "<principalId>" --assignee-principal-type "<principalType>" --scope "/" --role "Owner"`
In your main.bicep file, add targetScope = 'tenant'
to set a tenant-level deployment scope. Your Bicep file must declare only Microsoft Graph resources.
Perform a tenant deployment using the security principal that has deployment privileges, using az deployment tenant create or New-AzTenantDeployment:
az deployment tenant create --location WestUS --template-file main.bicep
For more information about tenant deployments, see Deploy to a tenant.
Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Deploy resources to subscriptions, management groups, and tenants by using Bicep - Training
Learn how to deploy resources to subscription, management group, and tenant scopes within your Bicep code.
Certification
Microsoft Certified: Identity and Access Administrator Associate - Certifications
Demonstrate the features of Microsoft Entra ID to modernize identity solutions, implement hybrid solutions, and implement identity governance.
Documentation
Bicep templates for Microsoft Graph resources - Microsoft Graph Bicep
Bicep templates for Microsoft Graph resources.
Microsoft.Graph/users - Microsoft Graph Bicep beta reference
Microsoft.Graph/users syntax and properties to use in Bicep templates for deploying the resource.
Microsoft Graph Bicep resource reference overview - Microsoft Graph Bicep v1.0 reference
Overview of supported Microsoft Graph Bicep resources.