How can I copy (not swap) from one Azure App Service slot to another?

David Thielen 3,211 Reputation points
2024-04-01T12:18:18.5966667+00:00

Hi all;

I want to copy my dev slot to a loadtesting slot. I do not want to swap. Is there a way to do that?

thanks - dave

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,970 questions
Azure | Azure Startups
0 comments No comments
{count} votes

Accepted answer
  1. brtrach-MSFT 17,741 Reputation points Microsoft Employee Moderator
    2024-04-02T00:34:09.88+00:00

    @David Thielen While swapping is commonly used for deployment, I understand that you specifically want to copy your development slot to a load testing slot.

    Here are a couple of approaches you can consider:

    1. Azure PowerShell: You can use Azure PowerShell to achieve this. The following commands demonstrate how to copy the production slot into a staging slot:
         $SrcSlot = Get-AzWebAppSlot -ResourceGroupName "your-resource-group" -Name "your-app-name" -Slot "production"
         New-AzWebAppSlot -ResourceGroupName "your-resource-group" -Name "your-app-name" -SourceWebApp $SrcSlot -Slot "loadtesting"
         
      
      Replace "your-resource-group" and "your-app-name" with your actual resource group and app name.
    2. Manual Deployment: Another option is to manually deploy your code from the development slot to the load testing slot. You can do this by publishing your application directly to the desired slot using tools like Visual Studio, Azure DevOps, or GitHub Actions. This method allows you to control the deployment without swapping slots.

    Let me know if you have any questions about the above suggestions by replying to this message.


1 additional answer

Sort by: Most helpful
  1. Marcin Policht 50,895 Reputation points MVP Volunteer Moderator
    2024-04-01T12:24:15.86+00:00

    In short, no. You have to deploy from the source code repo/the original location to the slot.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.