Skip to content

Instantly share code, notes, and snippets.

@akuryan
Created July 20, 2015 12:03
Show Gist options
  • Save akuryan/855d819530bf42074e07 to your computer and use it in GitHub Desktop.
Save akuryan/855d819530bf42074e07 to your computer and use it in GitHub Desktop.
#Switches slots on azure web app (expects that there is only one deployment slot present)
#Example usage: .\SwitchAzureWebsite.ps1 username password "some subscription name" "some-webappname"
#where
#username - user with co-administrator rights on subscription
#password - password for this user
#some sbuscription name - name of subscrtion
#"some-webappname" - webapp to switch slot for
param(
[string]$userName,
[string]$password,
[string]$subscriptionName,
[string]$webAppName
)
#Setting Azure access
Import-Module GetAzureSubscription.psm1
GetAzureSubscription -userName $userName -password $password -subscriptionName $subscriptionName
Switch-AzureWebsiteSlot -Name $webAppName -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment