[英]Upload File (.txt .csv …) to Azure blob [using PowerShell]
Pretty new to Azure... and I have a task to upload a file to a blob using PowerShell. Azure 的新手......我有一个任务是使用 PowerShell 将文件上传到 blob。
All the information I got are:我得到的所有信息是:
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.我已经连接到我的帐户并获得了tenantID,但订阅为空(我认为默认情况下我会拥有它,因为客户应该将我添加到那里或类似的东西)导致无法列出所有存储帐户。
any hints, helps, leads?任何提示,帮助,线索? or if someone have a better idea or already faced the same situation或者如果有人有更好的想法或已经面临同样的情况
Thank you all in advance谢谢大家
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://docs.microsoft.com/en-us/powershell/module/az.storage/Set-AzStorageBlobContent?view=azps-2.8.0 .您可以在此处找到更多使用 PowerShell 上传 Blob 的示例: https://docs.microsoft.com/en-us/powershell/module/az.storage/Set-AzStorageBlobContent?view=azps-2.8.0 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.