Skip to content

Instantly share code, notes, and snippets.

@RichardSlater
Created April 25, 2013 15:27
Show Gist options
  • Save RichardSlater/5460609 to your computer and use it in GitHub Desktop.
Save RichardSlater/5460609 to your computer and use it in GitHub Desktop.
Set's all Web and Worker roles in a subscription to a single instance.
$deployments = Get-AzureService |
Select-Object ServiceName |
Get-AzureDeployment
$instances = $deployments |
Select-Object ServiceName,Slot -ExpandProperty RoleInstanceList
$instances |
Select-Object ServiceName,Slot,RoleName |
Group-Object RoleName,ServiceName,Slot -NoElement |
Where-Object {$_.Count -gt 1} |
Select-Object Count,@{Name="RoleName"; Expression={$_.Name.Split(',')[0].Trim()}},@{Name="ServiceName";Expression={$_.Name.Split(',')[1].Trim()}},@{Name="Slot";Expression={$_.Name.Split(',')[2].Trim()}} |
Set-AzureRole -Count 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment