Performing simple BLOB Storage REST API operations using CURL

Published May 04 2022 10:21 PM 816 Views
Microsoft

The blog points to perform simple storage REST API operations such as Get, Put, List and Delete using CURL utility.

 

Let’s look at some of the CURL command syntax to perform REST API operations and will be making use of SAS as the auth scheme.  We need to take care of the pointers below while performing the operations via CURL:

 

  • Ensure the URL is formed correctly as per the operation you are trying to perform.
  • The mandatory header needs to be passed and can be done using “-H” parameter.
  • Ensure you are appending/removing extra ‘?’ to the SAS token in the URLs accordingly.
  • Http verb can be GET, PUT or DELETE as provided by the CURL specifications.

List Blobs

List Blobs (REST API) - Azure Storage | Microsoft Docs

 

Syntax:

curl -I -X <HTTP Verb> -H "x-ms-version: 2019-12-12" “https://storageAccountName.blob.core.windows.net/containerName?restype=container&comp=list&SASToken

 

In the below snippet, the operation is being performed over a container named testcontainer11. There is just one single blob present in the container, and it is listed as below:

Amrinder_Singh_0-1651678550828.png

Put Blob

Put Blob (REST API) - Azure Storage | Microsoft Docs

 

Syntax:

curl -i -X <HTTP Verb> -H "x-ms-version: 2019-12-12" -H "x-ms-date: <Date and Time in GMT format>" -H "x-ms-blob-type: Blob Type" -H "Content-Length: <Length of the blob>" -d "Blob data/content" “https://storageAccountName.blob.core.windows.net/containerName/blobname?SASToken

 

In the below snippet example, a Put operation was performed over the container named testcontainer11 and the blob name is myblob3. The blob type was passed as block blob along with the content of the blob and its length. The blob was created successfully.

 

Amrinder_Singh_2-1651678625144.png

You could further validate using Azure Portal or Azure Storage explorer as per your feasibility.

Amrinder_Singh_3-1651678657612.png

The above example was inclined towards the Block Blob however we can also perform the same over the append blobs as well. Below is how we need to perform the same:

 

We first need to call the Put Blob operation only with blob type as Append Blob and with Content-Length header as 0

curl -i -X <HTTP Verb> -H "x-ms-version: 2019-12-12" -H "x-ms-date: <Date and Time in GMT format>" -H "x-ms-blob-type: AppendBlob" -H "Content-Length: 0"  “https://storageAccountName.blob.core.windows.net/containerName/blobname?SASToken

 

Amrinder_Singh_4-1651678703106.png

Amrinder_Singh_6-1651678715453.png

We then call the Append Block API to write to the blob

Append Block (REST API) - Azure Storage | Microsoft Docs

 

curl -i -X <HTTP Verb> -H "x-ms-version: 2019-12-12" -H "x-ms-date: <Date and Time in GMT format>" -H "Content-Length: Content Length in Bytes" -d "Content of the blob"  "https://storageAccountName.blob.core.windows.net/containerName/blobname?comp=appendblock&SASToken"

Amrinder_Singh_7-1651678735504.png

Amrinder_Singh_9-1651678748001.png

At this point, below were the content of the file:

Amrinder_Singh_10-1651678772660.png

We again called the Append Block API to append to the above blob further as well.

Amrinder_Singh_11-1651678791092.png

You will notice a change in the file size

Amrinder_Singh_12-1651678806616.png

We could see updated content as well:

Amrinder_Singh_13-1651678813275.png

 

Get Blob

Get Blob (REST API) - Azure Storage | Microsoft Docs

 

Syntax:

curl -i -X <HTTP Verb> -H "x-ms-version: 2019-12-12" "https://storageAccountName.blob.core.windows.net/containername/blobname?SASToken"

 

In the below example, we tried performing the GetBlob operation on the same blob name myblob3 present in the container named testcontainer11 that we created as part of above Put Operation

Amrinder_Singh_14-1651678832414.png

 

Delete Blob

Delete Blob (REST API) - Azure Storage | Microsoft Docs

 

Syntax:

curl -i -X <HTTP Verb> -H "x-ms-version: 2019-12-12" “https://storageAccountName.blob.core.windows.net/containername/blobname?SASToken

 

In the below example snippet, we deleted the blob named myblob3 from the container named testcontainer11

Amrinder_Singh_15-1651678832422.png

 

Amrinder_Singh_16-1651678832432.png

 

Copy Blob

Copy Blob (REST API) - Azure Storage | Microsoft Docs

 

Syntax:

curl --request <http Verb> "<Destination URL>" --header "x-ms-date: <Date and Time in GMT format>" " --header "x-ms-version: 2019-12-12" --header "x-ms-copy-source: <SOURCE URL>" --header "Content-length: 0"

 

In the below example snippet, we copied the blob named Appointment_confirmation.jpg from the container named testcontainer10 present in the source storage account to a blob named abc.jpg present in destination container named testcontainer present in the destination storage account

Amrinder_Singh_17-1651678832439.png

Hope this helps!

 

%3CLINGO-SUB%20id%3D%22lingo-sub-3302552%22%20slang%3D%22en-US%22%3EPerforming%20simple%20BLOB%20Storage%20REST%20API%20operations%20using%20CURL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3302552%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20blog%20points%20to%20perform%20simple%20storage%20REST%20API%20operations%20such%20as%20Get%2C%20Put%2C%20List%20and%20Delete%20using%20CURL%20utility.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20look%20at%20some%20of%20the%20CURL%20command%20syntax%20to%20perform%20REST%20API%20operations%20and%20will%20be%20making%20use%20of%20SAS%20as%20the%20auth%20scheme.%26nbsp%3B%20We%20need%20to%20take%20care%20of%20the%20pointers%20below%20while%20performing%20the%20operations%20via%20CURL%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EEnsure%20the%20URL%20is%20formed%20correctly%20as%20per%20the%20operation%20you%20are%20trying%20to%20perform.%3C%2FLI%3E%0A%3CLI%3EThe%20mandatory%20header%20needs%20to%20be%20passed%20and%20can%20be%20done%20using%20%E2%80%9C-H%E2%80%9D%20parameter.%3C%2FLI%3E%0A%3CLI%3EEnsure%20you%20are%20appending%2Fremoving%20extra%20%E2%80%98%3F%E2%80%99%20to%20the%20SAS%20token%20in%20the%20URLs%20accordingly.%3C%2FLI%3E%0A%3CLI%3EHttp%20verb%20can%20be%20GET%2C%20PUT%20or%20DELETE%20as%20provided%20by%20the%20CURL%20specifications.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSTRONG%3EList%20Blobs%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Flist-blobs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EList%20Blobs%20(REST%20API)%20-%20Azure%20Storage%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESyntax%3C%2FSTRONG%3E%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Ecurl%20-I%20-X%20%3CHTTP%20verb%3D%22%22%3E%20-H%20%22x-ms-version%3A%202019-12-12%22%20%E2%80%9C%3CA%20href%3D%22https%3A%2F%2Fstorageaccountname.blob.core.windows.net%2FcontainerName%3Frestype%3Dcontainer%26amp%3Bcomp%3Dlist%26amp%3BSASToken%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2FstorageAccountName.blob.core.windows.net%2FcontainerName%3Frestype%3Dcontainer%26amp%3Bcomp%3Dlist%26amp%3BSASToken%3C%2FA%3E%E2%80%9D%3C%2FHTTP%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20below%20snippet%2C%20the%20operation%20is%20being%20performed%20over%20a%20container%20named%20%3CSTRONG%3E%3CEM%3Etestcontainer11%3C%2FEM%3E%3C%2FSTRONG%3E%3CEM%3E.%20%3C%2FEM%3EThere%20is%20just%20one%20single%20blob%20present%20in%20the%20container%2C%20and%20it%20is%20listed%20as%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_0-1651678550828.png%22%20style%3D%22width%3A%20635px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369177i65F4C659EF90F8F4%2Fimage-dimensions%2F635x288%3Fv%3Dv2%22%20width%3D%22635%22%20height%3D%22288%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_0-1651678550828.png%22%20alt%3D%22Amrinder_Singh_0-1651678550828.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EPut%20Blob%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Fput-blob%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPut%20Blob%20(REST%20API)%20-%20Azure%20Storage%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESyntax%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Ecurl%20-i%20-X%20%3CHTTP%20verb%3D%22%22%3E%20-H%20%22x-ms-version%3A%202019-12-12%22%20-H%20%22x-ms-date%3A%20%3CDATE%20and%3D%22%22%20time%3D%22%22%20in%3D%22%22%20gmt%3D%22%22%20format%3D%22%22%3E%22%20-H%20%22x-ms-blob-type%3A%20Blob%20Type%22%20-H%20%22Content-Length%3A%20%3CLENGTH%20of%3D%22%22%20the%3D%22%22%20blob%3D%22%22%3E%22%20-d%20%22Blob%20data%2Fcontent%22%20%E2%80%9C%3CA%20href%3D%22https%3A%2F%2Fstorageaccountname.blob.core.windows.net%2FcontainerName%2Fblobname%3FSASToken%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2FstorageAccountName.blob.core.windows.net%2FcontainerName%2Fblobname%3FSASToken%3C%2FA%3E%E2%80%9D%3C%2FLENGTH%3E%3C%2FDATE%3E%3C%2FHTTP%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20below%20snippet%20example%2C%20a%20Put%20operation%20was%20performed%20over%20the%20container%20named%20%3CSTRONG%3E%3CEM%3Etestcontainer11%3C%2FEM%3E%3C%2FSTRONG%3E%20and%20the%20blob%20name%20is%20%3CSTRONG%3E%3CEM%3Emyblob3.%3C%2FEM%3E%3C%2FSTRONG%3E%20The%20blob%20type%20was%20passed%20as%20block%20blob%20along%20with%20the%20content%20of%20the%20blob%20and%20its%20length.%20The%20blob%20was%20created%20successfully.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_2-1651678625144.png%22%20style%3D%22width%3A%20619px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369179iDC02F6C94C813E98%2Fimage-dimensions%2F619x197%3Fv%3Dv2%22%20width%3D%22619%22%20height%3D%22197%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_2-1651678625144.png%22%20alt%3D%22Amrinder_Singh_2-1651678625144.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20could%20further%20validate%20using%20Azure%20Portal%20or%20Azure%20Storage%20explorer%20as%20per%20your%20feasibility.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_3-1651678657612.png%22%20style%3D%22width%3A%20607px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369180i0E1222AAB09B6438%2Fimage-dimensions%2F607x153%3Fv%3Dv2%22%20width%3D%22607%22%20height%3D%22153%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_3-1651678657612.png%22%20alt%3D%22Amrinder_Singh_3-1651678657612.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20above%20example%20was%20inclined%20towards%20the%20Block%20Blob%20however%20we%20can%20also%20perform%20the%20same%20over%20the%20append%20blobs%20as%20well.%20Below%20is%20how%20we%20need%20to%20perform%20the%20same%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20first%20need%20to%20call%20the%20Put%20Blob%20operation%20only%20with%20blob%20type%20as%20Append%20Blob%20and%20with%20Content-Length%20header%20as%200%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Ecurl%20-i%20-X%20%3CHTTP%20verb%3D%22%22%3E%20-H%20%22x-ms-version%3A%202019-12-12%22%20-H%20%22x-ms-date%3A%20%3CDATE%20and%3D%22%22%20time%3D%22%22%20in%3D%22%22%20gmt%3D%22%22%20format%3D%22%22%3E%22%20-H%20%22x-ms-blob-type%3A%20AppendBlob%22%20-H%20%22Content-Length%3A%200%22%26nbsp%3B%20%E2%80%9C%3CA%20href%3D%22https%3A%2F%2Fstorageaccountname.blob.core.windows.net%2FcontainerName%2Fblobname%3FSASToken%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2FstorageAccountName.blob.core.windows.net%2FcontainerName%2Fblobname%3FSASToken%3C%2FA%3E%E2%80%9D%3C%2FDATE%3E%3C%2FHTTP%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_4-1651678703106.png%22%20style%3D%22width%3A%20600px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369181i5AC6CD19E4CDC2F6%2Fimage-dimensions%2F600x111%3Fv%3Dv2%22%20width%3D%22600%22%20height%3D%22111%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_4-1651678703106.png%22%20alt%3D%22Amrinder_Singh_4-1651678703106.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_6-1651678715453.png%22%20style%3D%22width%3A%20582px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369184iFEA38A7D2BD28BD2%2Fimage-dimensions%2F582x21%3Fv%3Dv2%22%20width%3D%22582%22%20height%3D%2221%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_6-1651678715453.png%22%20alt%3D%22Amrinder_Singh_6-1651678715453.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWe%20then%20call%20the%20Append%20Block%20API%20to%20write%20to%20the%20blob%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Fappend-block%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAppend%20Block%20(REST%20API)%20-%20Azure%20Storage%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Ecurl%20-i%20-X%20%3CHTTP%20verb%3D%22%22%3E%20-H%20%22x-ms-version%3A%202019-12-12%22%20-H%20%22x-ms-date%3A%20%3CDATE%20and%3D%22%22%20time%3D%22%22%20in%3D%22%22%20gmt%3D%22%22%20format%3D%22%22%3E%22%20-H%20%22Content-Length%3A%20Content%20Length%20in%20Bytes%22%20-d%20%22Content%20of%20the%20blob%22%26nbsp%3B%20%22%3CA%20href%3D%22https%3A%2F%2FstorageAccountName.blob.core.windows.net%2FcontainerName%2Fblobname%3Fcomp%3Dappendblock%26amp%3BSASToken%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2FstorageAccountName.blob.core.windows.net%2FcontainerName%2Fblobname%3Fcomp%3Dappendblock%26amp%3BSASToken%3C%2FA%3E%22%3C%2FDATE%3E%3C%2FHTTP%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_7-1651678735504.png%22%20style%3D%22width%3A%20627px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369186iAF89B13850887CF8%2Fimage-dimensions%2F627x126%3Fv%3Dv2%22%20width%3D%22627%22%20height%3D%22126%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_7-1651678735504.png%22%20alt%3D%22Amrinder_Singh_7-1651678735504.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_9-1651678748001.png%22%20style%3D%22width%3A%20622px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369188iA8E9B78DE3671F3E%2Fimage-dimensions%2F622x28%3Fv%3Dv2%22%20width%3D%22622%22%20height%3D%2228%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_9-1651678748001.png%22%20alt%3D%22Amrinder_Singh_9-1651678748001.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAt%20this%20point%2C%20below%20were%20the%20content%20of%20the%20file%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_10-1651678772660.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369189i8468E6B8CFF99DA0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_10-1651678772660.png%22%20alt%3D%22Amrinder_Singh_10-1651678772660.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWe%20again%20called%20the%20Append%20Block%20API%20to%20append%20to%20the%20above%20blob%20further%20as%20well.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_11-1651678791092.png%22%20style%3D%22width%3A%20660px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369190iAF35BD359189F521%2Fimage-dimensions%2F660x134%3Fv%3Dv2%22%20width%3D%22660%22%20height%3D%22134%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_11-1651678791092.png%22%20alt%3D%22Amrinder_Singh_11-1651678791092.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20will%20notice%20a%20change%20in%20the%20file%20size%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_12-1651678806616.png%22%20style%3D%22width%3A%20659px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369191i60249A55FAE7ECD4%2Fimage-dimensions%2F659x28%3Fv%3Dv2%22%20width%3D%22659%22%20height%3D%2228%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_12-1651678806616.png%22%20alt%3D%22Amrinder_Singh_12-1651678806616.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWe%20could%20see%20updated%20content%20as%20well%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_13-1651678813275.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369192i593E30A9ADCD74E1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_13-1651678813275.png%22%20alt%3D%22Amrinder_Singh_13-1651678813275.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EGet%20Blob%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Fget-blob%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGet%20Blob%20(REST%20API)%20-%20Azure%20Storage%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESyntax%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Ecurl%20-i%20-X%20%3CHTTP%20verb%3D%22%22%3E%20-H%20%22x-ms-version%3A%202019-12-12%22%20%22%3CA%20href%3D%22https%3A%2F%2FstorageAccountName.blob.core.windows.net%2Fcontainername%2Fblobname%3FSASToken%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2FstorageAccountName.blob.core.windows.net%2Fcontainername%2Fblobname%3FSASToken%3C%2FA%3E%22%3C%2FHTTP%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20below%20example%2C%20we%20tried%20performing%20the%20GetBlob%20operation%20on%20the%20same%20blob%20name%20%3CSTRONG%3Emyblob3%3C%2FSTRONG%3E%20present%20in%20the%20container%20named%20%3CSTRONG%3Etestcontainer11%3C%2FSTRONG%3E%20that%20we%20created%20as%20part%20of%20above%20Put%20Operation%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_14-1651678832414.png%22%20style%3D%22width%3A%20677px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369194iEB5F53606D973BB2%2Fimage-dimensions%2F677x312%3Fv%3Dv2%22%20width%3D%22677%22%20height%3D%22312%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_14-1651678832414.png%22%20alt%3D%22Amrinder_Singh_14-1651678832414.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EDelete%20Blob%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Fdelete-blob%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDelete%20Blob%20(REST%20API)%20-%20Azure%20Storage%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESyntax%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Ecurl%20-i%20-X%20%3CHTTP%20verb%3D%22%22%3E%20-H%20%22x-ms-version%3A%202019-12-12%22%20%E2%80%9C%3CA%20href%3D%22https%3A%2F%2Fstorageaccountname.blob.core.windows.net%2Fcontainername%2Fblobname%3FSASToken%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2FstorageAccountName.blob.core.windows.net%2Fcontainername%2Fblobname%3FSASToken%3C%2FA%3E%E2%80%9D%3C%2FHTTP%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20below%20example%20snippet%2C%20we%20deleted%20the%20blob%20named%20%3CSTRONG%3Emyblob3%3C%2FSTRONG%3E%20from%20the%20container%20named%20%3CSTRONG%3Etestcontainer11%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_15-1651678832422.png%22%20style%3D%22width%3A%20673px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369196i47E984524BD0FAEE%2Fimage-dimensions%2F673x170%3Fv%3Dv2%22%20width%3D%22673%22%20height%3D%22170%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_15-1651678832422.png%22%20alt%3D%22Amrinder_Singh_15-1651678832422.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_16-1651678832432.png%22%20style%3D%22width%3A%20667px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369195iB598B4005E7E2B78%2Fimage-dimensions%2F667x185%3Fv%3Dv2%22%20width%3D%22667%22%20height%3D%22185%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_16-1651678832432.png%22%20alt%3D%22Amrinder_Singh_16-1651678832432.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ECopy%20Blob%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fstorageservices%2Fcopy-blob%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECopy%20Blob%20(REST%20API)%20-%20Azure%20Storage%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESyntax%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3Ecurl%20--request%20%3CHTTP%20verb%3D%22%22%3E%20%22%3CDESTINATION%20url%3D%22%22%3E%22%20--header%20%22x-ms-date%3A%20%3CDATE%20and%3D%22%22%20time%3D%22%22%20in%3D%22%22%20gmt%3D%22%22%20format%3D%22%22%3E%22%20%22%20--header%20%22x-ms-version%3A%202019-12-12%22%20--header%20%22x-ms-copy-source%3A%20%3CSOURCE%20url%3D%22%22%3E%22%20--header%20%22Content-length%3A%200%22%3C%2FSOURCE%3E%3C%2FDATE%3E%3C%2FDESTINATION%3E%3C%2FHTTP%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20below%20example%20snippet%2C%20we%20copied%20the%20blob%20named%20%3CSTRONG%3EAppointment_confirmation.jpg%20%3C%2FSTRONG%3Efrom%20the%20container%20named%20%3CSTRONG%3Etestcontainer10%20%3C%2FSTRONG%3Epresent%20in%20the%20source%20storage%20account%20to%20a%20blob%20named%3CSTRONG%3E%20abc.jpg%20%3C%2FSTRONG%3Epresent%20in%20destination%20container%20named%3CSTRONG%3E%20testcontainer%20%3C%2FSTRONG%3Epresent%20in%20the%20destination%20storage%20account%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_17-1651678832439.png%22%20style%3D%22width%3A%20700px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369197i59934DAFEA3B5904%2Fimage-dimensions%2F700x84%3Fv%3Dv2%22%20width%3D%22700%22%20height%3D%2284%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_17-1651678832439.png%22%20alt%3D%22Amrinder_Singh_17-1651678832439.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EHope%20this%20helps!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3302552%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Amrinder_Singh_0-1651679536383.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F369199i9C5C2593B6FE6D9F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Amrinder_Singh_0-1651679536383.png%22%20alt%3D%22Amrinder_Singh_0-1651679536383.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Co-Authors
Version history
Last update:
‎May 04 2022 08:53 AM
Updated by: