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.
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?versionid=<blob-version>
) Your code would be something like:
$sourceBlobUri = "Blob URL with version"
Copy-AzStorageBlob -AbsoluteUri $sourceBlobUri -DestContainer "container" -DestBlob "blob"