forked from robotechredmond/Azure-PowerShell-Snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ARM - Scale a Web Site.ps1
43 lines (28 loc) · 886 Bytes
/
ARM - Scale a Web Site.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Authenticate with Azure Account
Add-AzureAccount
# Switch Azure PowerShell Mode to Resource Manager
Switch-AzureMode -Name AzureServiceManagement
# Get WebApp Server Farm Id
$webAppName = "kemwebapp02"
$webApp = Get-AzureResource `
-ExpandProperties |
Where-Object {
$_.Name -eq $webAppName `
-and `
$_.ResourceType -eq "Microsoft.Web/sites" `
}
$serverFarmId = $webApp.Properties.serverFarmId
# Set new number of WebApps instances
$numInstances= 1
$resourceProps = @{"numberOfWorkers" = $numInstances}
$apiVers = "2015-02-01"
Set-AzureResource `
-ResourceId $serverFarmId `
-Properties $resourceProps `
-ApiVersion $apiVers `
-OutputObjectFormat New `
-Force
# Confirm new number of WebApps instances
$webFarm = Get-AzureResource `
-ResourceId $serverFarmId
$webFarm.Properties.currentNumberOfWorkers