How to fix this error "An operation is currently performing on this storage account that requires exclusive access. (Code: StorageAccountOperationInProgress)"

Murali R 205 Reputation points
2024-04-18T14:35:46.83+00:00

Hi Team,

I'm currently working on deploying NSG flow logs via BICEP. However, when deploying through the release pipeline, I encounter the following error: "An operation is currently performing on this storage account that requires exclusive access. (Code: StorageAccountOperationInProgress)." It succeeds only after 2 or 3 attempts.

Kindly help me on resolving this issue.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,700 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Alex Burlachenko 810 Reputation points
    2024-04-18T14:39:53.81+00:00

    The error “An operation is currently performing on this storage account that requires exclusive access. (Code: StorageAccountOperationInProgress)” typically occurs when there’s an ongoing operation on the Azure Storage account that needs to be completed before another operation can be performed.

    Yea I know I could looks strange but - wait and retry: If there’s an ongoing operation, you might need to wait for it to complete before you can perform another operation.

    This could be the case if you’re trying to perform multiple operations in quick succession.

    Check the Activity Log: The Azure portal’s Activity Log can provide more information about ongoing operations.

    Use Azure Resource Explorer: Azure Resource Explorer can be used to check the status of your storage account and potentially repair its status.


  2. Anand Prakash Yadav 5,845 Reputation points Microsoft Vendor
    2024-04-19T09:00:48.75+00:00

    Hello Murali R,

    Thank you for posting your query here!

    I have a doubt, if we add this action ( "Microsoft.Storage/storageAccounts/read") to the custom role which deploys nsg flow log, will this issue gets resolved

    Adding the action "Microsoft.Storage/storageAccounts/read" to the custom role used in deploying NSG flow logs could help, but primarily from an access perspective. This permission allows the role to read the properties of storage accounts, which is necessary for operations that need to fetch details about the storage account (like its resource ID or status) before performing actions on it.

    However, regarding the specific error you're encountering "An operation is currently performing on this storage account that requires exclusive access. (Code: StorageAccountOperationInProgress)" this error is more about the state of the storage account at the time of operation rather than the permissions of the role. The error indicates that some exclusive operation is currently being performed on the storage account, which needs to be completed before another operation can be initiated.

    So, while it will ensure that the role has the necessary permissions to read storage account details, which could be critical if your deployment script needs to check the status or other properties of the storage account before initiating the NSG flow log deployment. It ensures that there are no permission-related blocks when the script checks storage account details.

    However, operation-wise it won't prevent the storage account from being in a state where exclusive operations prevent other operations.

    I hope this helps! Please let me know if the issue persists or if you have any other questions.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.