> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formae.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure configuration

> Configure an Azure target for formae: credentials and target settings.

The Azure plugin enables formae to manage Azure resources using the Azure Resource Manager APIs.

## Configuration

### Target

Configure an Azure target in your Forma file:

```kotlin theme={"languages":{"custom":["/languages/pkl.json"]}}
import "@formae/formae.pkl"
import "@azure/azure.pkl"

target: formae.Target = new formae.Target {
    label = "my-azure-target"
    config = new azure.Config {
        subscriptionId = "your-subscription-id"
    }
}
```

The subscription ID can also be read from an environment variable:

```kotlin theme={"languages":{"custom":["/languages/pkl.json"]}}
config = new azure.Config {
    subscriptionId = read?("env:AZURE_SUBSCRIPTION_ID") ?? "default-subscription-id"
}
```

### Credentials

The plugin uses `DefaultAzureCredential` which tries the following methods in order:

1. **Environment Variables:**

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
export AZURE_CLIENT_ID="your-client-id"
export AZURE_CLIENT_SECRET="your-client-secret"
export AZURE_TENANT_ID="your-tenant-id"
```

2. **Managed Identity:**
   When running on Azure (VMs, App Service, Functions, etc.), credentials are automatically retrieved from the managed identity.

3. **Azure CLI:**

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
az login
```

**OIDC (for CI/CD):**
For GitHub Actions, use `azure/login` action with OIDC federation.
