Terraform Provider

Manage governed Microsoft Entra application registrations as code through the dedicated AZExecute Terraform API. The provider supports tenant approval, metadata policy, API-permission requests, selected registration settings, import, drift reads, and controlled deletion without bypassing AZExecute governance.

Open the official Terraform provider reference
This page explains what Terraform can do in AZExecute and how tenant governance affects it. The Terraform Registry documentation is the authoritative reference for every provider argument, resource field, output, example, migration, and troubleshooting step.

What You Can Manage

Application requests and lifecycle

Submit idempotent application requests, track PendingApproval, Provisioning, NeedsAttention, Ready, and Rejected, read Entra identifiers after provisioning, import existing Terraform-managed requests, and delete resources when tenant policy allows it.

Tenant-controlled metadata

Manage business justification, project and department ownership, environment, criticality, intended audience, go-live date, technical and data requirements, compliance notes, elevated-permission context, and contact details.

Registration configuration

Manage sign-in audience, identifier URIs, web, SPA and public-client redirect URIs, home and logout URLs, implicit token issuance, fallback public-client behavior, and requested access-token version.

API-permission requests

Submit external API or internal AZExecute application requests for app roles, delegated scopes, or authorized-client access. Permission handling follows the tenant's separate Terraform permission approval setting.

Policy and application reads

Read the live Terraform capabilities, included and required metadata fields, approval settings, and an application's current request status and identifiers through provider data sources.

State-safe operations

Use stable provider-generated UUIDs for retry safety, import by that UUID, and migrate from the synchronous resource to the approval-aware resource without recreating the remote application.

Before You Begin

1. Assign the calling user or service principal User, Operator, or TenantAdmin on the customer tenant's AZExecute enterprise application.

2. In Tenant administration → Application Configuration → Terraform, enable the Terraform API. Enable application creation when managing applications; group creation uses the tenant's existing group settings.

3. Decide whether application creation and permission requests require their normal approval flows.

4. Configure the metadata fields that Terraform callers may use and which of those fields are required.

5. Enable registration configuration, API-permission requests, and application deletion only for workflows that need them.

Terraform permissions are deny-by-default and evaluated on every request. A saved plan does not override a tenant policy changed before apply.

For applications, a User identity can manage only Terraform resources it created. Operator and TenantAdmin identities can manage application resources across the tenant. Groups require an active group owner or TenantAdmin; the Operator role alone does not grant group ownership.

AZExecute Groups

Use azexecute_azgroup to create and manage groups. Its default source = "auto" follows the tenant's group-creation policy at creation time. Choose local or entra explicitly when needed. Entra creation must be enabled in group settings and requires a writable Entra integration; only a tenant administrator can override an Entra default with a local group.

The existing Entra naming policy applies automatically. Terraform exposes both the requested name and the resulting display name. Use azexecute_group_capabilities to read the current policy and azexecute_azgroup as a data source to look up an existing group by its AZExecute group ID.

Add individual users, applications, integrations, and machines with azexecute_azgroup_membership. Each resource owns one assignment. Local users support Owner, Member, and Viewer roles; Entra user membership remains controlled by directory sync. Application assignments require application ownership. Group owners can assign AWS, Vercel, and GitHub integrations they created; other integration types and machine assignments require a tenant administrator.

Entra groups are retained by default when Terraform destroys the resource. To delete an Entra group created by Terraform, first apply delete_entra_on_destroy = true, then destroy as a tenant administrator. Imported Entra groups remain protected from directory deletion. Local groups are deleted on destroy.
Group resource reference

AWS, Vercel, and GitHub Integrations

Provider 0.13.5 adds azexecute_aws_integration, azexecute_vercel_integration, and azexecute_github_integration resources with friendly names, import, updates, and credential rotation. Matching data sources reuse existing connections. Integration creators or TenantAdmin can manage them; the Terraform API and Integrations license feature must be enabled.

Use azexecute_aws_federation to read the tenant's OIDC issuer and audience for AWS IAM setup. AWS supports Secrets Manager, Parameter Store, and Route 53 connections. Vercel requires an existing team and access token. GitHub requires an installed GitHub App and its private key; public GitHub is supported.

Link a new application request and integration to the same group with separate azexecute_azgroup_membership resources. Use the application's application_entity_id and the integration's numeric integration_id. Set wait_for_completion = true on the request when the apply must wait for application approval and provisioning. Existing group and integration data sources work with the same membership resources.

Reads never return stored credentials. Configured tokens and keys are sensitive but remain in Terraform state, so protect your state backend. Import can preserve stored credentials without re-entering them. Remove group memberships before destroying an integration; references let Terraform order this automatically. Deleting a connection does not delete its external account, IAM role, team, or GitHub App.

Integration setup and group linkage

Choose the Correct Application Resource

Use azexecute_application_request for new configurations. It supports both approval-based and automatic tenants. Both resources use the same AZExecute request and provisioning flow and manage the application after it becomes ready.

Behaviorazexecute_applicationazexecute_application_request (recommended)
Automatic provisioningSupportedSupported
Tenant requires human approvalRefuses creationSupported
Waits for provisioningAlwaysOptional; returns immediately by default
Wait controlspoll_interval_seconds and create_timeout_minutesSame controls, enabled by wait_for_completion = true
Manages the application after provisioningYesYes
Waits for downstream API approval or consentNoNo

Optional request waiting requires provider 0.12.0 or later; it is not available in 0.11.7 or earlier. With wait_for_completion = true, create/update waits for approval and provisioning to reach Ready, polling every 5 seconds for up to 60 minutes by default. Terraform holds its state lock during that wait. Leave waiting disabled when approval happens outside the pipeline.

Neither resource approves requests or bypasses tenant policy. NeedsAttention and Rejected stop waiting and report the reason; failures and timeouts retain the request identity. Use azexecute_application only for automatic tenants that require its existing always-waiting behavior.

Application request resource reference

Approval and Repeated Pipeline Runs

1. Terraform plan reads the live tenant capabilities and validates the requested operations and metadata.

2. Apply submits one idempotent application request.

3. With the request resource's default asynchronous behavior, apply succeeds with PendingApproval, Provisioning, or Ready. Optional waiting keeps apply running until the request reaches a final outcome or the timeout expires.

4. A tenant administrator approves or rejects a pending request in AZExecute. Terraform cannot approve itself.

5. AZExecute provisions approved applications through its durable background workflow.

6. If apply returned before completion, refresh Terraform to read the final status and identifiers. AZExecute applies creation-time registration settings before reporting Ready; no second apply is required to provision those settings.

With waiting disabled, PendingApproval and Provisioning are successful Terraform results. The Entra client ID, object ID, and AZExecute application entity UUID remain null until provisioning completes.

Dynamic Metadata Requirements

Only display_name is always required by the Terraform resource. All tenant-controlled metadata fields are optional in the provider schema. During planning, the provider reads the tenant's live required_metadata_fields and reports a clear error when a currently required value is missing. The API validates the same policy again before creating anything, so invalid input does not leave an approval request behind.

Use the azexecute_capabilities data source to inspect whether creation, deletion, permission requests, registration configuration and approval flows are enabled, and which metadata fields are included or required.

Authentication and CI/CD

The provider requests a token for https://api.azexecute.com/.default in the customer tenant. It supports a pre-acquired token, OIDC workload identity federation, certificates, client secrets, managed identity, Azure workload identity, Azure CLI, Azure Developer CLI, Azure PowerShell, and supported developer credentials.

For GitHub Actions and Azure DevOps, use workload identity federation. In Azure DevOps, an Azure Resource Manager service connection can expose a short-lived OIDC assertion to both the Azure Blob Terraform backend and the AZExecute provider. Each exchanges it for its own access token; no stored client secret or long-lived AZExecute token is needed.

Blob access on the state storage account and an AZExecute application role are separate requirements. One does not grant the other.

Azure DevOps provider guide AZExecute API authentication

Permissions, Registration, and Boundaries

Permission requests

Terraform can request permissions for an external Microsoft Entra API by application/client ID or an internal AZExecute application by application entity UUID. Supported grant types are app role, delegated scope, and authorized client. The tenant decides whether those permission requests wait for normal approval or are applied automatically with configured tenant-admin authority.

Registration settings

Set configure_registration = true only when the tenant enables Terraform registration configuration. Registration updates occur after the application is ready and use concurrency protection to avoid overwriting unrelated changes.

Owners and drift

Set owner_object_ids to the complete desired set of customer-managed Entra owner object UUIDs. Terraform adds missing owners and removes AZExecute-managed owners that are no longer configured. Manual owner changes made in AZExecute appear in the next plan. Graph-only operational owners required by AZExecute are preserved. Registered automation identities for the original requester and current caller are maintained automatically and repaired during authorized updates. You may include them explicitly, but they are not required in this set and do not count toward the human-owner minimum. Use the matching updated API and provider to exclude implicit automation ownership from drift.

For modular ownership, omit owner_object_ids and use one azexecute_application_owner resource per owner. Choose inline, individual, or unmanaged ownership for each application; do not combine inline and individual modes. Terraform's standard lifecycle.ignore_changes can leave selected inline metadata, registration, owner, or permission-request fields under manual control.

Intentionally outside the provider

The provider does not manage app-role definitions, exposed OAuth scopes, pre-authorized client definitions, secrets, certificates, integrations, or tenant settings. Continue to manage those through the dedicated AZExecute experiences and workflows.

State, Import, Migration, and Destroy

• The provider generates a stable UUID and the API enforces it per tenant, making retries safe after timeouts or lost responses.

• Import uses the stable Terraform resource UUID, not an Entra client ID, object ID, numeric request ID, or AZExecute application entity UUID.

• A Terraform moved block can move from azexecute_application to azexecute_application_request without recreating the application.

• Destroying a pending or rejected request cancels it without application-deletion permission.

• Destroying a provisioned application requires Allow Application Deletion in the tenant Terraform settings.

Always review a destroy plan. Removing a resource block has the same remote deletion consequences as an explicit Terraform destroy.
An unhandled error has occurred. Reload 🗙
An unhandled error has occurred. Reload 🗙