Tuesday, May 10, 2016

Powershell Commands to stream Website Diagonistic Logs

Get-WebsiteLog - Name "MySite" -Tail

Deploying and Managing Azure Websites with Powershell Commands

Extract from : MSDN

Name Description
Get-AzureWebsiteGets information about websites in Azure associated with the current subscription.
Get-AzureWebsiteDeploymentGets the deployments for a website in Azure.
Get-AzureWebsiteLocationGets all available website locations.
New-AzureWebsiteCreate a new website to run in Azure.
Remove-AzureWebsiteRemoves the specified website from Azure.
Restart-AzureWebsiteStops and then restarts the specified website.
Restore-AzureWebsiteDeploymentRedeploys a previous deployment of a website in Azure.
Save-AzureWebsiteLogDownloads and saves the logs for a specified website.
Set-AzureWebsiteConfigures a website running in Azure.
Show-AzurePortalShow the Azure Management Portal.
Show-AzureWebsiteOpens a browser on a specified website.
Start-AzureWebsiteStarts the specified website.
Stop-AzureWebsiteStops the specified website.

Powershell commands for Deployment slots

1. Powershell commands to set 2 app settings "Sticky to a Slot":

SET-AzureWebsite -Name "mySite" -SlotStickyAppSettingsName @("mySlot", "mySlot2")

2. Powershell Command for Autoswap between Staging and Production Slot:

 SET- AzureWebsite -Name "mySite" -SlotStaging - AutoSwapSlotName Production

3. Poweshell Command to set 2 connection strings as "Sticky to a Slot":

Set-AzureWebsite -Name "mySite" -SlotStickyConnectionStringName @("myConn","MyConn2")