I'm trying to upload file in Azure blob storage through REST API. Acess level for container is set to - Container(anonymous read access to container and bolb).
Sharing code and response for the reference-
filepath = "/home/meera/Downloads/download.pdf"
account_name = "account_name"
container_name = "container_name"
name = "doc.pdf"
sas_token = "sas_token"
with open(filepath, 'rb') as f:
file_content = f.read()
headers = { "Content-Type": "application/pdf; charset=UTF-8", "x-ms-blob-type": "BlockBlob" }
url = "https://"+ account_name+".blob.core.windows.net/"+container_name+"/"+name+sas_token
response = requests.put(url, headers=headers, data=file_content)
Error: <Response [404]> <Code>ResourceNotFound</Code><Message>The specified resource does not exist.