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
- Access to the Turbot Guardrails console with
Turbot/AdminorTurbot/Ownerpermissions. - An Azure App Registration with Client Secret and IAM Permissions configured. API Permissions (Microsoft Graph) are not required for subscription-only imports.
- Your Azure Subscription ID, Tenant ID (Directory ID), Client ID (Application ID), and Client Secret.
Step 1: Open the Create Connection Wizard
From the Accounts page, click Create Connection.

Step 2: Select Azure and Choose Subscription
Select Azure from the provider grid.

Then choose Azure Subscription as the connection type.

Step 3: Enter Azure Credentials
The wizard collects your App Registration credentials and the target subscription.

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

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

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

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.

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

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
| Issue | Solution |
|---|---|
| Discovery fails with authentication error | Verify your Subscription ID, Tenant ID, Client ID, and Client Secret are correct. |
| Controls in ERROR state | Controls may enter error state if the required permissions are not granted. Learn more about control states. |
| Import fails due to insufficient permissions | The App Registration may not have adequate Azure IAM permissions. Check required Azure IAM permissions. |
| Further assistance | Open a Support Ticket |