February 11th, 2026
0 reactions

Deploy to Azure App Service deployment slots with azd

Deploy to Azure App Service slots with azd deploy

Missed deploying to an App Service slot? Now you can—without workarounds or manual scripts.


What’s new?

Before, azd deploy could only deploy to the default production slot. Now, azd understands the slots you define in Bicep and deploys to the slot you designate. On first deploy, azd deploys to both production and any defined slots. After that, if you have more than one slot, it prompts you to choose—or you can set the slot with an environment variable.

Why it matters

Slot deployment is essential for blue/green, staging, and testing flows, but it wasn’t possible from azd before. Now, you can go from Bicep definition to deploying code to a slot—no extra scripts, extensions, or guessing where your code lands. It’s a smoother, more predictable experience using just azd.

How to use it

  1. Define a slot in your Bicep:
    resource webApp 'Microsoft.Web/sites@2021-03-01' = {
      name: 'my-appservice'
      location: resourceGroup().location
      kind: 'app'
      properties: { serverFarmId: myPlan.id }
    }
    resource stagingSlot 'Microsoft.Web/sites/slots@2021-03-01' = {
      name: '${webApp.name}/staging'
      location: webApp.location
      properties: {}
    }

    Or with Azure Verified Modules (AVM):

    module appservice 'br/public:app-service:1.3.2' = {
      name: 'my-appservice'
      params: {
        // ...params
      }
    }
    module stagingSlot 'br/public:web-app-deployment-slot:1.0.2' = {
      name: 'staging'
      params: { appServiceName: appservice.outputs.name }
    }

    Note: Deployment slots require an App Service plan at Standard (S1) tier or higher. The Free, Shared, and Basic tiers do not support slots.

  2. Provision and deploy with azd:
    azd up
    • Get prompted if you have multiple slots
    • Or skip the prompt by setting: azd env set AZD_DEPLOY_MYAPI_SLOT_NAME staging
    • Works in CI/CD too—just set the env var in your pipeline.

Feedback

Questions or ideas? File an issue or chat on GitHub. Want to help shape azd‘s future? Sign up for user research.


Introduced in PR #6627.

0 comments