This repository contains infrastructure-as-code and pipeline assets for deploying the Break Glass Sign‑In Monitoring solution using Bicep templates. The deployment configures tenant- and subscription-scoped monitoring resources to capture and alert on "break glass" sign‑in activity in Entra ID.
This README provides an entry point and the common steps required to deploy the Break Glass solution. For the full, solution-specific deployment steps, refer to the README in the _Bicep folder.
- Repository layout
- Quick start
- Important pre-deployment notes
- Authentication and subscription selection
- Required permissions (least privilege)
- Required resource providers
- Parameters and parameter file
- Validate (What‑If) and execute tenant deployment
- Post-deployment checks
- Troubleshooting & common issues
- Security & best practices
- Support & contributions
- License
| Path | Description |
|---|---|
_Bicep |
Bicep templates for the Break Glass Sign‑In Monitoring solution and a dedicated README with detailed deployment instructions. |
_JSON |
(If present) ARM/JSON artifacts (legacy/alternate templates). |
_Pipelines |
CI/CD pipeline definitions for automated deployments. |
_Scripts |
Helper scripts (PowerShell / Bash) used by the deployment or for post-deploy tasks. |
Customers |
Customer-specific parameter files or pipeline variables. |
LICENSE |
Project license. |
-
Clone the repository:
git clone <repo-url>
-
Open the Bicep solution README:
cd _Bicep && less README.md # or open in your editor
-
Authenticate to Azure and select the subscription used for subscription-scoped resources:
az login az account set --subscription "00000000-0000-0000-0000-000000000000"
Important
Replace all placeholders in parameter files and scripts (subscription IDs, USERNAME/assignee, object IDs, passwords, regions) before running any deployment commands.
- The deployment includes tenant-scoped Entra ID diagnostic settings and subscription-scoped Azure Monitor resources. This requires permissions across both tenant and subscription scopes.
- Do NOT commit secrets (passwords, keys, connection strings) to source control. Use Azure Key Vault and references where possible.
az login
az account set --subscription "00000000-0000-0000-0000-000000000000"The deploying identity must have permissions across tenant and subscription scopes:
- User Access Administrator — required to assign RBAC roles at the root management group.
- Contributor (or Owner) at the root management group
/— required because themicrosoft.aadiam/diagnosticSettings/writeoperation is evaluated at tenant root scope and cannot be delegated via custom roles at a lower scope.
# Verify existing assignments on root scope
az role assignment list --scope "/"
# Assign Contributor to the deploying principal (replace USERNAME)
az role assignment create --assignee "USERNAME" --role "Contributor" --scope "/"The deployment also creates subscription-scoped resources (resource groups, Log Analytics workspace, action groups, alert rules). The deploying identity needs roles at the target subscription:
- A minimal custom role that allows Resource Group creation (if you want to limit RBAC).
- Monitoring Contributor and Log Analytics Contributor roles for creating monitoring resources and alert rules.
# Create the custom role from a local JSON definition
az role definition create --role-definition "./resource-group-creator.json"
# Assign roles at the subscription (replace SUBSCRIPTION_ID and USERNAME)
az role assignment create --assignee "USERNAME" --role "Custom Resource Group Creator" --scope "/subscriptions/00000000-0000-0000-0000-000000000000"
az role assignment create --assignee "USERNAME" --role "Monitoring Contributor" --scope "/subscriptions/00000000-0000-0000-0000-000000000000"
az role assignment create --assignee "USERNAME" --role "Log Analytics Contributor" --scope "/subscriptions/00000000-0000-0000-0000-000000000000"Tenant/subscription-level deployments require the following resource providers to be registered:
microsoft.aadiamMicrosoft.Insightsmicrosoft.operationalinsights
Check registration status:
az provider show --namespace microsoft.aadiam --query "registrationState" -o tsv
az provider show --namespace Microsoft.Insights --query "registrationState" -o tsv
az provider show --namespace microsoft.operationalinsights --query "registrationState" -o tsvRegister providers if necessary:
az provider register --namespace microsoft.aadiam
az provider register --namespace Microsoft.Insights
az provider register --namespace microsoft.operationalinsightsNote
Provider registration can take several minutes. Re-run the status checks until they report Registered.
- The Bicep deployment uses a parameters file (e.g.
main.bicepparam). Edit the file and replace placeholders such as subscription IDs, usernames, and any environment-specific values. - Ensure you do not place secrets in the parameter file — use Key Vault references when possible.
-
Use What‑If first to preview changes (tenant-scoped deployment example):
az deployment tenant create \ --location "Switzerland North" \ --parameters "./main.bicepparam" \ --what-if
-
Execute the tenant-scoped deployment:
az deployment tenant create \ --location "Switzerland North" \ --parameters "./main.bicepparam"
Note
- The deployment location is a deployment operation location and does not change resource regions inside the templates.
- Choose an Azure region supported for tenant deployment operations (e.g.
switzerlandnorth).
- Verify the Log Analytics workspace and configured diagnostic settings exist.
- Confirm action groups and scheduled query alerts are created and configured.
- Check Entra ID diagnostic settings are applied and target the Log Analytics workspace.
- Review role assignments and resource groups created by the deployment.
| Issue | Resolution |
|---|---|
AuthorizationFailed on Microsoft.Authorization/roleAssignments/write |
Ensure the deploying principal has User Access Administrator or Owner where role assignments are being created. |
microsoft.aadiam/diagnosticSettings/write failing |
This operation is evaluated at tenant root — ensure Contributor (or Owner) at root scope / is assigned. |
| Provider registration pending | Re-check and wait until the state is Registered. |
| Missing or invalid parameters | Confirm all required fields (subscription IDs, names, prefixes) are present and valid in the .bicepparam file. |
- Never commit secrets to source control. Use Azure Key Vault and Key Vault references in parameter files.
- Use least-privilege RBAC roles. Where possible, use tailored custom roles that contain only the required permissions.
- Validate deployments using What‑If and test changes in non-production environments first.
- Review and audit any tenant-level permissions and role assignments applied during deployment.
- Repository owner: Duo Infernale
- Maintainers / Authors: Michele Blum & Flavio Meyer
- Issues: open an issue in this repository or contact the maintainers.
- Contributions: submit pull requests. Please avoid including secrets and follow any contribution guidelines in the repo.
This project is licensed under the MIT License. See LICENSE for details.