Connect an Azure Subscription

In this guide, you will connect a standalone Azure Subscription to Turbot Guardrails using the Create Connection wizard.

[!TIP] For enterprise environments, connecting your Azure Tenant is the recommended approach. Tenant import discovers all subscriptions and management groups automatically. Use this guide only when you need to import a single, isolated subscription.

Prerequisites

Step 1: Open the Create Connection Wizard

From the Accounts page, click Create Connection.

Actions dropdown with Create Connection option

Step 2: Select Azure and Choose Subscription

Select Azure from the provider grid.

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

Then choose Azure Subscription as the connection type.

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

Step 3: Enter Azure Credentials

The wizard collects your App Registration credentials and the target subscription.

Wizard showing Azure Subscription credentials form with Environment, Subscription ID, Tenant ID, Client ID, and Client Secret fields

FieldDescription
Azure EnvironmentSelect your Azure cloud. Options: Global Cloud (default), US Government, China Cloud.
Subscription IDThe ID of the Azure subscription you want to connect.
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.

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

[!NOTE] The Client Secret is always masked in the UI. Guardrails stores it securely and uses it to authenticate API requests to your Azure environment.

Step 4: Test Connection

Guardrails verifies that it can connect to your Azure subscription using the configured credentials.

Test Connection page showing Subscription ID and Tenant ID with a Test Connection button

Click Test Connection. After a successful test, the page shows a Connection Successful confirmation with the subscription's display name.

Test Connection page showing Connection Verified with display name gfb-central-it-prod-sub

Click Continue to proceed.

Step 5: Choose Destination Folder

Select where to place this subscription in your Guardrails resource hierarchy. While you can import a subscription at the Turbot level, it is recommended that you import into a Guardrails folder, as it provides greater flexibility and ease of management.

Destination Folder selection with Goliath folder selected

Click Continue to proceed.

Step 6: Review and Connect

The final step shows a summary of your configuration: destination folder, Azure credentials, and connection test status.

Review page showing Destination Folder (Goliath), Azure Credentials with Subscription ID and Tenant ID, and Connection Test Verified

Review the details and click Connect Azure Subscription to start the import. CMDB and Discovery controls are enabled by default. Guardrails begins discovering the resources in the Azure subscription. Resources start appearing right away, and resource discovery continues to run in the background.

Step 7: Verify the Import

Navigate to Accounts in the left sidebar. Your newly connected Azure subscription appears in the accounts list with a SUBSCRIPTION type label.

Accounts tab showing Azure subscriptions with their folder and type

Import via Terraform

Administrators can import subscriptions using Terraform. If your Terraform environment has not been set up, head over to the Terraform Setup Page.

# Create the Azure > Subscription resource in Guardrails
resource "turbot_resource" "subscription_resource" {
  parent = var.parent_resource
  type   = "tmod:@turbot/azure#/resource/types/subscription"
  metadata = jsonencode({
    "azure" : {
      "subscriptionId" : "{your subscription id}", //highlight-line
      "tenantId" : "{your tenant id}" //highlight-line
    }
  })
  data = jsonencode({
    "subscriptionId" : "{your subscription id}" //highlight-line
  })
}

# Set the credentials for the subscription via Guardrails policies
# Azure > Environment
resource "turbot_policy_setting" "environment" {
  resource = turbot_resource.subscription_resource.id
  type     = "tmod:@turbot/azure#/policy/types/environment"
  value    = "Global Cloud"
  # value    = "US Government"
}
# Azure > Client Key
resource "turbot_policy_setting" "clientKey" {
  resource = turbot_resource.subscription_resource.id
  type     = "tmod:@turbot/azure#/policy/types/clientKey"
  value    = "{turbot application client key}"
}
# Azure > Client ID
resource "turbot_policy_setting" "clientId" {
  resource = turbot_resource.subscription_resource.id
  type     = "tmod:@turbot/azure#/policy/types/clientId"
  value    = "{turbot application client id}"
}
# Azure > Tenant ID
resource "turbot_policy_setting" "tenantId" {
  resource = turbot_resource.subscription_resource.id
  type     = "tmod:@turbot/azure#/policy/types/tenantId"
  value    = "{your tenant id}" //highlight-line
}

Troubleshooting

IssueSolution
Discovery fails with authentication errorVerify your Subscription ID, Tenant ID, Client ID, and Client Secret are correct.
Controls in ERROR stateControls may enter error state if the required permissions are not granted. Learn more about control states.
Import fails due to insufficient permissionsThe App Registration may not have adequate Azure IAM permissions. Check required Azure IAM permissions.
Further assistanceOpen a Support Ticket