New-AzWebApp : Long running operation failed with status 'InternalServerError'

akash.paul 6 Reputation points
2022-04-08T09:53:21.447+00:00

While trying to Azure App Service App Cloning Using PowerShell , I am getting the below error:

191238-r7bzi.png

I want to copy an existing webapp to another app plan. I have collected the command from https://learn.microsoft.com/en-us/azure/app-service/app-service-web-app-cloning

Here is my script,

$srcapp = Get-AzWebApp -ResourceGroupName abcd -Name Testapp1

$destapp = New-AzWebApp -ResourceGroupName abcd -Name Testapp2 -Location "West Europe" -AppServicePlan appplan-1 -SourceWebApp $srcapp

Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
697 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,537 questions
Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
417 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,807 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 21,661 Reputation points
    2022-04-08T12:55:04.153+00:00

    Thanks for reaching here! Could you please confirm that your webappname Testapp2 is not already created?

    As mentioned in the document that using the New-AzWebApp command, you can create the new app.

    I tried below commands and was able to clone:

    $srcapp = Get-AzWebApp -ResourceGroupName sresourcegroup -Name swebapp  
    
    New-AzAppServicePlan -Location "Central US" -ResourceGroupName snsnresourcegroup -Name newappplan -Tier Standard  
    
    $destapp = New-AzWebApp -ResourceGroupName snsnresourcegroup -Name newwebapp -Location "Central US" -AppServicePlan  newappplan -SourceWebApp $srcapp  
      
    

    Please let us know if further query or issue remains.

    0 comments No comments

  2. akash.paul 6 Reputation points
    2022-04-09T03:51:54.033+00:00

    Hi, I can get webapps all info by Get-AzWebApp and can create a new one by New-AzWebApp standalone. But cloning is not working due to InternalServerError. However, I just checked Health history of Service Health & got some notifications. There's running scheduled maintenance on Azure App Service instance(s) in West Europe.

    191512-screenshot-2022-04-09-093845.png

    Could this be the cause of the issue?

    0 comments No comments

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.