Skip to content

feat: Infra restructure#2272

Open
AjitPadhi1-Microsoft wants to merge 28 commits into
Azure-Samples:dev-v2from
AjitPadhi1-Microsoft:infra-restructure
Open

feat: Infra restructure#2272
AjitPadhi1-Microsoft wants to merge 28 commits into
Azure-Samples:dev-v2from
AjitPadhi1-Microsoft:infra-restructure

Conversation

@AjitPadhi1-Microsoft

@AjitPadhi1-Microsoft AjitPadhi1-Microsoft commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Purpose

  • This pull request introduces several infrastructure and documentation updates, focusing primarily on improving Azure AI Foundry support with new modular Bicep templates, streamlining deployment scripts, and clarifying project structure. The most significant changes are the addition of reusable Bicep modules for AI Foundry resources, updates to deployment scripts and hooks, and minor documentation and Dockerfile improvements.

Infrastructure: Azure AI Foundry Bicep Modules

  • Added three new reusable Bicep modules for Azure AI Foundry:
    • ai-foundry-project.bicep: Provisions an Azure AI Services account and Foundry project, with outputs for endpoints and identities.
    • ai-foundry-connection.bicep: Manages project connections for various resource types (e.g., CognitiveSearch, AzureBlob, AppInsights) with flexible authentication and metadata.
    • ai-foundry-model-deployment.bicep: Deploys a single AI model to an existing AI Services account, supporting configurable model, version, and SKU.

Deployment Scripts and Hooks

  • Refactored azure.yaml to:
    • Remove the parameters block and move service and hook definitions under services.
    • Replace the postprovision hook with a new postdeploy hook that provides clear post-deployment instructions for both Windows and POSIX environments, referencing scripts under infra/scripts/post-provision/.
  • Updated .dockerignore and documentation to reflect that helper scripts now live under infra/ instead of a separate scripts/ directory. [1] [2]

Dockerfile Updates

  • Improved the Functions Dockerfile to use a more reliable and reproducible dependency installation process (using uv and requirements.txt), and adjusted the code layout to better match import patterns.
  • Updated the Frontend Dockerfile to restrict fastapi version and add httpx for improved compatibility.

Other Minor Changes

  • Cleaned up comments and removed deprecated or redundant sections in azure.yaml for clarity.

These changes collectively improve the modularity and maintainability of our infrastructure-as-code, clarify deployment processes, and better align our documentation and file structure with current best practices.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

AjitPadhi1-Microsoft and others added 28 commits June 23, 2026 16:53
… Apps

Author v2/infra/bicep/main.bicep so the 'bicep' flavor is functionally equivalent to v2/infra/avm/main.bicep while using the granular native-resource modules under v2/infra/bicep/modules/*. Frontend and backend run on Azure Container Apps; the Functions host runs as a code/zip Linux Function App.

- Enable the bicepDeployment module in the v2/infra/main.bicep router and route via DEPLOYMENT_FLAVOR (now defaulted to bicep in main.parameters.json).
- Mirror the avm resource graph, env vars, model deployments and outputs (43 app outputs identical; VNet/Bastion outputs omitted as the Docker flavor has no private-networking layer).
- Author all RBAC natively in main.bicep (avm uses a role-assignment module) using deterministic existing-resource refs plus explicit dependsOn, since module files are frozen.
- Declare the 6 ingestion storage queues natively (doc-processing/blob-events/add-url + poison).
- Documented forced deviations from avm: Log Analytics always deployed and storage allowSharedKeyAccess=true (required by the unchanged container-app-environment and function-app modules); Event Grid uses first-party StorageQueue delivery.
- No module files changed. Both v2/infra/main.bicep and v2/infra/bicep/main.bicep build clean (az bicep build, exit 0, no warnings).
The conditional router outputs in v2/infra/main.bicep referenced avmDeployment in both the true and false ternary branches, so in 'bicep' flavor the outputs pointed at the undeployed avm module and ARM rejected the template (InvalidTemplate: output reference to module.avm requires an API version). Point the false (isBicep) branch at bicepDeployment so each flavor reads outputs from the module it actually deploys, mirroring the working avm path.
…p, and Event Grid identity delivery

- function-app: add docker/container kind + dockerFullImageName; switch
  AzureWebJobsStorage to identity-based (managed identity, no account keys);
  drop code/zip-only settings in container mode
- event-grid: add Storage Queue Data Message Sender role for system topic
  identity and order subscriptions after the role; support
  deliveryWithResourceIdentity
- storage-account: add queue service + queue creation support

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ntralize role assignments; fix non-ASCII file download header

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…on discovery

- Grant UAMI/deployer/search data-plane roles on the BYO Foundry account via the existing-project-setup module (scoped to the Foundry's subscription/RG so cross-subscription grants work). RBAC GUIDs owned by the module; main.bicep passes only principals + flags.

- post-provision (ps1/sh): fall back to the backend container app env for AZURE_OPENAI_ENDPOINT + GPT deployment when the Foundry lives outside the RG.

- Revert non-ASCII Content-Disposition filename handling in the files router.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AjitPadhi1-Microsoft AjitPadhi1-Microsoft marked this pull request as ready for review June 30, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants