Unable to create a blob in a container in Azure storage account using Shared Access Token

Priyal Sobti 25 Reputation points
2024-08-06T16:56:04.52+00:00

Hi,

Describing in a few steps the issue:

  1. I have a container in storage account and I am trying to upload a blob (create a new blob altogether) in that container via REST API.
  2. I decided to use SAS URL that is available on the left pane of a container where we list the permissions and the allowed protocols etc. Lets say the SAS URL generated looked like (test being the container name): https://<myaccountname>.blob.core.windows.net/test/?sp=racwdli&st=2024-08-06T16:33:48Z&se=2024-08-07T17:00:48Z&spr=https&sv=2022-11-02&sr=c&sig=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  3. Later through some searching I found that two query parameters also need to appended, so the whole URL looks like https://<myaccountname>.blob.core.windows.net/test/?sp=racwdli&st=2024-08-06T16:33:48Z&se=2024-08-06T17:00:48Z&spr=https&sv=2022-11-02&sr=c&sig=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&comp=list&restype=container
  4. Now I am using Postman to PUT a file at this URL using PUT method, however I keep getting the below error:
<Code>UnsupportedHttpVerb</Code>
    <Message>The resource doesn&apos;t support specified Http Verb.

Is there something I am missing or is this method not the right way to go about creating a new blob using REST API?

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,093 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,783 questions
0 comments No comments
{count} votes

Accepted answer
  1. Manu Philip 18,151 Reputation points MVP
    2024-08-06T17:58:34.81+00:00

    Hi,

    Looks like the url to be corrected as below: In your url, the blob name is missing. Add the name like below and try again

    https://<myaccountname>.blob.core.windows.net/test/<filename eg: test.txt>?sp=racwdli&st=2024-08-06T16:33:48Z&se=2024-08-07T17:00:48Z&spr=https&sv=2022-11-02&sr=c&sig=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Hope this helps.


    --please don't forget to upvote and Accept as answer if the reply is helpful--


1 additional answer

Sort by: Most helpful
  1. Nehruji R 7,136 Reputation points Microsoft Vendor
    2024-08-07T12:05:24.64+00:00

    Hello Priyal Sobti,

    Greetings! Welcome to Microsoft Q&A Platform.

    I understand that you are encountering a 405 error with the message "UnsupportedHttpVerb" ,“The resource doesn’t support specified HTTP Verb,” it indicates that the HTTP method you’re using is not allowed for the specific resource.

    Ensure that you are using the correct HTTP verb for the operation. For Azure Blob storage, the supported HTTP verbs are typically PUT (for creating or updating messages) and GET (for retrieving messages) and also check some of the below resources that prove helpful to resolve your issue:

    Make sure your SAS token includes the necessary permissions for uploading a blob. For uploading, you need at least w (write) and c (create) permissions.

    Double-check the URL you’re using. It should be in the format:

    https://<myaccountname>.blob.core.windows.net/test/<blobname>?sp=racwdli&st=2024-08-06t16:33:48z&se=2024-08-07t17:00:48z&spr=https&sv=2022-11-02&sr=c&sig=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    

    Ensure you have the correct headers set in your request, also please check your blob storage “Firewalls and virtual networks”. If Selected networks is checked, please try checking All networks. If you want to enable firewall, then please make sure to whitelist the IP's that need to access your storage account and let us know if it helps.

    Similar thread for reference - https://stackoverflow.com/questions/44247379/unsupportedhttpverb-the-resource-doesnt-support-specified-http-verb-requesti

    Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.    

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


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.