{"id":7335,"date":"2017-04-04T12:56:00","date_gmt":"2017-04-04T12:56:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/?p=7335"},"modified":"2019-03-07T09:23:10","modified_gmt":"2019-03-07T16:23:10","slug":"azure-app-service-swap-with-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/azure-app-service-swap-with-preview\/","title":{"rendered":"Azure App Service : Swap with Preview"},"content":{"rendered":"<p>In this post, Senior Application Development Manager, <a href=\"https:\/\/www.linkedin.com\/in\/patelnayan\/\"><strong>Nayan Patel<\/strong><\/a>, spotlights App Service deployment using <strong><em>Swap with Preview<\/em><\/strong><\/p>\n<hr \/>\n<p>I was recently assisting a customer with an App Service deployment problem in Azure and came across a fairly new feature (<strong>Swap with Preview<\/strong>) that addressed the customer need.\u00a0 App Services offer multiple d<em>eployment slots<\/em> which effectively provides a way to have multiple versions of code deployed and capability to quickly alternate (or swap) between them.\u00a0 This is very useful and generally used to test new code in a <em>Staging<\/em> slot before it is swapped to the <em>Production<\/em> slot and goes live.<\/p>\n<p>To do this, you can create an additional deployment slot (staging, for example) off the main production slot which sets up a completely separate app with its own AppSettings, ConnectionStrings and Git deployment URL.\u00a0 Typically, you deploy new code to the staging slot along with staged app settings and connection strings to test the app.\u00a0 Once you are ready to push this deployment to production you simply swap the staging slot to production slot.\u00a0 However, in many cases, applications encounter issues when production AppSettings and ConnectionStrings get applied after the swap and when the app goes live.<\/p>\n<p><strong>Swap with Preview<\/strong> allows you to validate the app with <em>production<\/em> configuration <b>before<\/b> the app is swapped into production. You can pick the option on the Azure portal as show below:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-35849\" src=\"http:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2017\/04\/swap1.gif\" alt=\"\" width=\"456\" height=\"484\" \/><\/p>\n<h2>Here are some benefits of using Swap with Preview<\/h2>\n<ul>\n<li>Ability use production configuration settings in staging slot and test the app exactly how it would behave in production before going live<\/li>\n<li>When configuration settings are applied in the staging slot, it restarts the worker process and you can execute warmup scripts or tests to ensure the app is healthy<\/li>\n<li>After verifying the app in staging, it uses the same warmed-up worker process when you swap to production, which reduces any startup downtime or performance overhead associated with the app spinning up<\/li>\n<li>If testing is not successful, you can cancel the swap and it will reapply all the configuration settings of the staging slot again<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>For more information, see <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/app-service-web\/web-sites-staged-publishing\">Setup staging environments in Azure App Services<\/a> and <a href=\"https:\/\/blogs.msdn.microsoft.com\/waws\/2016\/12\/12\/slot-swap-with-preview\/\">Slot Swap with Preview<\/a>.<\/p>\n<hr \/>\n<p><strong><a href=\"https:\/\/devblogs.microsoft.com\/premier-developer\/welcome-to-premier-developer\/\">Premier Support for Developers<\/a><\/strong> provides strategic technology guidance, critical support coverage, and a range of essential services to help teams optimize development lifecycles and improve software quality.\u00a0 Contact your Application Development Manager (ADM) or <a href=\"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/contact-us\/\">email us<\/a> to learn more about what we can do for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, Senior Application Development Manager, Nayan Patel, spotlights App Service deployment using Swap with Preview I was recently assisting a customer with an App Service deployment problem in Azure and came across a fairly new feature (Swap with Preview) that addressed the customer need.\u00a0 App Services offer multiple deployment slots which effectively provides [&hellip;]<\/p>\n","protected":false},"author":582,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[53,24,3],"class_list":["post-7335","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","tag-app-services","tag-azure","tag-team"],"acf":[],"blog_post_summary":"<p>In this post, Senior Application Development Manager, Nayan Patel, spotlights App Service deployment using Swap with Preview I was recently assisting a customer with an App Service deployment problem in Azure and came across a fairly new feature (Swap with Preview) that addressed the customer need.\u00a0 App Services offer multiple deployment slots which effectively provides [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/7335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=7335"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/7335\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=7335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=7335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=7335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}