Azure Cloud Service'i (genişletilmiş destek) güncelleştirme

Bu örnekler, var olan bir Azure bulut hizmeti (genişletilmiş destek) dağıtımını güncelleştirmenin çeşitli yollarını kapsar.

Mevcut bulut hizmetine uzantı ekleme

Aşağıdaki komut kümesi, ContosOrg adlı kaynak grubuna ait ContosoCS adlı zaten var olan bir bulut hizmetine bir RDP uzantısı ekler.

# Create RDP extension object
$rdpExtension = New-AzCloudServiceRemoteDesktopExtensionObject -Name "RDPExtension" -Credential $credential -Expiration $expiration -TypeHandlerVersion "1.2.1"
# Get existing cloud service
$cloudService = Get-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"
# Add RDP extension to existing cloud service extension object
$cloudService.ExtensionProfile.Extension = $cloudService.ExtensionProfile.Extension + $rdpExtension
# Update cloud service
$cloudService | Update-AzCloudService

Bulut hizmetinden tüm uzantıları kaldırma

Aşağıdaki komut kümesi, ContosOrg adlı kaynak grubuna ait olan ContosoCS adlı mevcut bulut hizmetinden tüm uzantıları kaldırır.

# Get existing cloud service
$cloudService = Get-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"
# Set extension to empty list
$cloudService.ExtensionProfile.Extension = @()
# Update cloud service
$cloudService | Update-AzCloudService

Uzak Masaüstü uzantısını bulut hizmetinden kaldır

Aşağıdaki komut kümesi, RDP uzantısını ContosOrg adlı kaynak grubuna ait olan ContosoCS adlı mevcut bulut hizmetinden kaldırır.

# Get existing cloud service
$cloudService = Get-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"
# Remove extension by name RDPExtension
$cloudService.ExtensionProfile.Extension = $cloudService.ExtensionProfile.Extension | Where-Object { $_.Name -ne "RDPExtension" }
# Update cloud service
$cloudService | Update-AzCloudService

Genişleme/ölçek genişletme rol örnekleri

Aşağıdaki komut kümesi, ContosOrg adlı kaynak grubuna ait ContosoCS adlı bulut hizmeti için nasıl genişleme ve ölçek oluşturma rol örneği sayımının nasıl yapılacağını gösterir.

# Get existing cloud service
$cloudService = Get-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"

# Scale-out all role instance count by 1
$cloudService.RoleProfile.Role | ForEach-Object {$_.SkuCapacity += 1}

# Scale-in ContosoFrontend role instance count by 1
$role = $cloudService.RoleProfile.Role | Where-Object {$_.Name -eq "ContosoFrontend"}
$role.SkuCapacity -= 1

# Update cloud service configuration as per the new role instance count
$cloudService.Configuration = $configuration

# Update cloud service
$cloudService | Update-AzCloudService

Sonraki adımlar

Azure Cloud Services (genişletilmiş destek) hakkında daha fazla bilgi için bkz. azure Cloud Services (genişletilmiş destek) genel bakış.