Resource Lock - impossible to work with
See original GitHub issueCommand Name
az resource lock list
Errors:
Missing required resource_name parameter.
Expected Behavior
Be able to list resource locks
Environment Summary
Windows-10-10.0.19044-SP0
Python 3.10.5
Installer: MSI
azure-cli 2.39.0
Extensions:
account 0.2.3
managementpartner 0.1.3
Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1
Additional Context
Some tries:
❯ az resource lock list --resource /subscriptions/da0efdd1-xxx/resourceGroups/UC-xxx -g UC-xxx
--resource-type is required if the name, --resource, is present
az resource lock list --resource /subscriptions/da0efdd1xxx/resourceGroups/UC-xxx -g UC-xxx --resource-type Microsoft.Resources/subscriptions/resourceGroups
The command failed with an unexpected error. Here is the traceback:
No value for given attribute
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 710, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/paging.py", line 129, in __next__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/paging.py", line 76, in __next__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py", line 1731, in get_next
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py", line 1693, in prepare_request
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py", line 564, in build_management_locks_list_at_resource_level_request
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 652, in url
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 760, in serialize_data
ValueError: No value for given attribute
❯ az resource lock list --resource /subscriptions/da0efdd1-xxx/resourceGroups/UC-xxx -g UC-xxx
--resource-type is required if the name, --resource, is present
❯ az resource lock list --resource "/subscriptions/da0efdd1-xxx/resourceGroups/UC-xxx"
'NoneType' object has no attribute 'strip'
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Protect your Azure resources with a lock - Microsoft Learn
You can safeguard Azure resources from updates or deletions by locking all users and roles.
Read more >How do you fix a TeamCity shared resource lock after a hard ...
Now it appears that write lock never got released. None of the builds that use that shared resource can run--they all just queue...
Read more >Reading 23: Locks and Synchronization - MIT
Because the use of locks requires threads to wait ( acquire blocks when another thread is holding the lock), it's possible to get...
Read more >8.2 How are Resources Locked During Jobs?
8.2 How are Resources Locked During Jobs? · By logging out the user who initiated the lock. · By direct action of an...
Read more >Azure Resource Locks the What Why - Jack Tracey
As the names suggest, CanNotDelete means the resources with the lock applied can be read and modified, but they cannot be deleted. The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
az group lock
solves the problem. thx!@ynden Thanks for your kind reply!
@lkurzyniec-bcg Please note that there are two command groups with different scopes. If you want to operate the lock of resource group level, please use
az group lock
If you want to operate the lock of resource level, please use
az resource lock