Connect using Client Secret
In this guide, you will connect your Azure Tenant to Turbot Guardrails using the Create Connection wizard with a client secret. The wizard verifies your App Registration credentials, discovers your subscriptions and management groups, and connects your tenant, all in a single flow.
[!TIP] Workload Identity Federation is the recommended path for new deployments, no client secret to store or rotate. This guide covers the client secret method.
Prerequisites
Turbot/AdminorTurbot/Ownerpermissions in Guardrails.- An Azure App Registration with Client Secret, API Permissions, and IAM Permissions configured.
- Your Azure Tenant ID (Directory ID), available from the Azure Portal under Microsoft Entra ID > Overview.
Step 1: Open the Create Connection Wizard
From the Accounts page, click Create Connection. The wizard displays a grid of available cloud providers. Select Azure.

Step 2: Choose Connection Type
Choose Azure Tenant (recommended). This connects your entire tenant with automatic subscription discovery and management group hierarchy support.

| Connection Type | Use Case |
|---|---|
| Azure Tenant (recommended) | Connect your entire tenant with automatic subscription discovery and management group hierarchy. Best for enterprise environments. |
| Azure Subscription | Connect a single standalone subscription. Quick setup for isolated environments. |
Step 3: Enter Azure Credentials
The wizard presents a 5-step process. Step 1 collects your App Registration credentials.

| Field | Description |
|---|---|
| Azure Environment | Select your Azure cloud. Options: Global Cloud (default), US Government, China Cloud. |
| Tenant ID | Your Azure Directory (tenant) ID from the App Registration overview page. |
| Client ID (Application ID) | The Application (client) ID from your App Registration. |
| Client Secret | The client secret value you created in the Certificates & secrets section. |
Enter your credentials and click Continue. Guardrails validates the credentials and discovers your tenant structure.

[!NOTE] The Client Secret is masked in the UI. Guardrails stores it encrypted as a policy on the tenant resource.
Step 4: Review Discovery Results
After successful credential validation, the wizard shows your Tenant Summary: the Tenant ID, number of subscriptions, management groups, and how many are already imported.

Click Continue to configure discovery settings.
[!TIP] If discovery fails, verify that your App Registration has the
Directory.Read.AllMicrosoft Graph permission with admin consent granted, and that the Tenant ID and Client ID are correct.
Step 5: Configure Subscription Discovery
The wizard shows your discovered tenant hierarchy with a Discovery Level dropdown on each subscription.

| 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.
Click Connect All & Continue.
Step 6: Choose Destination Folder
Choose where to place this connection in your Guardrails resource hierarchy.

Select an existing folder from the Destination Folder dropdown, or click Create Folder to create a new one. While you can import a tenant at the Turbot root, importing into a folder provides greater flexibility for policy scoping.
Click Continue.
Step 7: Review and Connect
The final step shows a summary of your configuration:
- Azure Credentials: Tenant ID, Environment, Client ID, and discovery status (Verified)
- Subscription Selection: Number of subscriptions, management groups, and custom exclusions
- Destination Folder: Where the connection will be placed

Review the details and click Create Connection.
Step 8: Monitor Discovery Progress
After connecting, you're redirected to the Organization Overview page. A Discovering Resources banner shows real-time progress.

Click Refresh now to update the display, or wait for automatic updates.
[!NOTE] Discovery typically takes a few minutes depending on the size of your tenant. You can navigate away and return later.
Step 9: Verify on the Accounts Tab
Navigate to Accounts. Your newly connected Azure subscriptions appear in the accounts list.

Each subscription shows its parent management group, account type, and the number of active controls.
Import via Terraform
Administrators can import a tenant using Terraform. If your Terraform environment has not been set up, see the Terraform Setup Page.
# Create the Azure > Tenant resource in Guardrails
resource "turbot_resource" "tenant_resource" {
parent = var.parent_resource
type = "tmod:@turbot/azure#/resource/types/tenant"
akas = ["azure:///tenants/your tenant id"] //highlight-line
metadata = jsonencode({
"azure" : {
"tenantId" : "your tenant id" //highlight-line
}
})
data = jsonencode({
"id" : "your tenant id" //highlight-line
})
}
# Set the credentials for the Tenant via Guardrails policies
resource "turbot_policy_setting" "environment" {
resource = turbot_resource.tenant_resource.id
type = "tmod:@turbot/azure#/policy/types/environment"
value = "Global Cloud"
# value = "US Government"
}
resource "turbot_policy_setting" "clientKey" {
resource = turbot_resource.tenant_resource.id
type = "tmod:@turbot/azure#/policy/types/clientKey"
value = "{Guardrails application client key}"
}
resource "turbot_policy_setting" "clientId" {
resource = turbot_resource.tenant_resource.id
type = "tmod:@turbot/azure#/policy/types/clientId"
value = "{Guardrails application client id}" //highlight-line
}
resource "turbot_policy_setting" "tenantId" {
resource = turbot_resource.tenant_resource.id
type = "tmod:@turbot/azure#/policy/types/tenantId"
value = "{tenant id}" //highlight-line
}
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
| Issue | Solution |
|---|---|
| Discovery fails: authentication error | Verify Tenant ID, Client ID, and Client Secret. Confirm the App Registration has Directory.Read.All permission with admin consent. |
| No subscriptions discovered | The App Registration is missing Reader (or higher) RBAC at the tenant or management group level. |
| Client Secret expired | Create a new Client Secret in the Azure Portal under Certificates & secrets, then retry. |
| Discovery shows fewer subscriptions than expected | Guardrails can only discover subscriptions where the App Registration has IAM access. Verify role assignments. |
| Create Connection not in Actions menu | Ensure you have Turbot/Admin or Turbot/Owner permissions. |
| Azure provider shows "Not Installed" | The Azure mod needs to be installed in your workspace. Contact your Guardrails administrator. |
| Controls in ERROR state | Required permissions are not granted. Learn more about control states. |
| Further assistance | Open a Support Ticket |