重置 Azure 云服务(外延支持)

这些示例涵盖了重置现有 Azure 云服务(外延支持)部署的各种方式。

重置云服务角色实例的映像

$roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
Invoke-AzCloudServiceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances

此命令会重置 ContosoCS 资源组中 ContosoCS 云服务的 2 个角色实例(ContosoFrontEnd_IN_0 和 ContosoBackEnd_IN_1)的映像。

重置云服务的所有角色的映像

Invoke-AzCloudServiceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance "*"

此命令会重置 ContosOrg 资源组中 ContosoCS 云服务的所有角色实例的映像。

重置云服务的单个角色实例的映像

Invoke-AzCloudServiceRoleInstanceReimage -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstanceName "ContosoFrontEnd_IN_0"

此命令会重置 ContosOrg 资源组中 ContosoCS 云服务的 ContosoFrontEnd_IN_0 角色实例的映像。

重新生成云服务的角色实例

$roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
Invoke-AzCloudServiceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances

此命令会重新生成 ContosoCS 资源组中 ContosoCS 云服务的 2 个角色实例(ContosoFrontEnd_IN_0 和 ContosoBackEnd_IN_1)。

重新生成云服务的所有角色

Invoke-AzCloudServiceRebuild -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance "*"

此命令会重新生成 ContosOrg 资源组中 ContosoCS 云服务的所有角色实例。

重启云服务的角色实例

$roleInstances = @("ContosoFrontEnd_IN_0", "ContosoBackEnd_IN_1")
Restart-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance $roleInstances

此命令会重启 ContosoCS 资源组中 ContosoCS 云服务的 2 个角色实例(ContosoFrontEnd_IN_0 和 ContosoBackEnd_IN_1)。

重启云服务的所有角色

Restart-AzCloudService -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -RoleInstance "*"

此命令会重启 ContosOrg 资源组中 ContosoCS 云服务的所有角色实例。

后续步骤