Replies: 1 comment
-
|
Hey, Facing the same issue but with Terraform ( makes sense because it's using AzAPI so underneath, same exact APIs than Bicep), it got me crazy but I agree, when you create from the portal, something is different than from IaC tools. Raised a ticket to Ms but no luck so far. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When creating a Microsoft Foundry resource
(
Microsoft.CognitiveServices/accountswithkind: AIServices) using AzureCLI, the resource and its project appear correctly in the new Microsoft
Foundry experience at ai.azure.com.
However, when creating the exact same resource using Bicep, the portal
still shows the old "Azure AI Foundry" classic experience and prompts to
"Try the new Microsoft Foundry experience" — but the project never appears in
the dropdown.
Environment
2025-09-01(GA)swedencentralAIServicesS0What works ✅ — Azure CLI
Result: Resource + project appear in the new Foundry portal immediately. ✅
Inspecting the CLI-created resource via REST API shows:
{ "allowProjectManagement": true, "customSubDomainName": "my-foundry-resource", "disableLocalAuth": null, "publicNetworkAccess": "Enabled", "restrictOutboundNetworkAccess": null, "networkInjections": null, "networkAcls": null }What doesn't work ❌ — Bicep
Result: Resource deploys successfully (
provisioningState: Succeeded), butthe new Foundry portal does NOT show the project. It still shows the classic
"Azure AI Foundry" experience with an "upgrade" prompt. ❌
Inspecting the Bicep-created resource via REST API shows:
{ "allowProjectManagement": true, "customSubDomainName": "my-foundry-resource", "disableLocalAuth": false, "publicNetworkAccess": "Enabled", "restrictOutboundNetworkAccess": false, "networkAcls": { "bypass": "AzureServices", "defaultAction": "Allow", "ipRules": [], "virtualNetworkRules": [] } }Root cause analysis
We did a side-by-side comparison of the ARM properties between the CLI-created
and Bicep-created resources. The key difference:
disableLocalAuthnullfalserestrictOutboundNetworkAccessnullfalsenetworkAclsnull{ bypass: "AzureServices", defaultAction: "Allow" }Even though
falseandnullare semantically equivalent for these properties,it appears the Foundry portal filters on
nullvs explicit values.Bicep uses ARM
PUT(full resource replacement), which writes explicitvalues for all specified properties. The CLI uses a different creation path
that leaves unset properties as
null. Once these properties are set toexplicit values via Bicep's PUT, there is no way to reset them back to
null— Azure's ARM layer persists the explicit values permanently.What we tried
networkAclsandrestrictOutboundNetworkAccessfrom Bicep —ARM PUT still sets
restrictOutboundNetworkAccess: false(explicit) insteadof leaving it
null.restrictOutboundNetworkAccess: falseexplicitly — same result,portal doesn't recognize it.
az cognitiveservices account updateto try resetting values tonull — properties persist as explicit values.
az rest --method PATCHto try clearingnetworkAcls— InternalServer Error or values persist.
2025-09-01(latest GA that supports all resourcetypes including
capabilityHosts).microsoft-foundry/foundry-samples
— our Bicep structure matches exactly.
networkInjectionsto the CLI-created resource via PATCH — itstill appears in the new portal, confirming
networkInjectionsalone is NOTthe issue.
Workaround
We worked around this by creating the Foundry account and project via CLI in
our deployment script (before Bicep runs), then referencing them as
existingin Bicep for model deployments, connections, capability hosts, etc.:
Questions
falsevsnull?new portal recognizes?
CLI/portal-created ones?
nullonce they've been setto explicit values?
Any tips or insights from anyone who has successfully deployed a new Foundry
experience resource purely via Bicep/ARM templates would be greatly
appreciated.
Tags:
azure,azure-ai-foundry,azure-bicep,microsoft-foundry,azure-resource-managerBeta Was this translation helpful? Give feedback.
All reactions