Support container deployment for Function Apps#9284
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 21 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Adds container deployment support for Function Apps while preserving zip deployment for code-based functions.
Changes:
- Routes container-configured Function Apps through shared App Service container lifecycle.
- Expands schemas and documentation for container Function configuration.
- Adds unit, sanitizer, and recorded functional coverage with a containerized Node.js fixture.
Show a summary per file
| File | Description |
|---|---|
schemas/v1.0/azure.yaml.json |
Allows Function container configuration. |
schemas/alpha/azure.yaml.json |
Mirrors stable schema support. |
docs/reference/azure-yaml-schema.md |
Documents Function deployment modes. |
cli/azd/test/recording/sanitize.go |
Corrects Container App PATCH filtering. |
cli/azd/test/recording/sanitize_test.go |
Tests sanitizer scope and secrets. |
cli/azd/test/functional/up_test.go |
Adds container Function lifecycle test. |
.../src/functions/hello.js |
Implements fixture HTTP function. |
.../src/function/package.json |
Defines fixture dependencies. |
.../src/function/host.json |
Configures the Function host. |
.../src/function/Dockerfile |
Builds the fixture image. |
.../src/function/.dockerignore |
Excludes local Node artifacts. |
.../infra/resources.bicep |
Provisions Function, ACR, and dependencies. |
.../infra/main.parameters.json |
Supplies fixture deployment parameters. |
.../infra/main.bicep |
Creates the fixture resource group. |
.../containerfuncapp/azure.yaml |
Configures Dockerfile-based Function deployment. |
...ContainerFuncApp.docker.yaml |
Records Docker login and push. |
...ContainerFuncApp.yaml |
Records Azure HTTP interactions. |
cli/azd/pkg/project/service_target_functionapp.go |
Adds container lifecycle routing and mismatch detection. |
.../service_target_functionapp_test.go |
Covers container and zip routing. |
.../service_target_appservice.go |
Centralizes container classification. |
cli/azd/pkg/azapi/webapp.go |
Adds shared site container classification. |
cli/azd/pkg/azapi/webapp_test.go |
Tests site classification cases. |
cli/azd/pkg/azapi/function_app.go |
Exposes Function container configuration. |
.../recording-functional-tests-guide.md |
Documents deterministic recording setup. |
cli/azd/AGENTS.md |
Adds Docker and recording test guidance. |
Review details
- Files reviewed: 24/25 changed files
- Comments generated: 3
- Review effort level: Medium
Copilot-Session: 9fd3eef8-cc72-4e6c-9e21-18d85eefac55
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9fd3eef8-cc72-4e6c-9e21-18d85eefac55
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9fd3eef8-cc72-4e6c-9e21-18d85eefac55
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9fd3eef8-cc72-4e6c-9e21-18d85eefac55
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9fd3eef8-cc72-4e6c-9e21-18d85eefac55
e320cc7 to
3dcc197
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9fd3eef8-cc72-4e6c-9e21-18d85eefac55
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Fixes #9250
Summary
This PR adds container image deployment support for services configured with
host: function. It reuses the App Service container lifecycle introduced in #8847 while preserving existing zip deployment behavior for code-based Function Apps.Issue
The Function App target previously treated every service as a code package. When the provisioned Function App used
linuxFxVersion=DOCKER|...,azd deploysent an incompatible zip deployment to Kudu and could wait until timeout.host: functionby the Azure YAML schema.Container deployment
Container intent is explicit through
language: docker,docker.path, a prebuiltimage, or a container artifact. azd then uses the existing container helper to build or resolve the image, publish it to ACR, and update only the site'slinuxFxVersion.docker.remoteBuildbecause the Function target delegates to the shared container publishing path.Behaviour at a glance
linuxFxVersionConfiguration and diagnostics
The stable and alpha schemas now allow Dockerfile and prebuilt-image configuration for Function services. The Azure YAML reference documents both deployment modes and the infrastructure responsibilities for container hosting.
The implementation also centralizes App Service container classification and fixes a recording sanitizer predicate uncovered by the new Function App image PATCH. Follow-up #9283 tracks making functional test prompt handling deterministic across recording principals and playback.
Testing