Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to perform deployment swap on an Azure WebSite using Powershell?

This question refers to the application slots feature for Azure Server Manager (ASM) WebSites that enables the ability to create a staging website under an existing one. I'd like to swap my site's staging and production environments using Powershell, but I haven't found the way to do it with the currently available commands. Does anyone have an idea how to do it?

like image 432
Benedek Farkas Avatar asked Feb 13 '14 18:02

Benedek Farkas


People also ask

Which command is used to deploy a package application to Windows Azure?

Deploy a ZIP package to your web app by using the az webapp deploy command.


2 Answers

Switch-AzureWebsiteSlot -Name "your web site name" -Force

like image 188
Rick Rainey Avatar answered Oct 07 '22 21:10

Rick Rainey


You can use this PowerShell cmdlet: Switch-AzureWebsiteSlot [[-Name] ] [[-Slot1] ] [[-Slot2] ] [-Force] [-Confirm] [-WhatIf] [ ]

[-Force] parameter is used in order to not confirm the swap operation and directly execute

An Example:

C:\PS>Switch-AzureWebsiteSlot -Name YourWebsite
like image 37
Rami Sarieddine Avatar answered Oct 07 '22 22:10

Rami Sarieddine