x-ms-proposed-lease-id-Error "HTTP header value is not in the correct format"

Prithvi Singh 0 Reputation points
2025-08-28T12:56:36.32+00:00

Getting invaild x-ms-proposed-lease-id value -

BlobLeaseClient leaseClient = await GetBlobLeaseClient();

User's image

Instead of GUID (value of Leaseid), getting name of contanier as Leaseid - error bleow -

User's image

Please help to resolve it.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jeevan Shanigarapu 255 Reputation points Microsoft External Staff Moderator
    2025-08-28T14:42:57.3666667+00:00

    Hello @Prithvi Singh,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that the error you are getting HTTP header value is not in the correct format is due to the x-ms proposed-lease-id header being set to a non-GUID value. In your case, the string update row level security is being passed as the lease ID, which is invalid. Based on the screenshot, it looks like the BlobLeaseClient is being initialized with the container name rather than a valid GUID.

    To fix the issue, please execute the below steps,

    1. Generate a Valid GUID for the Lease ID
    string leaseId = Guid.NewGuid().ToString();
    2. Set up the BlobLeaseClient using the GUID
    BlobLeaseClient leaseClient = blobClient.GetBlobLeaseClient(leaseId);

    3. Obtain the lease agreement
    Response<BlobLease> leaseResponse = await leaseClient.AcquireAsync(TimeSpan.FromSeconds

    1. Make sure you are targeting a blob rather than a container.
      BlobClient blobClient = containerClient.GetBlobClient("mutex");
      BlobLeaseClient leaseClient = blobClient.GetBlobLeaseClient();

    This will ensure that the lease ID is in the correct format and that the lease operation targets the intended blob resource.

    Reference link:

    Create and manage blob leases with .NET - Azure Storage | Microsoft Learn

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

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments

  2. Prithvi Singh 0 Reputation points
    2025-08-29T07:14:41.0433333+00:00

    very helpfull, resolved now.

    Thank you so much Jeevan Shanigarap


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.