Deployment prerequisites
Share this page with the Azure RBAC, network and Microsoft Entra administrators before azd provision, or before a different identity runs azd deploy.
Complete only the sections that apply to your deployment.
Deployment identity
The deployment identity is the Azure user or service identity that signs in to run azd. Usually, one identity runs both azd provision and azd deploy. If a different identity will run azd deploy, follow Another identity deploys the application. Unless a section says otherwise, this page uses deployment identity to mean the identity that runs azd provision.
| Where you run azd | Deployment identity | Get its object ID |
|---|---|---|
| Your computer | Your user account. You sign in with az login and azd auth login. |
az ad signed-in-user show --query id -o tsv |
| Pipeline, for example Azure DevOps or GitHub Actions | The service principal or managed identity of the pipeline connection | az ad sp show --id <client-id> --query id -o tsv |
| Jumpbox with a system-assigned managed identity | The jumpbox managed identity | az vm identity show -g <group> -n <vm> --query principalId -o tsv |
| Pipeline or jumpbox with a user-assigned managed identity | The managed identity | az ad sp show --id <client-id> --query id -o tsv |
The deployment identity is not an application identity. The template creates the application managed identities and gives them their runtime roles.
Information to send with the request
Send these values to each team:
- Deployment identity: name, object ID and type (
UserorServicePrincipal). - Tenant ID, subscription ID and region (
AZURE_LOCATION). - The three deployment resource groups: Foundry (
AZURE_RESOURCE_GROUP), application (AZURE_APP_RESOURCE_GROUP) and network (AZURE_NETWORK_RESOURCE_GROUP). See the note below for what each group contains. - Method: Bicep or Terraform. Scope: full stack or infrastructure only.
- Network: public or private (
NETWORK_ISOLATION). List the resources that you reuse from other teams. - Models: name, version, deployment type and capacity of each item in
modelDeploymentList. - Application choices: choose one agent host (Hosted agent or Container Apps). Also say yes or no for the reference web UI and for Agent App MCP Server.
Deployment resource groups
New environments use three logical resource group destinations by default. Existing environments keep their saved mappings. Two or more destinations can use the same resource group. See resource group destinations for group names and overrides.
- Foundry (
AZURE_RESOURCE_GROUP): contains Foundry and grounding resources. It is also the root deployment group used by azd. - Application (
AZURE_APP_RESOURCE_GROUP): contains application resources, including Container Apps, the container registry, App Configuration, Key Vault, application Cosmos DB and monitoring. - Network (
AZURE_NETWORK_RESOURCE_GROUP): contains network resources created for the workload. Reused VNets, private endpoints and DNS zones can remain in other resource groups.
A role assigned at a resource group scope applies to resources in that group. It does not grant access to a resource in another group.
Who needs to act
| Section | Who needs to act | Applies when |
|---|---|---|
| Azure permissions | Azure RBAC administrator | Always |
| Shared resources | Administrator who manages each reused network, DNS or monitoring resource | You reuse a resource outside the three resource groups |
| Subscription and region | Subscription or platform administrator | Always |
| Microsoft Entra ID | Microsoft Entra administrator | Full stack. Infrastructure only with a Hosted agent needs only the Foundry audience. |
| Terraform state | Administrator of the Terraform state storage | Terraform |
| Deployment computer | Person who runs azd |
Always |
Azure permissions
Who grants access: an Azure administrator who can create role assignments at the requested scope. A subscription Owner, Role Based Access Control Administrator or User Access Administrator at that scope can do this. That administrator grants the roles below to the deployment identity. The deployment identity does not need the Owner role.
The deployment identity needs two roles:
- Contributor lets
azd provisioncreate and configure Azure resources. - Role Based Access Control Administrator lets
azd provisionandazd deploygrant roles to the deployment identity and application managed identities. Contributor cannot grant roles. User Access Administrator can also grant roles, but gives the deployment identity broader access-management rights than it needs.
Choose one option. See how to assign Azure roles.
Option A (recommended): An administrator creates the resource groups
- Ask an Azure administrator who can create resource groups and role assignments to create the three resource groups in the target subscription. A subscription Owner can do both tasks.
- Ask the administrator to assign Contributor and Role Based Access Control Administrator to the deployment identity on each resource group.
- Before the first
azd provision, the person who deploys runsazd env set CREATE_RESOURCE_GROUPS false.
Option B: The deployment creates the resource groups
Ask an Azure administrator who can create role assignments to assign Contributor and Role Based Access Control Administrator to the deployment identity at subscription scope. The deployment identity needs these roles at subscription scope because it creates the resource groups and assigns roles before those groups exist.
Additional Azure roles
| Applies when | Role | Scope | Why it is needed |
| --- | --- | --- |
| You deploy a Hosted agent, set GRANT_HOSTED_AGENT_PROJECT_MANAGER=false, and the deployment identity does not already have Foundry User on the project. | Foundry User | Foundry project | Lets the deployment identity read and prepare the Hosted agent in the project. |
By default, GRANT_HOSTED_AGENT_PROJECT_MANAGER=true. The template then assigns Foundry Project Manager to the deployment identity on the Foundry project. If you set the variable to false, make sure the identity already has Foundry User on that project. If it does not, ask the Foundry administrator to assign the role in the table above.
Roles the template assigns
When the same identity runs provision and deploy, do not request these roles separately. During provision, the template assigns the listed roles to that identity for the selected services. The last column explains what each role lets the deployment do. If a different identity runs azd deploy, see Another identity deploys the application. New role assignments can take several minutes to apply. If a step fails with an authorization error just after provision, wait and run it again.
Service roles the template assigns to the deployment identity
| Resource scope | Roles for the selected service | Why the deployment needs them |
| --- | --- |
| App Configuration store | App Configuration Data Owner | Write the application settings used by deployed components. |
| Key vault | Key Vault Contributor, Key Vault Secrets Officer | Configure the vault and access secrets required by selected components. |
| Azure AI Search service | Search Service Contributor, Search Index Data Contributor, Search Index Data Reader | Configure Search and read or update index data used by selected components. |
| Workload storage account | Storage Blob Data Contributor | Read and write workload blobs used by selected components. |
| Workload Azure Cosmos DB for NoSQL account | Cosmos DB Built-in Data Contributor | Read and write application data used by selected features. |
| Foundry account | Cognitive Services OpenAI User, Cognitive Services User | Read the account and use its model deployments during agent setup. |
| Foundry project | Foundry Project Manager, for a Hosted agent when GRANT_HOSTED_AGENT_PROJECT_MANAGER=true | Create and configure the Hosted agent in the project. |
| Speech resource | Cognitive Services Contributor, Cognitive Services User | Configure the Speech resource and use it for selected speech features. |
| Container registry | AcrPush, AcrPull | Push built images and pull them for deployment. |
Another identity deploys the application
Applies when the infrastructure already exists and a different identity runs only azd deploy, for example an application team pipeline. Skip it when the identity that ran azd provision also runs azd deploy.
azd deploy also changes Azure resources. It builds images, updates the agent host, writes application settings and assigns runtime roles to application identities. Provision assigned its service roles only to the identity that ran it.
Before deploying, select the same azd environment and application selection that provision created. Run azd env set AZURE_PRINCIPAL_ID <object-id> with the new identity's object ID. For a pipeline service principal or managed identity, also run azd env set AZURE_PRINCIPAL_TYPE ServicePrincipal. These values tell the deploy hooks which identity must receive runtime roles. See deployment identity inputs.
Ask an Azure administrator with role-assignment permission to grant the new identity:
- Contributor to update the application resources, and Role Based Access Control Administrator to assign runtime roles to application identities, on the Foundry and application resource groups.
- The service roles in Roles the template assigns for the selected services, plus any applicable role in Additional Azure roles. Ask the resource administrator to assign them at the listed scopes. Provision granted these roles only to the original identity.
- Contributor on the network resource group if
NETWORK_ISOLATION=trueand provision created a deployment-managed firewall policy.azd deployneeds it to reconcile this application's outbound allow rules inAgentLzComponentEgress. The rules allow traffic from selected component subnets to declared destination hostnames, protocols and ports. For example, the supplied orchestrator and ingestion use HTTPS/443 toopenaipublic.blob.core.windows.netto download tokenizer data. The hook preserves unrelated rules and does not change the parent firewall policy. For an external policy, it only reports the rules. The network administrator reviews and applies them. See outbound access. - The roles in Shared resources for any reused resource that the deployment needs to access.
- The Microsoft Entra Cloud Application Administrator role only if you deploy Agent App MCP Server. The deploy hook uses Microsoft Graph to create its API app registration and service principal, then assigns
MCP.Invoketo its callers. This role is not required just because the orchestrator or a custom application runs in Container Apps.
Shared resources
Who grants access: ask the administrator who manages each reused resource to grant the listed access to the deployment identity. Applies when you reuse a resource outside the three deployment groups defined in the note above. Roles on those groups do not give access to an external resource.
| You reuse | Setting | Assign to the deployment identity | What the resource team also does |
|---|---|---|---|
| A virtual network (VNet) | USE_EXISTING_VNET=true and EXISTING_VNET_RESOURCE_ID |
Network Contributor on the VNet. This lets provision create subnets and attach private endpoints. DEPLOY_SUBNETS=true by default. |
Agrees the subnet plan |
| A resource group for private endpoints | AZURE_PE_RESOURCE_GROUP_NAME, or SIDE_BY_SIDE=false with an existing VNet. SIDE_BY_SIDE=false uses the VNet resource group. |
Network Contributor on that resource group. This lets provision create private endpoints there. | Checks the placement checklist |
| A hub VNet for peering | HUB_INTEGRATION_CREATE_HUB_PEERING=true |
Network Contributor on the hub VNet, or a custom role with Microsoft.Network/virtualNetworks/peer/action. This lets provision create the spoke-to-hub peering. See peering permissions. |
Creates the hub-to-spoke peering and return routes. See the peering checklist. |
| Hub private DNS zones | EXISTING_PRIVATE_DNS_ZONE_<ZONE>_RESOURCE_ID |
Private DNS Zone Contributor on each zone, or a custom role with Microsoft.Network/privateDnsZones/join/action. This lets provision connect private endpoints to the existing zones. |
Links each zone to the VNet or forwards DNS. See the hub DNS checklist. |
| DNS records managed by Azure Policy | POLICY_MANAGED_PRIVATE_DNS=true |
No role for the deployment identity. Azure Policy creates the DNS records. | Confirms that the policy creates the records for each zone |
| A Log Analytics workspace | EXISTING_LOG_ANALYTICS_WORKSPACE_RESOURCE_ID |
Log Analytics Contributor on the workspace, or a custom role with Microsoft.OperationalInsights/workspaces/read and Microsoft.OperationalInsights/workspaces/sharedKeys/action. The deployment reads the workspace and shared keys to configure diagnostic settings. See workspace access. |
Nothing |
| An Application Insights resource | EXISTING_APPLICATION_INSIGHTS_RESOURCE_ID |
Reader on the resource. The deployment reads its connection string to connect Foundry. | Gives you the connection string for EXISTING_APPLICATION_INSIGHTS_CONNECTION_STRING |
Approve Search private links
Applies when NETWORK_ISOLATION=true and Foundry IQ uses a native Blob source.
After provision, an administrator for the document storage account and the Foundry account approves the pending private endpoint connections. Search needs these approvals to read documents over the private links. The workflow does not approve them. Use the approval procedure. See Search shared private links.
Subscription and region
Who does this: subscription or platform administrator.
- Budget. Approve the cost estimate. Charges start when provision creates resources.
- Azure Policy. In the Azure portal, open Policy > Assignments and select the subscription. Find policies with the
Denyeffect that block the plan: region, resource type, SKU, public network access, private DNS or required tags. For each conflict, change the plan or ask a policy administrator withMicrosoft.Authorization/policyExemptions/writeat the assignment scope to create a policy exemption. A denied resource stopsazd provision. - Model quota. For each model in
modelDeploymentList, check that the region supports its name, version and deployment type. Check that the available quota is at least itssku.capacity. The default models aregpt-5-nanoandtext-embedding-3-large, with capacity 100 each. Runaz cognitiveservices usage list --location <region>. Quota does not reserve capacity. See models and quota and regional considerations. - Search quota. Check the Azure AI Search service quota in the region. See Search region and quota.
- Resource providers. Register each missing provider for the services you select. Azure requires registration before it accepts deployments of that provider's resource types. Run
az provider register --namespace <namespace>, or use the Azure portal. Registration needs<namespace>/register/actionon the subscription. Subscription Contributor includes this action. The preflight check does not register providers. - Partner models. Applies when
modelDeploymentListhas a partner model sold through Azure Marketplace. A subscription Owner or Contributor can accept a public offer or private plan, which makes the model available to deploy. A private offer can also require permission on the billing account. Check the Marketplace role requirements. Skip this step for Azure OpenAI models, such asgpt-5-nano.
Resource providers
| Selection | Provider namespaces |
|---|---|
| Core deployment, network and monitoring | Microsoft.Resources, Microsoft.Authorization, Microsoft.ManagedIdentity, Microsoft.Network, Microsoft.Insights, Microsoft.OperationsManagement, Microsoft.AlertsManagement |
| Foundry and its backing services | Microsoft.CognitiveServices, Microsoft.Storage, Microsoft.DocumentDB. For Azure AI Search, Microsoft.Search. |
| Container Apps and image registry | Microsoft.App, Microsoft.ContainerRegistry |
| Key Vault, App Configuration, Log Analytics | Microsoft.KeyVault, Microsoft.AppConfiguration, Microsoft.OperationalInsights, respectively |
| Optional resources | Jumpbox: Microsoft.Compute. Durable Task Scheduler: Microsoft.DurableTask. PostgreSQL: Microsoft.DBforPostgreSQL. Grounding with Bing: Microsoft.Bing. |
For a delegated subnet, also check the VNet subscription: Microsoft.App for Container Apps, Microsoft.PowerPlatform for Power Platform or Microsoft.Web for App Service integration.
Microsoft Entra ID
Ask the Microsoft Entra administrator to complete these steps when you deploy the full stack with the reference web UI. Follow Configure login in order.
Before azd provision:
- Register the UI application. Create a single-tenant app registration and expose
api://<client-id>/user_impersonation. The registration gives the UI an API identity. Follow Register the UI application. If tenant policy blocks users from creating registrations, the user needs the Application Developer role to create this one. - Add the delegated permissions. In the UI app registration, open API permissions. Add the UI API's delegated
user_impersonationso signed-in users can call the UI API. In defaultuser_delegatedmode, also add Foundry's delegateduser_impersonationso the app can call Foundry on the user's behalf. Skip the Foundry permission inservice_identitymode. Follow Authorize delegated Foundry calls. - Grant consent. When tenant policy requires it, a Cloud Application Administrator grants tenant-wide consent so users do not have to approve these API permissions individually. Follow Grant tenant-wide admin consent.
- Give the Foundry audience. Ask the identity administrator to approve the value for
HOSTED_AGENT_RESOURCE_SCOPE, then give it to the person who deploys. The Hosted agent uses this scope to request Foundry access tokens. For example, the audiencehttps://ai.azure.comuses the scopehttps://ai.azure.com/.default. Follow the Foundry authorization setup. An infrastructure-only deployment with a Hosted agent also needs this value before provision.
After azd provision:
- Add the redirect URI. Add the frontend HTTPS URL to the UI app registration. Follow Register the final HTTPS callback.
- Create the client credential. Follow Store credentials and publish UI settings.
Agent App MCP Server
Applies only when you deploy Agent App MCP Server.
During azd deploy, the deployment identity uses Microsoft Graph to create the MCP API app registration and its service principal. It also assigns the MCP.Invoke app role to the callers. For these operations, assign the Cloud Application Administrator Microsoft Entra role to the deployment identity. This role is not needed to deploy the orchestrator or a custom application in Container Apps. See how to assign Microsoft Entra roles and MCP authentication.
Directory read for pipelines
Applies when the deployment identity is a service principal that cannot read Microsoft Entra ID. The deploy hooks need component identity IDs to configure access. Set AGENTLZ_COMPONENT_IDENTITIES to provide those IDs instead of granting broad directory read. See resource group permissions.
Terraform state
Ask the administrator who manages the Terraform state storage to complete these steps. Applies when you deploy with Terraform. Skip this section for Bicep.
- Ask the storage administrator to create or choose a storage account and blob container outside the three resource groups. The Agent Landing Zone does not create them. Use Microsoft Entra authentication. Follow Prepare remote state.
- Ask the storage administrator to assign Reader on the storage account so Terraform can read its settings, and Storage Blob Data Contributor on the container so Terraform can read and write the state file.
- Run only one deployment at a time for each state file. azd runs Terraform without state locking. See State protection.
Deployment computer
Install these tools on the computer that will run azd.
| Install | Applies when |
|---|---|
| Azure CLI | Always |
| Azure Developer CLI (azd) | Always |
| Git | Always. The hooks use it to check out and validate pinned component source. |
| PowerShell 7 | Windows |
| Python 3.12 with the hook dependencies | Always |
| Bash, jq and curl | Linux or macOS |
| Terraform, in the supported version | Terraform |
Install the azd agents extension, then run azd extension install azure.ai.agents |
Hosted agent. Skip it for Container Apps. |
| Docker | BUILD_MODE=local and a selected component uses a local Docker build. Hosted agent image preparation uses ACR Tasks and does not by itself need Docker. |
Network access:
- Git repositories: The computer or pipeline running
azdneeds network access to selected source repositories and credentials for private repositories when a matching pinned checkout is missing. The hooks clone manifest components to verify their commits and run their deployment scripts, even when an immutable image digest skips the image build. Agent App MCP Server also fetches its pinned repository when its checkout is missing. For a custom component, a local pinned checkout withsource.imageDigestdoes not need remote repository access. Azure RBAC does not grant Git access. - Image reuse: An image is reused only when the deployment is given its immutable digest:
HOSTED_AGENT_IMAGE_VERSIONfor a Hosted agent orsource.imageDigestfor a custom component. An image merely existing in ACR does not select reuse. - Private network (
NETWORK_ISOLATION=true): The deployment computer must resolve private endpoint names to private IP addresses and reach them so the hooks can check and configure the selected services. Use the jumpbox, a VPN or a runner in the VNet. Follow Connect DNS and routes. - Private image builds: Builds run in an ACR Tasks agent pool in the VNet (
DEPLOY_ACR_TASK_AGENT_POOL), or with Docker on a computer in the VNet. The pool does not connect your computer to the VNet. See Private image builds.
Deployment access does not give runtime or user access. See runtime roles.
Prerequisite summary
Use this table to identify which requests apply, then follow the linked section for the exact scope and steps.
| Prerequisite | Applies when | Why it is needed |
|---|---|---|
| Deployment identity | Every deployment | Identify the user or service identity that receives Azure roles and runs the deployment. |
| Contributor and Role Based Access Control Administrator | Every azd provision deployment |
Contributor creates and configures resources. Role Based Access Control Administrator assigns roles to the deployment and application identities. |
| Service-specific Azure roles | For each service selected in the deployment | Let the deployment configure that service and access the data needed by its components. |
| Shared-resource access | You reuse a VNet, private endpoint resource group, DNS zone, or monitoring resource outside the three deployment resource groups | Let the deployment access and configure the reused resource at its actual scope. |
| Additional deployment roles and different deploy identity | A Hosted agent uses the alternate project-role setting, a different identity runs azd deploy, or a selected option requires an extra role |
Let the identity update the application, assign runtime roles, or perform the conditional network or Foundry operation. |
| Subscription and region readiness | Every deployment, with individual checks depending on selected services and models | Confirm budget, policy, region, quota and provider registration allow the planned resources. Accept a Marketplace offer only for a selected partner model. |
| Microsoft Entra setup | Full stack with the reference UI; Hosted agent audience for applicable infrastructure-only deployments; MCP role only when deploying Agent App MCP Server | Register and authorize the UI, allow it to request Foundry tokens, and create the MCP app registration when selected. |
| Search private-link approval | Network isolation is enabled and Foundry IQ uses a native Blob source | Allow Search to read documents through the pending private endpoint connections. |
| Terraform state storage | Terraform deployments | Let Terraform read and write its remote state file. |
| Source repository access | A selected manifest component's pinned checkout is missing | Let hooks check out pinned source to verify commits and run component deployment scripts. An image digest skips building, not this source checkout. |
| Deployment computer and network access | Every deployment, with tools and network paths depending on OS and options | Run azd and its hooks, and reach selected Azure resources over the required network paths. |