Saturday, October 1, 2016

Configuring site settings using Azure PowerShell

To specify site settings using Azure PowerShell, use the Set-AzureWebsite cmdlet. 
For example,this code demonstrates enabling web sockets for a site.

$wsName = "contoso-web"
Set-AzureWebsite $wsName -WebSocketsEnabled $true


To define application settings using PowerShell, you will need to create a hashtable to define the setting. This is an example showing how to define a key/value pair for application settings.

$settings = New-Object Hashtable
$settings["Contoso_HR_WebService_URL"] = "https://contoso-webservices/hr"
Set-AzureWebsite $wsName -AppSettings $settings


This is an example of how to define a connection string using Azure PowerShell where a Connection String Info structure is used to deine the connection string.

$connStrs = (@{Name="contosodb"; Type="SQLAzure"; ConnectionString="Server=tcp:.." })
Set-AzureWebsite -Name $wsName -ConnectionStrings $connStrs

Featured Posts

Adding Accesspolicy to KeyVault for Service Principal Using Portal and Powershell

  Scripts path : https://drive.google.com/drive/folders/1sbBpnVFgXhUIXLdf2E9heyWDeU2f9427?usp=sharing  Adding Accesspolicy to KeyVault for S...