Skip to content

[ResourceManager] Unable to delete locks #2688

@berndverst

Description

@berndverst

az lock delete --name $LOCKNAME does not return any value and seems to have no impact

My specific use case:
I am unable to delete or update a lock associate with a storage account which itself was associated with a function app. I want to delete the storage account after having deleted a function app via CLI.

There appears to be no workaround since the Portal no longer gives me access to the function settings (and locks).

Steps to reproduce:

az appservice web delete --name shortlinkservice --resource-group shortlinkservice-group
az storage account delete --name function92f1a43683ee --resource-group shortlinkservice-group
Are you sure you want to perform this operation? (y/n): y
The scope '/subscriptions/203c6e23-7c41-47de-8f9f-2ad1807ae229/resourceGroups/shortlinkservice-group/providers/Microsoft.Storage/storageAccounts/function92f1a43683ee' cannot perform delete operation because following scope(s) are locked: '/subscriptions/203c6e23-7c41-47de-8f9f-2ad1807ae229/resourcegroups/shortlinkservice-group/providers/Microsoft.Storage/storageAccounts/function92f1a43683ee'. Please remove the lock and try again.
az lock list
[
  {
    "id": "/subscriptions/203c6e23-7c41-47de-8f9f-2ad1807ae229/resourcegroups/shortlinkservice-group/providers/Microsoft.Storage/storageAccounts/function92f1a43683ee/providers/Microsoft.Authorization/locks/function92f1a43683ee",
    "level": "CanNotDelete",
    "name": "function92f1a43683ee",
    "notes": "One or more function apps were linked to this storage account. You can see all the function apps linked to the account under 'files' or 'shares'.",
    "type": "Microsoft.Authorization/locks"
  }
]
az lock delete --name function92f1a43683ee

(no return value or error)

az lock list
[
  {
    "id": "/subscriptions/203c6e23-7c41-47de-8f9f-2ad1807ae229/resourcegroups/shortlinkservice-group/providers/Microsoft.Storage/storageAccounts/function92f1a43683ee/providers/Microsoft.Authorization/locks/function92f1a43683ee",
    "level": "CanNotDelete",
    "name": "function92f1a43683ee",
    "notes": "One or more function apps were linked to this storage account. You can see all the function apps linked to the account under 'files' or 'shares'.",
    "type": "Microsoft.Authorization/locks"
  }
]
az lock update --name function92f1a436833ee
The lock 'function92f1a436833ee' could not be found.

Stuck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupP1Resource ManagerbugThis issue requires a change to an existing behavior in the product in order to be resolved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions