Summary
Deploying a Foundry account with networkInjections (scenario: 'agent') fails on a subscription that has not registered Microsoft.App and Microsoft.ContainerService. Neither the network-injection setup docs nor the 15-private-network-standard-agent-setup sample mention this prerequisite.
The failure is unusually costly because it surfaces after the account resource is accepted, so the deployment leaves a Failed Foundry account behind that must be cleaned up before retrying.
Repro
Subscription with Microsoft.App and Microsoft.ContainerService in NotRegistered. Region eastus2.
Minimal template:
resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = {
name: accountName
location: location
kind: 'AIServices'
sku: { name: 'S0' }
identity: { type: 'SystemAssigned' }
properties: {
allowProjectManagement: true
customSubDomainName: accountName
publicNetworkAccess: 'Disabled'
disableLocalAuth: true
networkAcls: { defaultAction: 'Deny' }
networkInjections: [
{
scenario: 'agent'
subnetArmId: agentSubnetId // delegated to Microsoft.App/environments, /26
useMicrosoftManagedNetwork: false
}
]
}
}
az deployment group create ...
Actual
ResourceProviderExtensionError: ExtendedErrorInfo:: Kind: AmlRp, Code: BadRequest,
Message: Capability host creation failed with agent messages:
{"Status":5,"ErrorCode":"400","Messages":[
"Subscripton '<sub-id>' is not registered with the required resource providers,
please register with the resource providers Microsoft.App and Microsoft.ContainerService."
]}
The account reaches provisioningState: Failed.
Note the message also contains a typo: Subscripton.
Expected
Either:
- the prerequisite is documented alongside the other requirements (delegated subnet,
/27 minimum, RFC1918), and added to the sample's prerequisites; or
- ARM preflight rejects the deployment before the account resource is created, so no
Failed account is left behind.
Confirmation
After az provider register -n Microsoft.App and az provider register -n Microsoft.ContainerService, the identical deployment succeeded:
- account
provisioningState: Succeeded, publicNetworkAccess: Disabled
- capability host auto-created —
kind: Agents, Succeeded
networkInjections reads back correctly
Environment
- API version
2025-04-01-preview
- Region
eastus2
- Delegated subnet
/26, delegation Microsoft.App/environments
- Azure CLI 2.77.0, Bicep 0.40.2
Additional note
Capability-host creation on an injected account took roughly 35 minutes. That is worth stating in the docs so operators do not assume a hang and cancel mid-deploy.
Summary
Deploying a Foundry account with
networkInjections(scenario: 'agent') fails on a subscription that has not registeredMicrosoft.AppandMicrosoft.ContainerService. Neither the network-injection setup docs nor the15-private-network-standard-agent-setupsample mention this prerequisite.The failure is unusually costly because it surfaces after the account resource is accepted, so the deployment leaves a
FailedFoundry account behind that must be cleaned up before retrying.Repro
Subscription with
Microsoft.AppandMicrosoft.ContainerServiceinNotRegistered. Regioneastus2.Minimal template:
az deployment group create ...Actual
The account reaches
provisioningState: Failed.Note the message also contains a typo:
Subscripton.Expected
Either:
/27minimum, RFC1918), and added to the sample's prerequisites; orFailedaccount is left behind.Confirmation
After
az provider register -n Microsoft.Appandaz provider register -n Microsoft.ContainerService, the identical deployment succeeded:provisioningState: Succeeded,publicNetworkAccess: Disabledkind: Agents,SucceedednetworkInjectionsreads back correctlyEnvironment
2025-04-01-previeweastus2/26, delegationMicrosoft.App/environmentsAdditional note
Capability-host creation on an injected account took roughly 35 minutes. That is worth stating in the docs so operators do not assume a hang and cancel mid-deploy.