Muistiinpano
Tälle sivulle pääsy edellyttää valtuutusta. Voit yrittää kirjautua sisään tai vaihtaa hakemistoja.
Tälle sivulle pääsy edellyttää valtuutusta. Voit yrittää vaihtaa hakemistoja.
To convert blobs, copy them to a new location by using PowerShell, Azure CLI, or AzCopy. You'll use command parameters to ensure that the destination blob is a block blob. All metadata from the source blob is copied to the destination blob.
Convert append and page blobs
Open a Windows PowerShell command window.
Sign in to your Azure subscription with the Connect-AzAccount command and follow the on-screen directions.
Connect-AzAccountIf your identity is associated with more than one subscription, then set your active subscription to subscription of the storage account which contains the append or page blobs.
$context = Get-AzSubscription -SubscriptionId '<subscription-id>' Set-AzContext $contextReplace the
<subscription-id>placeholder value with the ID of your subscription.Create the storage account context by using the New-AzStorageContext command. Include the
-UseConnectedAccountparameter so that data operations will be performed using your Microsoft Entra credentials.$ctx = New-AzStorageContext -StorageAccountName '<storage account name>' -UseConnectedAccountUse the Copy-AzStorageBlob command and set the
-DestBlobTypeparameter toBlock.$containerName = '<source container name>' $srcblobName = '<source append or page blob name>' $destcontainerName = '<destination container name>' $destblobName = '<destination block blob name>' $destTier = '<destination block blob tier>' Copy-AzStorageBlob -SrcContainer $containerName -SrcBlob $srcblobName -Context $ctx -DestContainer $destcontainerName -DestBlob $destblobName -DestContext $ctx -DestBlobType Block -StandardBlobTier $destTierTo copy a page blob snapshot to block blob, use the Get-AzStorageBlob and Copy-AzStorageBlob command with
-DestBlobTypeparameter asBlock.$containerName = '<source container name>' $srcPageBlobName = '<source page blob name>' $srcPageBlobSnapshotTime = '<snapshot time of source page blob>' $destContainerName = '<destination container name>' $destBlobName = '<destination block blob name>' $destTier = '<destination block blob tier>' Get-AzStorageBlob -Container $containerName -Blob $srcPageBlobName -SnapshotTime $srcPageBlobSnapshotTime -Context $ctx | Copy-AzStorageBlob -DestContainer $destContainerName -DestBlob $destBlobName -DestBlobType block -StandardBlobTier $destTier -DestContext $ctxTip
The
-StandardBlobTierparameter is optional. If you omit that parameter, then the destination blob infers its tier from the default account access tier setting. To change the tier after you've created a block blob, see Change a blob's tier.