Connect using Workload Identity Federation
In this guide, you will use the Guardrails Create Connection wizard to connect your Azure Tenant using Workload Identity Federation (WIF), keyless authentication, with no client secret to create, store, or rotate.
For background on permissions, sovereign cloud support, and how the federation round-trip works, see Set Up Workload Identity Federation.
Prerequisites
Turbot/OwnerorTurbot/Adminpermissions in Guardrails.- Your Azure Tenant ID (Directory ID).
- An Azure App Registration in the target tenant, or use the wizard's inline helper to generate one.
- Permission in Microsoft Entra ID to create a federated identity credential on the App Registration:
Application Administrator,Cloud Application Administrator, or App Registration owner. - Permission in Azure RBAC to assign
Readerat the scope you want to govern:User Access AdministratororOwnerat that scope. - The
azCLI installed and authenticated against the target tenant (az login).
Step 1: Open the Create Connection Wizard
From the Accounts page, click Create Connection. The wizard opens on the Select a Provider screen.

Click Azure.
Step 2: Choose Connection Type
Choose Azure Tenant. The Azure Subscription option uses Client Secret authentication and is documented separately at Connect a Subscription.

Step 3: Enter Azure Credentials
The wizard opens on the Azure Credentials step. Workload Identity Federation is selected as the access mode by default. It is marked Recommended.

Fill in the fields under Your Azure App Registration:
| Field | Description |
|---|---|
| Azure Environment | Your Azure cloud. Options: Global Cloud (default), US Government, China Cloud. The wizard uses this to pick the correct federated credential audience. |
| Tenant ID | Your Azure Directory (tenant) ID. Find it in the Azure Portal under Microsoft Entra ID > Overview. |
| Client ID (appId) | The Application (client) ID from your App Registration. |
Notice there is no Client Secret field in WIF mode. WIF replaces the client secret entirely.
[!TIP] If you don't have an App Registration yet, expand Don't have an Azure App Registration? Create one to see a copy-pasteable
az ad app createcommand. Run it in Azure CLI and paste the resultingappIdinto the Client ID field.
Download and Run the Azure Setup Script
Once Tenant ID and Client ID are filled in, the Download setup-azure-wif.sh button becomes active. The script is pre-filled with your Tenant ID, Client ID, and the Guardrails WIF role ARN. You do not need to look any of those up.

- Click Download setup-azure-wif.sh.
- Open Azure CLI and run
az loginagainst your target tenant. - Run the script. It performs four actions in your tenant:
- Creates a Service Principal for the App Registration if one doesn't exist.
- Creates a federated identity credential named
turbot-guardrails-wifon the App Registration, trusting the Guardrails AWS account's OIDC issuer for the specific transit role and audience. - Grants Microsoft Graph application permissions (
Directory.Read.All,Policy.Read.All,AccessReview.Read.All) and grants admin consent. These cover the AAD / Entra ID controls included with tenant imports. - Grants
ReaderRBAC at the tenant root management group.
- Return to the Guardrails wizard and click Continue.
[!NOTE] Enterprise (self-hosted) deployments may show an additional AWS Setup Script card in this step that you must download and run in the Guardrails AWS account before the Azure script. It enables AWS outbound web identity federation and writes the OIDC issuer URL to SSM. SaaS customers (shown above) do not see this card. Turbot has already configured the AWS side. The order in both cases is AWS-side first (if shown), then Azure-side.
Step 4: Discover the Tenant
Click Discover Tenant. Guardrails performs the full WIF round-trip: assumes the WIF transit role, mints an OIDC JWT, exchanges it for an Entra ID access token, then calls Azure Resource Manager to enumerate management groups and subscriptions.
On success, you see Tenant Discovered with a summary of your subscriptions and management groups.

[!TIP] If discovery fails right after running the setup script, it is most likely Azure RBAC propagation delay. Wait 1–2 minutes and retry.
Click Continue.
Step 5: Configure Subscription Discovery
The wizard shows your discovered tenant hierarchy. Each subscription has a Discovery Level dropdown.

| Discovery Level | What Guardrails Discovers | What You Get |
|---|---|---|
| None | Nothing, the subscription is excluded | The subscription is not imported. |
| Subscription Only | Subscription metadata and identity | Subscription-level visibility, appears in the Accounts list and Guardrails evaluates tenant-level governance posture. |
| All Resources | Everything in Subscription Only, plus individual resources (storage accounts, VMs, databases, etc.) | Full Guardrails visibility: runtime controls, resource-level policy evaluation, and auto-remediation. |
Discovery levels set on a management group cascade to all its children. Individual subscriptions can override the inherited value.
[!TIP] Starting with Subscription Only minimizes overhead. You can upgrade individual subscriptions to All Resources later as your governance scope grows.
Click Continue.
Step 6: Choose Destination Folder
Choose where to place this connection in your Guardrails resource hierarchy. Select an existing folder or click Create Folder to create a new one.

Click Continue.
Step 7: Review and Connect
The final wizard step shows a summary of your configuration:
- Azure Credentials: Tenant ID, Environment, Client ID, and discovery status (Verified). The Azure review summary doesn't display a credential field because no secret is stored. WIF makes that information unnecessary.
- Subscription Selection: Number of subscriptions, management groups, and custom level overrides.
- Destination Folder: Where the connection will be placed.

Review the details and click Create Connection.
Step 8: Monitor Discovery Progress
After connecting, you are redirected to the tenant overview page. A Discovering Resources banner shows real-time progress while Guardrails enumerates your management groups and subscriptions; discovery typically takes a few minutes depending on tenant size. Once complete, the page shows the tenant's controls breakdown and recent activity.

Switch to the Hierarchy tab to see the discovered management group structure.

Step 9: Verify on the Accounts Tab
Navigate to Accounts and click the Azure filter chip to scope the list to your newly connected Azure subscriptions.

Verify that CMDB and Discovery controls are in OK state on each subscription.
The Organizations tab shows your new tenant alongside any other imported organizations.

Next Steps
- Connect a Member Subscription: Upgrade individual subscriptions to All Resources mode.
- Enable Azure Services: Control which Azure services Guardrails manages.
- Configure Real-Time Events: Set up event polling or event handlers for change detection.
- Managing Permissions: Configure RBAC management through Guardrails.
Troubleshooting
The most common failures:
| Issue | Solution |
|---|---|
| WIF radio is greyed out | The Guardrails deployment is missing the WIF transit role or its sts:GetWebIdentityToken policy. Ask your Guardrails administrator to update the TEF stack. |
| AWS Setup Script card shows up unexpectedly | You are on an Enterprise (self-hosted) deployment. Run the AWS Setup Script first in the Guardrails AWS account, then refresh the wizard tab before running the Azure script. |
| Discover Tenant fails: "No matching federated identity record found" (AADSTS70021) | The federated credential's issuer, subject, or audiences don't match the wizard values. Re-download and re-run the Azure Setup Script (don't edit the values). Verify with az ad app federated-credential list --id <CLIENT_ID>. |
| Discovery finds zero subscriptions | Azure RBAC propagation delay. Wait 1–2 minutes and retry. Verify with az role assignment list --assignee <CLIENT_ID> --all. |
Less Common Issues
| Issue | Solution |
|---|---|
| Azure Setup Script fails: "Insufficient privileges" | The signed-in Azure CLI user does not have Application Administrator, Cloud Application Administrator, or App Registration owner rights. |
| Azure Setup Script fails on role assignment: "Authorization failed" | The signed-in user does not have User Access Administrator or Owner at the target scope. |
| Discover Tenant fails: "Resource principal was not found" (AADSTS500011) | Reader RBAC was not granted at the import scope. Re-run the role assignment portion of the Azure Setup Script. |
| Controls in error state after import | The Guardrails deployment isn't running Azure-WIF-capable code. Confirm with your administrator that the deployment is on a version that supports Azure WIF. |
| Wrong audience for sovereign cloud | The federated credential audience must match the Azure Environment you selected. The wizard fills this in automatically; if you ran an old script, re-download and re-run it. |
| Further assistance | Open a Support Ticket. |