AzureLive-testedattested

User-Assigned Managed Identities

A map-driven module creating one or many user-assigned managed identities, each with optional workload identity federation (OIDC) and least-privilege RBAC role assignments - no secrets to rotate.

terraformAzureazure

Compare Identity & Access across clouds →

Part of: Azure Production Landing Zone

azure-managed-identityvizier v1.2.0

Verification

Live-tested

Really deployed to a cloud sandbox, verified against its outputs and assertions, then destroyed - with the teardown confirmed.

Conformance

  • Static validation (fmt · validate · tflint)
  • Security scan clean (Checkov)
  • Plan test superseded by live test

Provenance

Functional

  • Live-tested - applied, verified, destroyed

Last verified 2026-06-30 · how we verify

Verify this download

cosign · sha-256

Don't take our word for it. Every release is signed with cosign - check the bytes against our pinned public key before you trust them.

# 1. Our pinned public key - fetch once, trust out-of-band
curl -O https://www.iac-bazaar.com/cosign.pub

# 2. This module's Sigstore bundle
curl -o azure-managed-identity-1.0.0.sigstore.json \
  https://www.iac-bazaar.com/api/artifacts/azure-managed-identity/signature

# 3. Verify the tarball you downloaded
cosign verify-blob \
  --key cosign.pub \
  --bundle azure-managed-identity-1.0.0.sigstore.json \
  azure-managed-identity-1.0.0.tar.gz
# → Verified OK

# 4. (optional) confirm the checksum too
echo "3f71ed475d592224f2c14d3033a5e9783b9bd5dd75c80a61896850bcd078db2b  azure-managed-identity-1.0.0.tar.gz" | sha256sum -c

Use it from the registry

terraform · opentofu
module "managed_identity" {
  source  = "www.iac-bazaar.com/iac-bazaar/azure-managed-identity/azure"
  version = "1.0.0"
}

Needs a registry token from /account/tokens. The module itself is free; the account is what identifies you. Full setup: registry docs.

Cite it in your README

badge · attribution

Paste this beside the module in the repository that uses it. The badge is rendered from this artifact's verification record, so it reads live-tested because the record says so, and the link lands on this page.

README.md, GitLab, Gitea
[![IaC Bazaar: live-tested](https://www.iac-bazaar.com/api/artifacts/azure-managed-identity/badge)](https://www.iac-bazaar.com/catalog/azure-managed-identity?utm_source=syndication&utm_medium=readme&utm_campaign=artifact)

Terraform module 1.0.0, live-tested on IaC Bazaar: [User-Assigned Managed Identities](https://www.iac-bazaar.com/catalog/azure-managed-identity?utm_source=syndication&utm_medium=readme&utm_campaign=artifact)

```hcl
module "managed_identity" {
  source  = "www.iac-bazaar.com/iac-bazaar/azure-managed-identity/azure"
  version = "1.0.0"
}
```

Preview:IaC Bazaar: live-tested

Inputs & outputs

Create a free account to read this module's contract

The declared contract - every input name, type, default and description, plus every output - is shown to signed-in accounts, not to anonymous visitors.

A free account sees the contract of every module in the catalogue. There is no subscription and nothing to buy - the modules are free to download, and they run under Vizier.

Documentation

azure-managed-identity

Create one or many user-assigned managed identities (a map-driven module), each with optional workload identity federation (OIDC) and least-privilege RBAC role assignments. A managed identity is the secret-free way to give an app, VM, AKS workload or CI pipeline an Entra ID principal: no client secret to store or rotate. Consumes an existing resource group. Works with Terraform and OpenTofu (>= 1.6), azurerm provider >= 4.0, < 5.0. Creating identities is free.

Security notes

  • No secrets. A user-assigned managed identity has no password. Prefer federated credentials over app-registration client secrets for any external workload (GitHub Actions, GitLab, Kubernetes service accounts, other clouds) so there is nothing long-lived to leak.
  • Federated credential subject is the trust boundary. Scope it tightly (e.g. a specific repo + branch/environment, or a specific Kubernetes namespace
    • service account) — a loose subject lets unintended workloads mint tokens.
  • Least-privilege RBAC. Grant the narrowest role at the narrowest scope that works (resource over resource group over subscription). Role assignments set principal_type = "ServicePrincipal" and skip_service_principal_aad_check = true so an assignment created in the same apply as the identity does not race Entra ID replication.
  • Lifecycle. Identity name, resource group and location are immutable — changing any of them replaces the identity (and breaks anything that still references its principal/client id).

Requirements

RequirementVersion
Terraform / OpenTofu>= 1.6
hashicorp/azurerm>= 4.0, < 5.0

The Microsoft.ManagedIdentity resource provider must be registered on the subscription (and Microsoft.Authorization if you use role_assignments).

License

Commercial — IaC Bazaar EULA. © IaC Bazaar. Original work (not derived from a third-party module).

Usage code & full reference need an account

The complete copy-paste usage, the full input/output reference, and operational notes are free with an account - shown here and bundled in the download. Sign in and this section fills in.

  • Usage
  • Inputs
  • Outputs

Related modules

Static validatedLive test pending

azure-b2c

An Azure AD B2C tenant created where its customer directory should live, on PremiumP1 or P2, linked to the subscription that pays per monthly active user. Data residency and the onmicrosoft.com name are chosen once and cannot change; user flows, policies and app registrations are configured inside the tenant with an azuread provider pointed at the exported tenant ID.

View module
Static validatedLive test pending

azure-ddos-protection-plan

The plan is a fixed monthly charge of roughly three thousand dollars from the moment it exists, attached VNets or not; it protects only the VNets that reference it; and DDoS IP Protection on the addresses themselves is an order of magnitude cheaper for a handful. The charge accepted by name before the plan is created, the plan ID exported for azure-vnet, an output that says it bills unattached.

View module
Static validatedLive test pending

azure-firewall

Every security feature on this service defaults to telling you, not to stopping it: threat_intelligence_mode defaults to Alert, which logs traffic to known-malicious destinations and forwards it, and intrusion detection does the same. Deny for both here, with the DNS proxy on so FQDN rules and the client agree on an answer.

View module
Static validatedLive test pending

azure-entra-domain-services

Microsoft Entra Domain Services with NTLM v1, TLS 1.0 and RC4 off and Kerberos armoring on, the WinRM network security group the service insists on, the AAD DC Administrators group with the members you name, and the Domain Controller Services principal registered, all of which fail late when missing. Notifications go to the admins; filtered sync and LDAPS are inputs.

View module
Static validatedLive test pending

azure-purview

A Microsoft Purview account for the data map with public network access off, the managed Event Hub that bills monthly whether used or not turned off, a system identity, and Storage Blob Data Reader granted to that identity on every storage account it will scan, since a scan fails otherwise. The account bills for data map capacity from creation; public access is accepted by name.

View module
Static validatedLive test pending

azure-waf-policy

Detection mode evaluates every rule, logs every match and forwards every request - the dashboard fills with blocked-looking entries while the backend receives them all. Prevention by default, Detection only by name. A policy attached to no listener protects nothing, so the attached listeners are an output; every exclusion is a hole and has to carry a reason.

View module