gpt4 book ai didi

azure - 尝试锁定 Azure 中的虚拟机时出错

转载 作者:行者123 更新时间:2023-12-03 03:11:50 25 4
gpt4 key购买 nike

我正在使用此命令:

New-AzureRmResourceLock -LockLevel CanNotDelete -LockName“labservertest1lock”-ResourceName“labservertest1”-ResourceType“Microsoft.ClassicCompute/virtualMachines/”

我收到此错误:

New-AzureRmResourceLock:ResourceNotFound:资源“Microsoft.ClassicCompute/virtualMachines/labservertest1”未找到资源组“”。行:1 字符:1+ New-AzureRmResourceLock -LockLevel CanNotDelete -LockName“labservertest1lock”- ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [New-AzureRmResourceLock],ErrorResponseMessageException +FullyQualifiedErrorId:ResourceNotFound、Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzur eResourceLockCmdlet

我的资源:

名称:labservertest1资源ID:/subscriptions/276866f0-eb22-4696-9667-2f30d2801a3a/resourceGroups/altqalab/providers/Microsoft.Cla ssicCompute/虚拟机/labservertest1资源名称:labservertest1资源类型:Microsoft.ClassicCompute/virtualMachines资源组名称:altqalab地点 : 西欧订阅ID:276866f0-eb22-4696-9667-2f30d2801a3a

这似乎是 ResourseType Flag 上的问题,VM 的 ResourceType 应该是什么???

最佳答案

我认为您收到此错误的原因是您没有指定 ResourceGroupName 参数(基于错误消息)

New-AzureRmResourceLock : ResourceNotFound : The Resource 'Microsoft.ClassicCompute/virtualMachines/labservertest1' under resource group '' was not found.

请尝试以下操作,看看是否有效:

New-AzureRmResourceLock -LockLevel CanNotDelete -LockName "labservertest1lock" -ResourceName "labservertest1" -ResourceType "Microsoft.ClassicCompute/virtualMachines/" -ResourceGroupName "altqalab"

关于azure - 尝试锁定 Azure 中的虚拟机时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36430563/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com