Add button to copy Prod to Staging slot instead of swap
When we deploy by using 'swap' the deployment slot will have an old version of the website. Since we want to use the deployment slot as a staging website, it would be great if we could copy the primary website to a deployment slot, without performing a swap.
Thanks for the feedback! We are working on enabling this feature.
Fred Willerup commented
This idea makes sense, but please keep the Swap as an option. We use a separate app for staging, then deploy to prod, then swap. However, in some cases we have found critical issues after swapping and it has been really useful to just swap back to "undo" the deployment.
So please keep the swap option.
govindagoud patil commented
It would be good have both option swap and copy
Jim Berg commented
App Service Plans are what we have to pay for each month. It doesn't cost anything to create an app service. We use a separate app service for our Dev, Stage, UAT, and Demo environments running in the same App Service plan. Each one has its own predeploy slot so we can stage the app before deploying to the "production" slot of the environment. Trying to configure all of your environments in a single app service is obviously a management nightmare.
I do, however, need a copy feature. My problem is that I want to be able to setup a predeploy slot for a WordPress site and unfortunately WordPress maintains uploaded content in a folder under wwwroot. I need a way to copy those files from the production slot or vice versa. Just having a swap would remove all of those files. A feature to sync specific directories between slots would be very useful. Is there anything like that available now? Or the ability to configure a virtual directory that points to a directory shared by every slot?
Hello, can u say something about a https://mobile-spy-apps.com mobile recorder on Android. How can we use this application in our phones?
Pavel Jonák commented
HI, how it looks with this new workflow? I would like to have this option in azure portal and powershell as well :) Because now is necessary to deploy into staging slot again after swap.
I need this! Just getting started with Azure, Slots seemed ideal, we until I realised, there is a potential for old files creeping back into production. At the moment, it's > make change > deploy to staging > swap to production > then redeploy source files back into staging (old production code), to keep everything in sync. Very cumbersome, or I'm missing the point of slots. I'd ideally like to keep everything in the MS stack.
+1 for this feature
How many years will it take to implement this?! Seems like a no-brainer to me. I need it just like everyone else commenting here. Last update is June 19, 2017. In that time we've probably seen the release of 100 new Azure services, much more complicated than this simple feature upgrade.
I'd be a little ashamed if I was the feature team on Web apps. :-(
Piers Lawson commented
Our current deployment process "promotes" a build of a website through TEST, UAT, PRE-PROD and eventually to PROD. Deployment slots seem an ideal way to provide a similar process... however, despite all the benefits of using the Swap functionality, the downside is that after a Swap, our old code would end up making its way back down that chain. After a few releases, TEST would be running what had been the PROD code several releases earlier.
Since other web sites also have TEST, UAT, PRE-PROD sites as well, which would link to other sites in the corresponding deployment slots, we could end up with one TEST site running the next release of its code linking to another web site running a very old release of its software.
So a button to copy the code running in one slot to another slot rather than using a Swap would be very useful. We'd then just have to decide if we would use the copy all the time instead of swap, OR use swap to promote followed by a copy backwards when we're happy OR use copy all the time except for a swap between PRE-PROD and PROD so we can rollback in PROD but don't have to worry about keeping most of the other environments in sync.
Or is there a better way to do this? Perhaps using Deploy tasks for TEST, UAT and PRE-PROD then a Swap for PRE-PROD to PROD?
Mark Allan commented
This would be a godsend. A -SourceSlot parameter on New-AzureRmWebAppSlot would save so much pain. Scripting it's a real headache, particularly with large sites where the Kudu ZIP APIs tend to keel over, not to mention the time that would be saved by copying locally rather than having to export and import. (My scenario: CMS site that needs to be updated and tested on a staging slot before switching to live - thanks SQL team for CREATE DATABASE AS COPY OF!)
Here's a scenario I could have used this today. I wanted to test how some settings in the web.config would affect production. Copy production into a new slot (AFAIK cloning feature does not let you clone into a slot, I tried). Test my changes in that slot and hit the slot URL. Swap into production when ready. Technically I can do all that with other tools/processes, but a one button copy would be nice and I can see myself using it a lot.
Just an update that we are still looking at how it is best to enable the feature. We definitely see the value in adding the option and we will update when we have more to share.
It's will be amazing. It's missing for me too.
Edward Dear commented
+1 for this. We frequently do development on a deployment slot, and periodically need to reset it back to the same state as the production site.
RAHUL VOHRA commented
@Nir Mashkowski, Is there any update regarding this feature? Or is there any workaround to just have one-way copy?
I wanted to check if this has been implemented yet?
Per Lindén commented
This would also solve the problem of having "live" App_Data contents that should not be swapped with some old/empty version in the deployment slot.
This would be useful for me.
Here is my scenario.
I have a website composed of different applications (sub virtual directories).
I have different build processes for the different applications.
When I deploy to my staging environment, the build process only deploy the files of the corresponding application.
What this mean is that if I build an app (App A), publish it to the staging slot and do a VIP swap, the production environment will be fine and the staging environment will have the previous version of the Website files.
Then, if I publish another app (App B) to the staging slot and do a VIP swap, the production environment will have the updated files of the "App A", but the files of "App B" will be reverted.
In this case, the workflow I would like to do is:
1) Build my App,
2) Copy the full content of the production slot website to a staging slot.
3) Deploy the App to the staging slot (overwrite the Virtual Directory files)
4) Do a run of smoke tests on the staging slot (an prewarm the site)
5) Do a VIP swap
L. Mag commented
I really, really need this feature. Please!
Arash Motamedi commented
This is much needed. Consider this scenario: 1. Publish new site to staging. 2. Swap to prod. 3. Need minor tweak in an HTML file, update and partially publish (just the modified file) to staging. Now, my staging area has an old site with a new HTML file... Oops! Things got mixed up and can't proceed to swapping without a full deployment to staging.
So, there's a need that after a swap (and successfully verifying that the new site is well), there should be a way to copy the new production bits back into the staging slot, so both staging and production have the latest bits.