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.