0

Pretty new to Azure... and I have a task to upload a file to a blob using PowerShell.

All the information I got are :

  1. A blob url : https://blabla.blob.core.windows.net/whatever
  2. Blob EndPoint : https://.........
  3. and a SAS token : ?sv=2018-03-28&s.......

I've already connected to my account and got the tenantID but an empty subscription (I thought that I'll have it by default, as the client should add me in there or something like that) which leads to not being able to list the all the storage accounts.

any hints, helps, leads ? or if someone have a better idea or already faced the same situation

Thank you all in advance

1 Answer 1

1

Please try something like below:

$ctx = New-AzStorageContext -StorageAccountName "<account-name>" -SasToken "<sas-token>"
Set-AzStorageBlobContent -File "<full-file-path>" -Container "<container-name>" -Context $ctx

You can find more examples of uploading blobs using PowerShell here: https://learn.microsoft.com/en-us/powershell/module/az.storage/Set-AzStorageBlobContent?view=azps-2.8.0.

Sign up to request clarification or add additional context in comments.

3 Comments

it looks like it's working but when I specify the file path it takes ages to load even thought the file is only 8kb or even empty ? do you maybe have any suggestions or maybe is it something that I forgot to do ?
That's weird. I just uploaded a file and it was pretty fast. Can you please update your question and include the code you're using?
You right I missed some inputs from other programs :) , Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.