powershell - 停止-AzureVM : No deployment found in service

标签 powershell azure azure-powershell

我想停止并取消分配 Azure 中的 Windows VM。

在 PowerShell 中,我使用命令:

Stop-AzureVM - ServiceName [servicename] - Name [machinename] - Force

但是,我在 PowerShell 中收到以下错误消息:

WARNING: "No deployment found in service [servicename]

可能出了什么问题?

最佳答案

故障排除步骤:

  1. 虚拟机是否已处于关闭或解除分配状态。

  2. 您是否有多个订阅。如果是,则使用以下 cmdlet 选择正确的订阅,然后尝试停止 VM:

    Select-AzureSubscription -SubscriptionName "<<Your SubscriptionName here>>"
    

    Select-AzureSubscription -Id "<<Your Subscription ID>>"
    
  3. 如果您只有一个 Azure 订阅,请检查是否使用 ASM(即旧门户 ( https://manage.windowsazure.com )或 ARM (即新门户 ( https://portal.azure.com ))创建 VM。如果您使用新门户,则需要使用 ARM 相关的 PowerShell cmdlet,如下所示:

    Stop-AzureRmVM -ResourceGroupName "resource group name" -Name "VM name"
    

ARM PowerShell cmdlet 引用:Azure Resource Manager and PowerShell

关于powershell - 停止-AzureVM : No deployment found in service,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36722677/

相关文章:

powershell - 如何通过 powershell 查找 Microsoft JScript 和 VBScript 引擎版本

azure - 在 Service Fabric 集群上发布应用程序后 HttpContext.Session 为空

azure - 通过 powershell 检查 azure VM 计算配额是否可用于 VM 大小

c# - 使用C#/.Net Core签署Powershell脚本

powershell - 函数输出类型

azure - 在Azure B2C中忘记密码时发送验证电子邮件到其他电子邮件(身份验证电子邮件)?

sql-server - 在哪里可以找到 Azure 数据库同步

azure - AZ REST DevOps 方法返回 "az : Not a json response"

azure - 如何使用 PowerShell 为已停止的 Azure Web App 禁用 Kudu (SCM)?

json - 如何加载 JSON 文件并将其转换为特定类型的对象?