Why am I not able to create a foundry account resource with virtual network injection enabled?

Mahindra Manoj 5 Reputation points
2026-06-08T15:55:02.8833333+00:00

When I try to create a Foundry account with vnet injection enabled, the bicep deployment fails stating the below error. I was able to create the foundry accounts (with vnet injection enabled) earlier without any issue.

CapabilityHost with CustomerSubnet is not allowed, please reach out to support enable
Microsoft Foundry
Microsoft Foundry

A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance


2 answers

Sort by: Most helpful
  1. Thanmayi Godithi 10,820 Reputation points Microsoft External Staff Moderator
    2026-07-03T10:31:38.5433333+00:00

    Hi Mahindra Manoj ,

    That message isn't a Bicep validation failure — the CapabilityHost is the sub-resource that injects the agent runtime into your delegated subnet, and ...is not allowed, please reach out to support to enable is a service-side gating/allowlist response for VNet-injected Foundry Agent Service. Since the same template worked for you before, it's either that the subscription/region is no longer on the injection allowlist, or a prerequisite drifted since your last successful deploy.

    Before you file a ticket, please re-verify the current network-secured requirements — any one of these drifting will fail the CapabilityHost:

    1. Standard (BYO) setup with your own Storage + Azure AI Search + Cosmos DB — all three are required.
    2. Public network access disabled on the Foundry account.
    3. Subnet delegated to Microsoft.App/environments, ≥ /27, and not shared with another Foundry resource.
      • Verify: az network vnet subnet show … --query "delegations[].serviceName" → should return Microsoft.App/environments.
      1. RFC 1918 address space. Note 10.x is only supported in some regions — if you changed region recently, a 10.x subnet can now be rejected; try a 172.16/12 or 192.168/16 range.
    4. Resource providers Microsoft.App and Microsoft.ContainerService registered.
      • Verify: az provider show -n Microsoft.App --query registrationState -o tsv (repeat for Microsoft.ContainerService) → both Registered.
      1. Foundry account and VNet/subnet in the same, supported region.
      2. Template uses networkInjections with scenario: 'agent' and the correct subnetArmId.

    If all of that is already correct, please share the details requested over Private message.

    Was this answer helpful?

    0 comments No comments

  2. Amira Bedhiafi 43,036 Reputation points MVP Volunteer Moderator
    2026-06-08T19:16:06.5766667+00:00

    Hi Mahindra,

    Thank you for posting on MS Learn Q&A.

    I think this is an allowlist issue for Foundry Agent Service VNet injection rather than a normal Bicep validation error.

    Before reaching out to the support team, please check that the deployment still meets the current Foundry private networking requirements:

    • the Foundry account is using the Standard/BYO resource setup not managed/basic resources.
    • storage, Azure AI Search and Cosmos DB are provided as BYO resources.
    • public network access is disabled.
    • the subnet used for injection is delegated to Microsoft.App/environments.
    • the subnet is at least /27.
    • the Foundry resource, VNet/subnet, and dependent resources are in supported regions and compatible networking configuration.
    • the Bicep/ARM template uses networkInjections with scenario: 'agent' and the correct subnetArmId.

    If all of the above is already correct, then please open a support ticket.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.