英文:
How to make blob specific version as current version using PowerShell or cli
问题
我已启用存储帐户上的版本控制。我想使用PowerShell或CLI将特定的Blob版本设置为当前版本。请查看附加的截图。谢谢。
需要一个PowerShell或CLI脚本。
英文:
I have versioning enabled on storage account. I would like to make specific blob version as a current version using powershell or cli. Please find the attached screenshot herewith.Thanks.
Required a powershell or cli script.
答案1
得分: 0
你想要使用的 PowerShell Cmdlet 是 Copy-AzStorageBlob
。您将要使用的源 Blob URL 将是 Blob 版本的 URL(类似于 https://account.blob.core.windows.net/container/blob?version=<blob-version>
)。您的代码将类似于:
$sourceBlobUri = "Blob URL with version"
Copy-AzStorageBlob -AbsoluteUri $sourceBlobUri -DestContainer "container" -DestBlob "blob"
英文:
The PowerShell Cmdlet you would want to use is Copy-AzStorageBlob
. The source blob URL you would be using would be the one of the blob version (something like https://account.blob.core.windows.net/container/blob?version=<blob-version>
) Your code would be something like:
$sourceBlobUri = "Blob URL with version"
Copy-AzStorageBlob -AbsoluteUri $sourceBlobUri -DestContainer "container" -DestBlob "blob"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论