mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-20 09:37:56 +08:00
5787cfa699
* initial * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix
17 lines
653 B
PowerShell
17 lines
653 B
PowerShell
# Create a system managed identity
|
|
# Adding to existing Scale set
|
|
$scaleSetResourceGroup = "PrAnd-2023-04-17"
|
|
$scaleSetName = "PrAnd-2023-04-17Vmss"
|
|
|
|
$vm = Get-AzVMss -ResourceGroupName $scaleSetResourceGroup -Name $scaleSetName
|
|
Update-AzVMss -ResourceGroupName $scaleSetResourceGroup -VMScaleSetName $scaleSetName -IdentityType SystemAssigned
|
|
|
|
$spID = $vm.Identity.PrincipalId
|
|
|
|
$acrGroup = "And-Registry"
|
|
$acrName = "AndContainerRegistry"
|
|
|
|
$resourceID = (Get-AzContainerRegistry -ResourceGroupName $acrGroup -Name $acrName).Id
|
|
|
|
# needs admin privileges
|
|
New-AzRoleAssignment -ObjectId $spID -Scope $resourceID -RoleDefinitionName AcrPull |