Add infrastructure modules for Foundry project and Azure Container Re… - #30
Conversation
…gistry - Introduced main.parameters.json for parameter management in HostedAgents/Researcher. - Created acr-pull-role-assignment.bicep to assign AcrPull role to service principals. - Developed acr.bicep for provisioning Azure Container Registry with managed identity. - Implemented connections.bicep to manage project connections for Foundry. - Added network.bicep for configuring virtual network and subnets for network isolation. - Created private-endpoint-dns.bicep to manage private endpoints and DNS zones. - Developed resources.bicep for managing Foundry account, project, and model deployments. - Added subnet.bicep for creating subnets within existing virtual networks. - Introduced main.bicep and main.parameters.json for HostedAgents/Reviewer to manage existing Foundry projects. - Created foundry-project.bicep to manage deployments and connections for Foundry projects.
There was a problem hiding this comment.
🟡 Changes recommended
The updated azure.yaml files hard-code a specific Foundry endpoint and introduce duplicate agent service definitions, and the network-isolation path includes infra gaps that can break private endpoint and ACR pull scenarios.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR introduces Azure Dev “microsoft.foundry” infrastructure-as-code (Bicep) for the HostedAgents projects, covering provisioning for new Foundry projects (Author/Researcher) and “editable infra” templates for existing projects (Blogger/Reviewer), plus wiring updates in each agent’s azure.yaml.
Changes:
- Added subscription-scoped entrypoint Bicep templates + RG-scoped modules to provision Foundry accounts/projects, model deployments, project connections, optional ACR, and optional network isolation (Author/Researcher).
- Added “existing project” (reference-only) infra templates for Blogger/Reviewer, including a
foundry-project.bicepmodule for deployments + connections. - Updated HostedAgents
azure.yamlfiles to useinfra: provider: microsoft.foundry(and adjusted docs to mentionazd ai agent init --infra=bicep).
File summaries
| File | Description |
|---|---|
| HostedAgents/Reviewer/infra/modules/foundry-project.bicep | Module to manage deployments and project connections for an existing Foundry project (Reviewer). |
| HostedAgents/Reviewer/infra/main.parameters.json | Parameter file for Reviewer “existing project” infra entrypoint. |
| HostedAgents/Reviewer/infra/main.bicep | Subscription-scoped entrypoint referencing an existing Foundry project for Reviewer. |
| HostedAgents/Reviewer/azure.yaml | Switches Reviewer to microsoft.foundry infra provider and updates service definitions. |
| HostedAgents/Researcher/infra/modules/subnet.bicep | Subnet creation module for BYO VNet scenarios (Researcher). |
| HostedAgents/Researcher/infra/modules/resources.bicep | Core RG-scoped Foundry resources module (account/project/deployments/connections/ACR/network). |
| HostedAgents/Researcher/infra/modules/private-endpoint-dns.bicep | Private endpoint + private DNS zones for network-secured Foundry account (Researcher). |
| HostedAgents/Researcher/infra/modules/network.bicep | BYO VNet wiring and subnet orchestration for network isolation (Researcher). |
| HostedAgents/Researcher/infra/modules/connections.bicep | Creates Foundry project connections from azure.yaml service definitions (Researcher). |
| HostedAgents/Researcher/infra/modules/acr.bicep | Provisions ACR + role assignment + Foundry project ACR connection (Researcher). |
| HostedAgents/Researcher/infra/modules/acr-pull-role-assignment.bicep | Helper module to grant AcrPull to a principal on a registry (Researcher). |
| HostedAgents/Researcher/infra/main.parameters.json | Parameter file for Researcher provisioning entrypoint. |
| HostedAgents/Researcher/infra/main.bicep | Subscription-scoped provisioning entrypoint that creates RG and deploys Foundry resources (Researcher). |
| HostedAgents/Researcher/infra/abbreviations.json | Abbreviations used for deterministic resource naming (Researcher). |
| HostedAgents/Researcher/azure.yaml | Switches Researcher to microsoft.foundry infra provider and updates service definitions. |
| HostedAgents/README.md | Updates HostedAgents setup instructions to include --infra=bicep. |
| HostedAgents/Blogger/infra/modules/foundry-project.bicep | Module to manage deployments and project connections for an existing Foundry project (Blogger). |
| HostedAgents/Blogger/infra/main.parameters.json | Parameter file for Blogger “existing project” infra entrypoint. |
| HostedAgents/Blogger/infra/main.bicep | Subscription-scoped entrypoint referencing an existing Foundry project for Blogger. |
| HostedAgents/Blogger/azure.yaml | Switches Blogger to microsoft.foundry infra provider and updates service definitions. |
| HostedAgents/Author/infra/modules/subnet.bicep | Subnet creation module for BYO VNet scenarios (Author). |
| HostedAgents/Author/infra/modules/resources.bicep | Core RG-scoped Foundry resources module (account/project/deployments/connections/ACR/network). |
| HostedAgents/Author/infra/modules/private-endpoint-dns.bicep | Private endpoint + private DNS zones for network-secured Foundry account (Author). |
| HostedAgents/Author/infra/modules/network.bicep | BYO VNet wiring and subnet orchestration for network isolation (Author). |
| HostedAgents/Author/infra/modules/connections.bicep | Creates Foundry project connections from azure.yaml service definitions (Author). |
| HostedAgents/Author/infra/modules/acr.bicep | Provisions ACR + role assignment + Foundry project ACR connection (Author). |
| HostedAgents/Author/infra/modules/acr-pull-role-assignment.bicep | Helper module to grant AcrPull to a principal on a registry (Author). |
| HostedAgents/Author/infra/main.parameters.json | Parameter file for Author provisioning entrypoint. |
| HostedAgents/Author/infra/main.bicep | Subscription-scoped provisioning entrypoint that creates RG and deploys Foundry resources (Author). |
| HostedAgents/Author/infra/abbreviations.json | Abbreviations used for deterministic resource naming (Author). |
| HostedAgents/Author/azure.yaml | Switches Author to microsoft.foundry infra provider and updates service definitions. |
| docs/deployment.md | Updates deployment docs to include --infra=bicep. |
Review details
- Files reviewed: 32/32 changed files
- Comments generated: 12
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| adminUserEnabled: false | ||
| // Disable public access when network isolation is enabled so the registry | ||
| // stays inside the VNet boundary. Docker-backed agents in isolated projects | ||
| // must pull via the private endpoint; public access would leave a dependency | ||
| // outside the isolation perimeter and can break pulls in locked-down egress. | ||
| publicNetworkAccess: enableNetworkIsolation ? 'Disabled' : 'Enabled' | ||
| zoneRedundancy: 'Disabled' | ||
| } |
| resource subnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' = { | ||
| name: '${vnetName}/${subnetName}' | ||
| properties: { | ||
| addressPrefix: addressPrefix | ||
| delegations: delegations | ||
| } |
| adminUserEnabled: false | ||
| // Disable public access when network isolation is enabled so the registry | ||
| // stays inside the VNet boundary. Docker-backed agents in isolated projects | ||
| // must pull via the private endpoint; public access would leave a dependency | ||
| // outside the isolation perimeter and can break pulls in locked-down egress. | ||
| publicNetworkAccess: enableNetworkIsolation ? 'Disabled' : 'Enabled' | ||
| zoneRedundancy: 'Disabled' | ||
| } |
| resource subnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' = { | ||
| name: '${vnetName}/${subnetName}' | ||
| properties: { | ||
| addressPrefix: addressPrefix | ||
| delegations: delegations | ||
| } |
| ai-project: | ||
| host: azure.ai.project | ||
| endpoint: https://AgentFrameworkJesseLiberty.services.ai.azure.com/api/projects/AgentFramework |
| blogger: | ||
| project: . | ||
| host: azure.ai.agent | ||
| language: csharp | ||
| uses: | ||
| - ai-project | ||
| env: | ||
| AZURE_AI_MODEL_DEPLOYMENT_NAME: ${AZURE_AI_MODEL_DEPLOYMENT_NAME} |
| ai-project: | ||
| host: azure.ai.project | ||
| endpoint: https://AgentFrameworkJesseLiberty.services.ai.azure.com/api/projects/AgentFramework |
| researcher: | ||
| project: . | ||
| host: azure.ai.agent | ||
| language: csharp | ||
| uses: | ||
| - ai-project |
| ai-project: | ||
| host: azure.ai.project | ||
| endpoint: https://AgentFrameworkJesseLiberty.services.ai.azure.com/api/projects/AgentFramework |
| reviewer: | ||
| project: . | ||
| host: azure.ai.agent | ||
| language: csharp | ||
| uses: | ||
| - ai-project |
Add infrastructure modules for Foundry project and Azure Container Registry