This guide provides complete instructions for deploying the AI Application in Production accelerator to your Azure subscription.
To deploy this solution accelerator, ensure you have access to an Azure subscription with the necessary permissions.
| Permission | Required For | Scope |
|---|---|---|
| Owner or Contributor + User Access Administrator | Creating resources and role assignments | Subscription or Resource Group |
| Application Administrator (Azure AD) | Creating app registrations (if needed) | Tenant |
Note: The deployment creates Managed Identities and assigns roles automatically, which requires elevated permissions.
Temp files: Post-provision scripts write helper
.envfiles to your OS temp directory (handled automatically). No manual creation ofC:\tmpis needed on Windows.
| Tool | Minimum Version | Installation |
|---|---|---|
| Azure CLI | 2.61.0+ | Install Azure CLI |
| Azure Developer CLI (azd) | 1.15.0+ | Install azd |
| Git | Latest | Install Git |
| PowerShell | 7.0+ | Install PowerShell |
Windows-specific shell requirement: Preprovision hooks run with
shell: sh. Install Git for Windows (includes Git Bash) or runazdfrom WSL/Ubuntu sobash/shis on PATH. If you prefer pure PowerShell, updateazure.yamlto pointpreprovisionto the providedpreprovision.ps1.
| Resource | Requirement |
|---|---|
| Microsoft Fabric | Access to create F8 capacity and workspace, OR existing Fabric capacity ID |
| Microsoft Purview | Existing tenant-level Purview account resource ID |
Check Azure Products by Region to ensure the following services are available in your target region:
- Microsoft Foundry
- Azure OpenAI Service
- Azure AI Search
- Microsoft Fabric
- Azure Bastion
Recommended Region: EastUS2 (tested and validated)
Pick from the options below to see step-by-step instructions.
Deploy in GitHub Codespaces
- Click the Open in GitHub Codespaces button above
- Accept the default values on the create Codespaces page
- Wait for the environment to build (this may take several minutes)
- Open a terminal window if not already open
- Continue with Deployment Steps below
Deploy in VS Code Dev Containers
- Ensure you have Docker Desktop running
- Click the Open in Dev Containers button above
- VS Code will prompt to reopen in a container—accept this
- Wait for the container to build and start
- Continue with Deployment Steps below
Deploy from Local Environment
If you're not using Codespaces or Dev Containers:
-
Clone the repository with submodules:
git clone --recurse-submodules https://github.com/microsoft/Deploy-Your-AI-Application-In-Production.git cd Deploy-Your-AI-Application-In-Production -
If you already cloned without submodules:
git submodule update --init --recursive
-
Ensure all required tools are installed (see Required Tools)
-
Continue with Deployment Steps below
Note (Windows): Run
azd upfrom Git Bash or WSL so thepreprovisionhook can execute. If you want to stay in PowerShell, editazure.yamlto usepreprovision.ps1instead of the.shscript.
# Login to Azure
azd auth login
# Verify your subscription
az account showIf you need to specify a tenant:
azd auth login --tenant-id <your-tenant-id># Create a new azd environment
azd env new <environment-name>
# Set your subscription (if not default)
azd env set AZURE_SUBSCRIPTION_ID <subscription-id>
# Set your target location
azd env set AZURE_LOCATION eastus2Required Parameters
Edit infra/main.bicepparam or set environment variables:
| Parameter | Description | Example |
|---|---|---|
purviewAccountResourceId |
Resource ID of existing Purview account | /subscriptions/.../Microsoft.Purview/accounts/... |
aiSearchAdditionalAccessObjectIds |
Array of Entra object IDs to grant Search roles | ["00000000-0000-0000-0000-000000000000"] |
fabricCapacityMode |
Fabric capacity mode: create, byo, or none |
create |
fabricWorkspaceMode |
Fabric workspace mode: create, byo, or none |
create |
fabricCapacitySku |
Fabric capacity SKU (only used when fabricCapacityMode=create) |
F8 (default) |
fabricCapacityAdmins |
Fabric capacity admin principals (UPN emails or Entra object IDs) (required when fabricCapacityMode=create) |
["user@contoso.com"] |
fabricCapacityResourceId |
Existing Fabric capacity ARM resource ID (required when fabricCapacityMode=byo) |
/subscriptions/.../providers/Microsoft.Fabric/capacities/... |
fabricWorkspaceId |
Existing Fabric workspace ID (GUID) (required when fabricWorkspaceMode=byo) |
00000000-0000-0000-0000-000000000000 |
fabricWorkspaceName |
Existing Fabric workspace name (used when fabricWorkspaceMode=byo) |
my-existing-workspace |
# Example: Set Purview account
azd env set purviewAccountResourceId "/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.Purview/accounts/<account-name>"
# Example: Disable all Fabric automation
azd env set fabricCapacityMode none
azd env set fabricWorkspaceMode noneOptional Parameters
| Parameter | Description | Default |
|---|---|---|
aiSearchAdditionalAccessObjectIds |
Entra ID object IDs for additional Search access | [] |
networkIsolationMode |
Network isolation level | AllowInternetOutbound |
vmAdminUsername |
Jump box VM admin username | azureuser |
vmAdminPassword |
Jump box VM admin password | (prompted) |
Quota Recommendations
By default, the GPT model capacity in deployment is set to 30k tokens.
We recommend increasing the capacity to 100k tokens, if available, for optimal performance.
To check and adjust quota settings, follow the Quota Check Guide.
Reusing Existing Resources
Log Analytics Workspace: See Re-use Log Analytics for instructions.
Run the deployment command:
azd upThis command will:
- Run pre-provision hooks (validate environment)
- Deploy all Azure infrastructure (~30-40 minutes)
- Run post-provision hooks (configure Fabric, Purview, Search RBAC)
Note: The entire deployment typically takes 45-60 minutes.
You'll see output like:
Provisioning Azure resources (azd provision)
...
Running postprovision hooks
✓ Fabric capacity validation
✓ Fabric domain creation
✓ Fabric workspace creation
✓ Lakehouse creation (bronze, silver, gold)
✓ Purview registration
✓ OneLake indexing setup
✓ AI Foundry RBAC configuration
After successful deployment, verify all components:
# Check deployed resources
az resource list --resource-group rg-<environment-name> --output tableThen follow the Post Deployment Steps to validate:
- Fabric capacity is Active
- Lakehouses are created
- AI Search index exists
- Foundry playground is accessible
- Navigate to app.fabric.microsoft.com
- Open your workspace → bronze lakehouse
- Upload PDF documents to
Files/documents/ - The OneLake indexer will automatically index new content
- Navigate to ai.azure.com
- Open your AI Foundry project
- Go to Playgrounds → Chat
- Click Add your data → Select your Search index
- Test with a sample query
See Deploy App from Foundry for instructions on publishing the chat experience to Azure App Service.
Fabric Capacity is Paused
If the Fabric capacity shows as "Paused":
# Resume the capacity
az fabric capacity resume --capacity-name <name> --resource-group <rg>Post-Provision Hooks Failed
To re-run all post-provision hooks:
azd hooks run postprovisionTo run a specific script:
eval $(azd env get-values)
pwsh ./scripts/automationScripts/<script-name>.ps1AI Search Connection Fails in Foundry
Verify RBAC roles are assigned:
SEARCH_ID=$(az search service show --name <search-name> --resource-group <rg> --query id -o tsv)
az role assignment list --scope $SEARCH_ID --output tableRe-run RBAC setup if needed:
eval $(azd env get-values)
pwsh ./scripts/automationScripts/OneLakeIndex/06_setup_ai_foundry_search_rbac.ps1Template Spec Size Limit Error
If you see a 4MB limit error, ensure you're using the latest version of the submodule:
cd submodules/ai-landing-zone
git pull origin main
cd ../..
azd upFor more troubleshooting steps, see Troubleshooting.
To delete all deployed resources:
azd downNote: This will delete all resources in the resource group. Fabric capacity and Purview (if external) will not be affected.
To also purge soft-deleted resources:
azd down --purgeAfter deployment:
- Verify Deployment - Confirm all components are working
- Upload Documents - Add your PDFs to the Fabric bronze lakehouse
- Test the Playground - Chat with your indexed data
- Publish the App - Deploy to Azure App Service
- Enable DSPM - Configure governance insights
- Required Roles & Scopes
- Parameter Guide - includes model deployment configuration
- Accessing Private Resources