Azure

Automating Microsoft Entra External ID: CIAM tenant provisioning and branding

Benjamin Abt mail@benjamin-abt.com (BEN ABT)
Azure

A long guide shows how to provision Microsoft Entra External ID customer identity environments repeatably with PowerShell, YAML and Azure Resource Manager, then verify domains and manage branding through Microsoft Graph. It matters to teams that want dev, staging and production tenants generated from one source instead of manual portal clicks.

Key points

  • The target resource is `Microsoft.AzureActiveDirectory/ciamDirectories`, with ARM calls pinned to the `2023-05-17-preview` API version.
  • Resource group, tags and a CanNotDelete lock are handled by ARM; domains and branding by Microsoft Graph in the new external tenant.
  • Delegated Graph permissions are `Domain.ReadWrite.All` and `OrganizationalBranding.ReadWrite.All`, with Domain Name Administrator and Organizational Branding Administrator as least-privilege roles.
  • Because `Invoke-AzRestMethod` does not throw, the script inspects status codes: 404 means not created yet, every other failure stops the run.
  • Domain verification is split into resumable steps (POST /domains, verificationDnsRecords, verify, then `isDefault`) since DNS records must be published externally.
  • Branding writes go through `/branding/localizations/{locale}` rather than `PATCH /organization/{id}/branding`, and an en-US localization is not the default branding.

Real-world use

  • A team running a customer portal or subscription service generating dev, staging and production external tenants from one YAML file.
  • Standardizing tenant creation, tagging and deletion locks through Azure Resource Manager so portal drift stops creeping in.
  • Resuming domain verification in a pipeline without DNS provider access: stop, publish the records, then rerun the same stage.
  • Per-environment colors and labels on the sign-in page so testers do not sign in to the wrong tenant.

This summary was generated by the agent from the original post on Benjamin Abt. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message