I am able to generate the SAS token for single file using this code in C#
BlobClient blobClient = this.container.GetBlobClient(blobPath);
BlobSasBuilder sasBuilder = new BlobSasBuilder()
{
BlobName = blobClient.Name,
BlobContainerName = this.container.Name,
Resource = "c", // b for blob, c for container
StartsOn = DateTimeOffset.UtcNow,
ExpiresOn = DateTimeOffset.UtcNow.AddHours(this.sasTokenExpiryHours),
};
sasBuilder.SetPermissions(BlobSasPermissions.Write);
Uri sasUri = blobClient.GenerateSasUri(sasBuilder);
return sasUri.AbsoluteUri;
Using the token generated, I simply send a PUT request with binary body. It works fine for single file.
Is there any way I can generate the SAS token for container and upload multiple files using the container SAS token before the token expires?
Following @GauravMantri's suggestion,
This gives the SAS token
[http://{the URL}/{theSASToken}]
and simply needed to update the URL ashttp://{the URL}/file1?{theSASToken}