Skip to content

Management Group & Policies

SMB Ready Foundation deploys governance at the management group scope — ensuring policies apply to all resources in the subscription, even those created outside of this deployment.

Tenant Root Group
└── smb-rf (SMB Ready Foundation)
├── Azure Policy assignments (MG + subscription scope)
└── Subscription: customer-subscription
├── rg-hub-smb-swc
├── rg-spoke-prod-swc
├── rg-monitor-smb-swc
├── rg-backup-smb-swc
├── rg-security-smb-swc
└── rg-migrate-smb-swc
  1. Grant management group permissions (requires Global Administrator)

    Terminal window
    cd scripts
    pwsh ./Setup-ManagementGroupPermissions.ps1

    This elevates your account to create management groups at the tenant root level. Only needed once per customer tenant.

  2. Create the management group

    Terminal window
    az account management-group create --name smb-rf --display-name "SMB Ready Foundation"
  3. Associate the customer subscription

    Terminal window
    SUBSCRIPTION_ID=$(az account show --query id -o tsv)
    az account management-group subscription add --name smb-rf --subscription $SUBSCRIPTION_ID

The pre-provision hook (hooks/pre-provision.ps1) deploys policies in two steps:

  1. Step 5a: Deploys deploy-mg.bicep to the parent management group — creates the smb-rf MG and associates the subscription (idempotent)
  2. Step 5b: Deploys modules/policy-assignments-mg.bicep to the smb-rf MG — creates MG-scoped policy assignments (additional policies are deployed at subscription scope by main.bicep)

Both steps run a what-if preview before deploying.

CategoryCountEnforcementPurpose
Compute62 Deny + 4 AuditVM SKU restrictions, no public IPs, managed disks, classic VMs, updates, endpoint protection
Network51 Deny + 4 AuditNSG on subnets, restrict ports, disable IP forwarding, flow logs
Storage53 Deny + 2 AuditHTTPS-only, no public blob, TLS 1.2, restrict network access
Identity44 AuditSQL Azure AD auth, SQL public access, MFA for owners, blocked accounts
Tagging22 DenyRequire Environment and Owner tags
Key Vault77 AuditSoft delete, purge protection, RBAC, secrets/keys expiration, resource logs
Monitoring11 AuditDiagnostic settings required for key resource types
Backup22 AuditVMs should be backed up, storage geo-redundancy
Governance11 DenyAllowed resource locations

Total: 9 Deny + 24 Audit + 1 DeployIfNotExists policy assignments

The MG-scoped policies are listed above. Additional policies are deployed at subscription scope by main.bicep: auto-backup enrollment (DINE), VM backup required (Audit), storage geo-redundancy (Audit), and allowed locations (Deny).

For the complete policy catalog with policy definition IDs, see Policy Catalog.

Management group resources (the MG itself and its MG-scoped policies) persist across azd up re-deployments. They are not torn down between scenario changes. This is by design:

  • Policies apply to the subscription regardless of which scenario is deployed
  • Re-deploying policies is idempotent (ARM update-in-place)
  • Only resource groups and budget are torn down between scenarios

To fully remove policies, use the cleanup script:

Terminal window
cd infra/bicep/smb-ready-foundation
pwsh scripts/Remove-SmbReadyFoundation.ps1 -Force -RemoveManagementGroup