Aracılığıyla paylaş


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

Bu örnekler, mevcut 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, Mevcut ContosoCS adlı bulut hizmetine ContosOrg adlı kaynak grubuna ait 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, ContosoCS adlı mevcut bulut hizmetinden ContosOrg adlı kaynak grubuna ait olan 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ı Cloud Service'ten kaldırma

Aşağıdaki komut kümesi, ContosoCS adlı mevcut bulut hizmetinden ContosOrg adlı kaynak grubuna ait RDP uzantısını 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

Ölçeği genişletme / ölçeği daraltma rol örnekleri

Aşağıdaki komut kümesinde, ContosOrg adlı kaynak grubuna ait ContosoCS adlı bulut hizmeti için ölçeği genişletme ve ölçeği daraltma rol örneği sayısı gösterilmektedir.

# 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ış.