Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Raag007 opened this issue Mar 25, 2025 · 1 comment
Open

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

Raag007 opened this issue Mar 25, 2025 · 1 comment
Labels
ARM bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported needs-author-feedback More information is needed from author to address the issue.

Comments

@Raag007
Copy link

Raag007 commented Mar 25, 2025

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
@Raag007 Raag007 added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Mar 25, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported needs-triage This is a new issue that needs to be triaged to the appropriate team. and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Mar 25, 2025
@isra-fel
Copy link
Member

Hi, as you said, "we have been using this same command for the last couple of years", what could have changed? Did you updat ethe version of azure powershell?

Also, sharing the debug log can help up diagnose the issue

@isra-fel isra-fel added ARM needs-author-feedback More information is needed from author to address the issue. and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported needs-author-feedback More information is needed from author to address the issue.
Projects
None yet
Development

No branches or pull requests

2 participants