Skip to content

[Feature] Support azd deploy to a named App Service deployment slot (host: appservice) #9246

Description

@qiaozha

Summary

azd only models the production slot of an App Service. There is no way to bind an azd service to a named deployment slot, so azd deploy <service> cannot target a slot.

What happens

We run a Python FastAPI "agent server" (server.py) in the agent deployment slot of our backend App Service. Running:

azd deploy agent-server

fails at the core deploy step with:

unable to find a resource tagged with azd-service-name: agent-server

because the only resource carrying that tag is the production site, not the slot.

Current workaround

A per-service predeploy hook (agent-server-predeploy.ts) does the deploy itself:

  • az acr build -> immutable tag dev-N.0.0
  • az webapp config container set --slot agent
  • writes the immutable tag back to .env so the next azd provision re-pins the slot (the Bicep default :dev tag drifts)

The azd deploy agent-server core step then becomes a tolerated no-op — all the real work is in the hook.

Ask

First-class named-slot support for the appservice host, e.g. a way in azure.yaml to declare that a service deploys to a specific slot, so azd deploy targets the slot natively. This would let us delete agent-server-predeploy.ts.


Context: encountered while deploying a multi-component AI/chat service (App Service + Function App + Logic App + Foundry hosted agent) end-to-end with azd provision/deploy in Azure/azure-sdk-tools tools/sdk-ai-bots/deployment. We currently work around this with a TypeScript hook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions