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

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.

Provider selection grid showing AWS, Azure, GCP, and other providers with Installed badges

Step 2: Choose Connection Type

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

Azure Connection Type selection showing Azure Tenant (recommended) and Azure Subscription options

Connection TypeUse Case
Azure Tenant (recommended)Connect your entire tenant with automatic subscription discovery and management group hierarchy. Best for enterprise environments.
Azure SubscriptionConnect 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.

Wizard step 1 showing Azure Credentials with Environment, Tenant ID, Client ID, and Client Secret fields

FieldDescription
Azure EnvironmentSelect your Azure cloud. Options: Global Cloud (default), US Government, China Cloud.
Tenant IDYour Azure Directory (tenant) ID from the App Registration overview page.
Client ID (Application ID)The Application (client) ID from your App Registration.
Client SecretThe 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.

Wizard step 1 with credentials filled in, Tenant ID and Client ID visible, Client Secret masked

[!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.

Wizard step 2 showing Tenant Summary with subscriptions, management groups, and import status

Click Continue to configure discovery settings.

[!TIP] If discovery fails, verify that your App Registration has the Directory.Read.All Microsoft 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.

Wizard step 3 showing subscription tree with discovery level dropdowns

Discovery LevelWhat Guardrails DiscoversWhat You Get
NoneNothing, the subscription is excludedThe subscription is not imported.
Subscription OnlySubscription metadata and identitySubscription-level visibility: appears in the Accounts list and Guardrails evaluates tenant-level governance posture.
All ResourcesEverything 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.

Wizard step 4 showing Destination Folder selection with a folder selected

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:

  1. Azure Credentials: Tenant ID, Environment, Client ID, and discovery status (Verified)
  2. Subscription Selection: Number of subscriptions, management groups, and custom exclusions
  3. Destination Folder: Where the connection will be placed

Wizard step 5 showing review summary with Azure credentials, subscriptions, management groups, and folder

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.

Organization overview page showing Discovering Resources banner with progress indicators

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.

Accounts tab showing discovered Azure subscriptions with their management group and type

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

Troubleshooting

IssueSolution
Discovery fails: authentication errorVerify Tenant ID, Client ID, and Client Secret. Confirm the App Registration has Directory.Read.All permission with admin consent.
No subscriptions discoveredThe App Registration is missing Reader (or higher) RBAC at the tenant or management group level.
Client Secret expiredCreate a new Client Secret in the Azure Portal under Certificates & secrets, then retry.
Discovery shows fewer subscriptions than expectedGuardrails can only discover subscriptions where the App Registration has IAM access. Verify role assignments.
Create Connection not in Actions menuEnsure 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 stateRequired permissions are not granted. Learn more about control states.
Further assistanceOpen a Support Ticket