What you need
Create the connection in Settings → Integrations → Azure AI Foundry. Have these customer-visible values ready:
The Access scope field is an OAuth token scope, not an Azure RBAC resource
scope. Do not enter
/subscriptions/..., /resourceGroups/..., or a management
group resource ID in that field. Assign Azure RBAC separately.
Forge does not ask for a Foundry project ID, project endpoint, Azure OpenAI
endpoint, deployment name, or redirect URI. It discovers supported resources
inside the subscription IDs you enter. A management-group role assignment does
not replace the subscription list; enter every subscription Forge should poll.
Create the Entra application
You can use Guided setup in Forge, which creates an app registration, its service principal, and a client secret. The generated comprehensive setup assigns these roles at the selected Azure RBAC scopes:
The generator requires explicit subscription IDs; it does not grant every
subscription visible to the signed-in Azure CLI account. Review the generated
RBAC scopes before running it. The Terraform alternative also creates the
application password, so protect the Terraform state and retrieve the secret
through its sensitive output. The Bicep alternative only assigns Reader to an
existing service-principal object ID; it does not create the Entra application
or its client secret.
To create it in the Azure portal instead:
- Open Microsoft Entra ID → App registrations → New registration.
- Name the app, for example
forge-cloud-ai-security. - Select Accounts in this organizational directory only.
- Leave Redirect URI unset and register the application. Forge uses the non-interactive OAuth 2.0 client-credentials flow, not browser consent or a callback.
- On Overview, copy the Application (client) ID and Directory (tenant) ID.
- Open Certificates & secrets → Client secrets → New client secret. Choose an expiry that matches your credential-rotation policy, create it, and copy the secret Value immediately.
- For each subscription or narrower resource group Forge should read, open Access control (IAM) → Add role assignment and assign Reader and Foundry User to the new service principal. Add Monitoring Reader and Log Analytics Reader only when you also use the optional Azure Monitor and Log Analytics validation artifacts.
Choose the Azure scope
- Add one or more subscription IDs. Forge polls each subscription separately.
- The optional Resource group value narrows Azure AI and Azure OpenAI account and deployment enumeration.
- The resource-group value also limits which discovered Foundry projects Forge reads through the data plane.
- Projects are discovered from Azure Resource Manager as
Microsoft.CognitiveServices/accounts/projects; there is no project picker or project-endpoint credential in this connection.
Save, test, and sync
- Paste the subscription IDs, tenant ID, client ID, and client-secret value.
- Optionally add one resource group. Leave Access scope blank.
- Select Save. The secret is stored encrypted and is write-only; Forge does not return it to the browser.
- Select Test. Test obtains a service-principal token and runs the Azure management-plane validation without importing inventory.
- Select Sync to run and import the provider reads plus the separate workload and rich Foundry data-plane reads. Active integrations are also polled automatically on the deployment’s configured sync schedule.
Current inventory
Sync imports Azure AI/OpenAI accounts and deployments, Foundry projects, related Azure resources, and supported customer-hosted workloads. For each discovered Foundry project, Forge also attempts rich reads for agents and versions, hosted sessions, routines, workflows, tools, skills, files, vector stores, connections, capability hosts, applications, and deployments. Preview and region-specific Foundry surfaces can fail independently. Forge retains inventory from the surfaces that succeed and reports the failed surface as a bounded blocker instead of discarding the whole sync. This connection does not enumerate general Foundry threads or reconstruct Azure diagnostic logs as Forge sessions. It also does not currently inventory Azure Monitor diagnostic settings, Log Analytics, or Application Insights as session content. Workload inventory can discover ACR images, managed identities, and relevant role assignments when their generated permissions and collectors are enabled.Operator access and artifact scanning
Native NHI containment, identity rightsizing, and Agent access use a dedicated federated application and bounded custom role. Guided setup keeps this operator separate from the inventory service principal and reads back its federation, role definition, assignments, and approved scopes before enabling actions. ACR image scanning requires registry list and pull access from the current generated setup. Filesystem snapshot scanning is opt-in and requires an exact source subscription and resource group plus a dedicatedforge-cloud-artifact-scanners resource group. See
Cloud artifact scanning.
Expected states
Test and Sync record the latest attempt time and show sanitized blockers
in the connection details. A degraded sync can still contain inventory from
subscriptions and resource families that succeeded.
Recovery
- For
invalid_client, an expired secret, or an AADSTS credential error, create a new client secret, paste its Value into Client secret, save, and run Test again. - For tenant or application errors, verify the Directory (tenant) ID and Application (client) ID. If either changes, save it together with its matching secret.
- For
403orAuthorizationFailed, verify Reader is assigned to the service principal at every entered subscription or an inherited parent scope. If Test succeeds but Sync reports a Foundry data-plane 403, also verify Foundry User on the affected Foundry account or project scope. Allow time for a new role assignment to propagate, then retest. - If an expected project or deployment is missing, confirm its subscription is listed, the optional resource-group name is exact, and the service principal can read the resource’s ARM scope.
- If Test is healthy but inventory is stale, run Sync and check the latest blockers and sync timestamp.