Skip to content

Remove-AzResourceLock not working: Error: could not be found. #27421

@Raag007

Description

@Raag007

Description

Hi, team - starting from today, Remove-AzResourceLock command is not working, we have been using this same command for the last couple of years.

Below is the command and exception:

Remove-AzResourceLock -LockName "NoDelete" -ResourceGroupName d1a -Force

Remove-AzResourceLock : The resource lock 'd1a/providers/Microsoft.Authorization/locks/NoDelete' could not be found.

Issue script & Debug output

n/a

Environment data

PSVersion                      5.1.22621.4391
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4391
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module versions

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     4.0.2      Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault...}
Script     7.9.0      Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment...}
Script     4.1.1      Az.ServiceBus                       {New-AzServiceBusAuthorizationRuleSASToken, Test-AzServiceBusNameAvailability, Approve-AzServiceBusPrivateEndpointConnection, Complete-AzServiceBusMigration...}

Error output

Remove-AzResourceLock : The resource lock 'd1a/providers/Microsoft.Authorization/locks/NoDelete' could not be found.
At line:1 char:1
+ Remove-AzResourceLock -LockName "NoDelete" -ResourceGroupName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Remove-AzResourceLock], PSInvalidOperationException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.RemoveAzureResourceLockCmdlet

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARMbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedneeds-author-feedbackMore information is needed from author to address the issue.no-recent-activityThere has been no recent activity on this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions