Home > Mobile >  How do I upload a buffer directly to a Azure storage blob in PowerShell?
How do I upload a buffer directly to a Azure storage blob in PowerShell?

Time:06-23

I have a serverless powershell function that creates image data from an algorithm and stores it in a $buffer. I'd like to save this $buffer to a blob container as foobar.png. However, Set-AzStorageBlobContent reads from a file, and all the examples I have found involve saving a temporary file to local disk (which I don't have the ability to do in a serverless environment).

Anyone have an example of the best way to do this?

CodePudding user response:

You can use New-TemporaryFile in Azure functions as there is still technically a disk on the app service.

I posted an example here:

https://stackoverflow.com/a/71558876/12040634

  • Related