Update:
When you upload block blobs, you need Write permission.
And this is the doc:
https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas#blob-service
Original Answer:
Please make sure you have give the create permission:
Below is my code(C#), it works fine(I can create even the blob is not exist.):
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Models;
using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp28
{
class Program
{
static void Main(string[] args)
{
string containerName = "test";
string token = "?sv=2019-12-12&ss=bfqt&srt=sco&sp=rwdlacupx&se=2021-01-04T09:41:18Z&st=2021-01-04T01:41:18Z&spr=https&sig=UVhS9bPGqWhjKnlrQIMkWHD6Bdfdpym8vgZoQ6W9qDE%3D";
string sas_uri = "https://0730bowmanwindow.blob.core.windows.net/test?sv=2019-12-12&ss=bfqt&srt=sco&sp=rwdlacupx&se=2021-01-04T09:41:18Z&st=2021-01-04T01:41:18Z&spr=https&sig=UVhS9bPGqWhjKnlrQIMkWHD6Bdfdpym8vgZoQ6W9qDE%3D";
BlobServiceClient blobServiceClient = new BlobServiceClient(new Uri(sas_uri));
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(containerName);
BlobClient blobClient = containerClient.GetBlobClient("20210104.txt");
byte[] byteArray = Encoding.UTF8.GetBytes("This is a test.20210104");
MemoryStream stream = new MemoryStream(byteArray);
blobClient.Upload(stream, true);
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…