Home > database >  is it possible to create blobs in a storage account using powershell?
is it possible to create blobs in a storage account using powershell?

Time:11-10

I see plenty of information on how to move/copy/upload files to blob storage, but I don't see any information on how to create blobs.

Suppose we have : $fileContents:

$fileContents= @"
{
'my data':'lots of stuff'
}
"@

How do we create a blob from $fileContents?

CodePudding user response:

With the existing Azure Blobs PowerShell Cmdlets, only way you can create blobs is by uploading a file using Set-AzStorageBlobContent which is not something you want.

Other option for you would be to create a SAS token with appropriate permission and then use Invoke-RestMethod to invoke Azure Blob Storage REST API. I answered a similar question some time ago that you may find useful: how do you use rest to put a .csv file onto a storage account?.

  • Related