Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.99k forks source link

az lock commands response show lockId in resourceId property #29751

Open rosanch opened 2 months ago

rosanch commented 2 months ago

Describe the bug

The response for any lock command returns resource referring the resource the lock was created on (e.g. KeyVault, Storage, RG, etc), and ExtensionResource or Lock for the lock's properties. However, both ResourceId and LockId hold the exact same value. I'd imagine this is a bug since it doesn't make much sense to have the exact same value twice.

Output: image

Related command

az lock *

Errors

No error message. Output is wrong

Issue script & Debug output

You can work around it handling the lock ID

Expected behavior

ResourceID = The resource the lock is on. LockID = The Lock ID

Environment Summary

azure-cli 2.60.0 *

core 2.60.0 * telemetry 1.1.0

Extensions: acrtransfer 1.1.0 azure-devops 1.0.1

Dependencies: msal 1.28.0 azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\ROSANCH.azure\cliextensions'

Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 21:52:07) [MSC v.1937 32 bit (Intel)]

Additional context

No response

azure-client-tools-bot-prd[bot] commented 2 months ago

Hi @rosanch,

2.60.0 is not the latest Azure CLI(2.63.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 2 months ago

Thank you for opening this issue, we will look into it.