Azure Logic App - Overwrite Blob

Noah Van Loen 61 Reputation points
2020-09-17T20:25:18.657+00:00

When using "Create Blob" to write a blob from Logic App to Blob storage v2, I get the following error when there's an existing file in that location.

{  
  "status": 409,  
  "message": "Another active upload session exists, please retry after some time.\r\nclientRequestId: 4778f0b6-25b8-4321-a1f7-d7a7a7925461",  
  "error": {  
    "message": "Another active upload session exists, please retry after some time."  
  },  
  "source": "azureblob-wus.azconn-wus-01.p.azurewebsites.net"  
}  

When looking at blob properties, the file has a Lock on the Lease. How can I a) clear the Lock so the operation completes, or b) force an overwrite?

25702-image.png

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,348 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,436 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,854 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sumarigo-MSFT 43,801 Reputation points Microsoft Employee
    2020-10-12T06:30:34.677+00:00

    @Noah Van Loen & @Ravi Palihena @Steven Tchir Operations you mentioned "delete/create" with the lease control can be achieved via Blob Service REST API and HTTP action. Before deleting blob, the lease should be established via lease container. The request header should contain headers: 'x-ms-lease-action: acquire' and 'x-ms-lease-duration: <value in seconds>'. The service will respond with a response code and unique lease ID 'x-ms-lease-id'. While the lease is active, You must include the lease ID with any request to delete the container or to renew, change, or release the lease.

    Delete blob could contain a large number of snapshots and the operation could time out. If that happens, the client should retry the request, please refer to https://learn.microsoft.com/en-us/rest/api/storageservices/delete-blob#remarks

    For releasing the established lease, request header should contain: 'x-ms-lease-id: <lease id>' and 'x-ms-lease-action: release'.

    Archiving blob, for now, could be achieved in the following way: create a new blob container with the new name and copy blobs from the old blob container to the new one. Once the blobs are copied, you can delete the old blob container.

    If you would like to have a fully-automated process in the connector, please vote on the user voice forum. We tend to pick the top ones every time we do the planning: https://feedback.azure.com/forums/287593-logic-apps?category_id=145803

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.

    -------------------------------------------------------------------------------------------------------------

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

    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Mark Wilson 1 Reputation point
    2022-11-10T14:18:29.057+00:00

    I ran into a similar issue and was able to address it by updating the parent for each component.

    https://markedcode.com/index.php/2022/11/10/blob-import-from-logicapp-lease-error/

    0 comments No comments