{"id":3619,"date":"2026-03-03T13:10:01","date_gmt":"2026-03-03T21:10:01","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/azure-sdk\/?p=3619"},"modified":"2026-03-03T13:10:01","modified_gmt":"2026-03-03T21:10:01","slug":"azd-appservice-swap","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/azure-sdk\/azd-appservice-swap\/","title":{"rendered":"Azure Developer CLI (azd): One command to swap Azure App Service slots"},"content":{"rendered":"<p><em>Swap deployment slots from your terminal\u2014azd already knows your app.<\/em><\/p>\n<hr \/>\n<p>Azure App Service <a href=\"https:\/\/learn.microsoft.com\/azure\/app-service\/deploy-staging-slots\">deployment slots<\/a> let you stage changes and swap them into production with zero downtime. With <code>azd<\/code>, you can <a href=\"https:\/\/devblogs.microsoft.com\/azure-sdk\/azd-app-service-slot\/\">deploy to slots<\/a> and now swap them\u2014all in a single command.<\/p>\n<h2>What&#8217;s new?<\/h2>\n<p>The <code>azure.appservice<\/code> extension adds a <code>swap<\/code> command that detects your App Service, lists slots, and prompts you to pick source and destination. The extension installs automatically the first time you run it.<\/p>\n<h2>Why it matters<\/h2>\n<p>Slot swaps are key to zero-downtime deployments. This command keeps you in your terminal instead of context-switching to the portal. It integrates with your <code>azd<\/code> project\u2014no extra configuration needed.<\/p>\n<h2>How to use it<\/h2>\n<p>Run <code>azd appservice swap<\/code> to start an interactive swap. With only one slot, it skips prompts and swaps directly with production.<\/p>\n<p>For automation, specify everything upfront. Use <code>@main<\/code> to reference production:<\/p>\n<pre><code class=\"language-bash\">azd appservice swap                             # Interactive\r\nazd appservice swap --src staging --dst @main   # Promote staging\r\nazd appservice swap --src @main --dst staging   # Rollback\r\nazd appservice swap --service api --src staging --dst @main  # Target a specific service<\/code><\/pre>\n<h2>Feedback<\/h2>\n<p>Have ideas? File an issue on <a href=\"https:\/\/github.com\/Azure\/azure-dev\">GitHub<\/a> or <a href=\"https:\/\/aka.ms\/azd-user-research-signup\">sign up for user research<\/a>.<\/p>\n<hr \/>\n<p><em>This feature was introduced in <a href=\"https:\/\/github.com\/Azure\/azure-dev\/pull\/6687\">PR #6687<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The new azd appservice swap command makes deployment slot swaps fast and intuitive.<\/p>\n","protected":false},"author":111321,"featured_media":3625,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[908,864],"class_list":["post-3619","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-sdk","tag-azd","tag-azure-developer-cli"],"acf":[],"blog_post_summary":"<p>The new azd appservice swap command makes deployment slot swaps fast and intuitive.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/users\/111321"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/comments?post=3619"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/posts\/3619\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media\/3625"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/media?parent=3619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/categories?post=3619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/azure-sdk\/wp-json\/wp\/v2\/tags?post=3619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}