Skip to content

Instantly share code, notes, and snippets.

@mathieu-benoit
Created April 17, 2017 22:26
Show Gist options
  • Save mathieu-benoit/dacfb9127f0d86f631232ea070e46d24 to your computer and use it in GitHub Desktop.
Save mathieu-benoit/dacfb9127f0d86f631232ea070e46d24 to your computer and use it in GitHub Desktop.
Clone-WebApp-On-Slot
#Currently there is an issue with New-AzureRmWebAppSlot so this snippet doesn't work.
#Issue entered here: https://github.com/Azure/azure-powershell/issues/3779
#Stay tuned!
Param(
[string] [Parameter(Mandatory=$true)] $SubscriptionId,
[string] [Parameter(Mandatory=$true)] $ResourceGroupName,
[string] [Parameter(Mandatory=$true)] $AppServicePlan,
[string] [Parameter(Mandatory=$true)] $WebAppName,
[string] [Parameter(Mandatory=$true)] $SlotName
)
#Login-AzureRmAccount;
#Select-AzureRmSubscription -SubscriptionId $SubscriptionId;
$srcapp = Get-AzureRmWebApp -ResourceGroupName $ResourceGroupName -Name $WebAppName;
New-AzureRmWebAppSlot -ResourceGroupName $ResourceGroupName -Name $WebAppName -AppServicePlan $AppServicePlan -Slot $SlotName -SourceWebApp $srcapp;
@ChoOo7
Copy link

ChoOo7 commented Dec 4, 2019

Twice, i have
New-AzureRmWebAppSlot : Long running operation failed with status 'InternalServerError'.
Au caractère Ligne:1 : 1

  • New-AzureRmWebAppSlot -ResourceGroupName $ResourceGroupName -Name $We ...
  •   + CategoryInfo          : CloseError : (:) [New-AzureRmWebAppSlot], CloudException
      + FullyQualifiedErrorId : Microsoft.Azure.Commands.WebApps.Cmdlets.DeploymentSlots.NewAzureWebAppSlotCmdlet
    

after a long time.....

@mathieu-benoit
Copy link
Author

Hi @ChoOo7, to be honest I haven't touched this script during the last 3 years... if you have any feedback to fix it, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment