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

az lock delete Unexpected --namespace for lock XXX, expected microsoft.storage (got Microsoft.Storage) worked before #20351

Open
hayorov opened this issue Nov 16, 2021 · 4 comments
Assignees
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request
Milestone

Comments

@hayorov
Copy link

hayorov commented Nov 16, 2021

Describe the bug

az lock delete --name AzureBackupProtectionLock --resource-group rsg-hklife-prd-az2-ZZZ --resource MMMM --resource-type Microsoft.Storage/storageAccounts
ERROR: Unexpected --namespace for lock AzureBackupProtectionLock, expected microsoft.storage

resource type from az cli

+ az storage account list
      "keySource": "Microsoft.Storage",
    "id": "/subscriptions/XXX/resourceGroups/XXX/providers/Microsoft.Storage/storageAccounts/YYY",
    "type": "Microsoft.Storage/storageAccounts"
      "keySource": "Microsoft.Storage",

Command Name
az lock delete

Errors:

Unexpected --namespace for lock AzureBackupProtectionLock, expected microsoft.storage

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Run command above with "Microsoft.Storage"

Expected Behavior

Worked both ways.

Environment Summary

Linux-4.15.0-1113-azure-x86_64-with-debian-9.13
Python 3.6.10
Installer: DEB

azure-cli 2.21.0

Extensions:
account 0.2.1

Additional Context

Another storage account lock was processed successfully with "Microsoft.Storage" value

 + az lock delete --name AzureBackupProtectionLock --resource-group rsg-hklife-prd-az1-XXX--resource ZZZ --resource-type Microsoft.Storage/storageAccounts
 [Pipeline] sh
 + az lock delete --name AzureBackupProtectionLock --resource-group rsg-hklife-prd-az2-XXX --resource ZZZ --resource-type Microsoft.Storage/storageAccounts
 ERROR: Unexpected --namespace for lock AzureBackupProtectionLock, expected microsoft.storage

The error message Unexpected --namespace is also confusing, no --namespace argument was given (it was parsed from resource-type and/or resource-name/ -id). I'd recommend changing the error outputs here.

MS Staff - contact me if you need a real tenant/subscription and resource Id(s)

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Nov 16, 2021
@yonzhan yonzhan added the ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group label Nov 16, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Nov 16, 2021
@yonzhan yonzhan removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Nov 16, 2021
@yonzhan yonzhan added this to the Backlog milestone Nov 16, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 16, 2021

ARM

@zhoxing-ms
Copy link
Contributor

@hayorov Sorry, I can't reproduce your issue in the latest version of CLI at present. Could you run az upgrade --yes to upgrade CLI to the latest version (2.30.0) and try again?

If this issue can still be reproduced, please add the --debug parameter after the executed command, and then send the printed information to me by email. Thank you
My email address is Zhou.Xing@microsoft.com

@hayorov
Copy link
Author

hayorov commented Nov 16, 2021

@zhoxing-ms I cannot use 2.30.0 it has a critical bug(s) - #20327 #20269

I don't see any difference between 2.30.0 and 2.21.0 related to lock, could you please point to such fix/change and release version?

@Raymondo73
Copy link

Raymondo73 commented Jun 22, 2023

I get the very same message when attempting to delete a lock from a Firewall Policy. Like @hayorov I supply the fully qualified --resource-type:

az resource lock delete --resource-group myRG --resource myResource --resource-type \Microsoft.Network/firewallPolicies --name Delete

This is with version 2.44.1

Error ERROR: Unexpected --namespace for lock Delete, expected Microsoft.Network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request
Projects
None yet
Development

No branches or pull requests

4 participants