Skip to content

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

@hayorov

Description

@hayorov

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)

Metadata

Metadata

Assignees

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions