terraform
Deploy Fabric Landing Zones with Automation
To align with Infrastructure-as-Code (IaC) principles and ensure scalable, consistent deployment of Microsoft Fabric landing zones, this section outlines an end-to-end automated deployment process using Azure CLI and Bicep templates, aligned with the Azure landing zone accelerator.
Overview
The deployment consists of two main phases:
- Bootstrap Phase – Sets up DevOps infrastructure (either GitHub or Azure DevOps) and seeds repositories and pipelines.
- Platform Deployment Phase – Provisions the Fabric-compatible resources including Microsoft Entra groups, management groups, policy assignments, and Fabric-specific identities.
Prerequisites
- Azure CLI installed
- Entra ID Global Administrator role
- GitHub repository (or Azure DevOps project)
- Fabric tenant with at least one workspace created
Bootstrap Phase
In this phase, we prepare your environment by setting variables and ensuring identity and resource hierarchy readiness.
Set context and environment variables:
az login
az account set --subscription "<your-subscription-id>"
export LOCATION="westeurope"
export MG_ROOT="contoso-root"
export MG_PLATFORM="contoso-platform"
Create management group hierarchy and assign policies via Bicep:
az deployment tenant create \
--location $LOCATION \
--template-file "./bicep/managementGroups.bicep" \
--parameters rootManagementGroupName=$MG_ROOT platformManagementGroupName=$MG_PLATFORM
Refer to Azure landing zones Bicep modules for reusable templates.
Platform Deployment Phase
Once the hierarchy is in place, deploy the Fabric-specific resources using the Bicep modules.
az deployment sub create \
--location $LOCATION \
--template-file "./bicep/fabricLandingZone.bicep" \
--parameters \
location=$LOCATION \
fabricTenantDomain="contoso.onmicrosoft.com" \
enableConnectivity=true \
enableManagement=true
REST API Integration (Optional)
You can register workspaces via REST once the infrastructure is deployed:
POST https://api.fabric.microsoft.com/v1/workspaces
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "finance-analytics",
"domain": "Contoso",
"region": "westeurope"
}
XMLA Script for Dataset Deployment (Optional)
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Create>
<Database>
<ID>FinanceDataset</ID>
<Name>Finance Dataset</Name>
</Database>
</Create>
</Batch>
Deploy using VS Code with the Tabular Editor or Power BI XMLA endpoint.
Resources
- Azure landing zones Bicep overview
- Azure Verified Modules for Platform Landing Zones
- ALZ GitHub Repository
- Microsoft Fabric Automation
Deployment with Bicep
The Bicep files used in this example are located in the ./bicep directory:
managementGroups.bicep: Creates the management group hierarchy including policy assignmentsfabricLandingZone.bicep: Deploys core resources for Fabric landing zones such as Log Analytics, Application Insights, and Fabric-related identities
Step-by-step Instructions
# Log in and set subscription
az login
az account set --subscription "<your-subscription-id>"
# Configure local environment
export LOCATION="westeurope"
export MG_ROOT="contoso-root"
export MG_PLATFORM="contoso-platform"
# Deploy Management Groups
az deployment tenant create \
--location $LOCATION \
--template-file "./bicep/managementGroups.bicep" \
--parameters rootManagementGroupName=$MG_ROOT platformManagementGroupName=$MG_PLATFORM
# Deploy Fabric Landing Zone
az deployment sub create \
--location $LOCATION \
--template-file "./bicep/fabricLandingZone.bicep" \
--parameters \
location=$LOCATION \
fabricTenantDomain="contoso.onmicrosoft.com" \
enableConnectivity=true \
enableManagement=true