Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Start-AzStorageBlobCopy

Starts to copy a blob.

Syntax

ContainerName (Default)

Start-AzStorageBlobCopy
 [-SrcBlob] <String>
 -SrcContainer <String>
 -DestContainer <String>
 [-DestBlob <String>]
 [-PremiumPageBlobTier <PremiumPageBlobTier>]
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-TagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

BlobInstance

Start-AzStorageBlobCopy
 -CloudBlob <CloudBlob>
 -DestContainer <String>
 [-BlobBaseClient <BlobBaseClient>]
 [-DestBlob <String>]
 [-PremiumPageBlobTier <PremiumPageBlobTier>]
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-TagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

BlobInstanceToBlobInstance

Start-AzStorageBlobCopy
 -CloudBlob <CloudBlob>
 -DestCloudBlob <CloudBlob>
 [-BlobBaseClient <BlobBaseClient>]
 [-PremiumPageBlobTier <PremiumPageBlobTier>]
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-TagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

ContainerInstance

Start-AzStorageBlobCopy
 [-SrcBlob] <String>
 -CloudBlobContainer <CloudBlobContainer>
 -DestContainer <String>
 [-DestBlob <String>]
 [-PremiumPageBlobTier <PremiumPageBlobTier>]
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-TagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

ShareName

Start-AzStorageBlobCopy
 -SrcShareName <String>
 -SrcFilePath <String>
 -DestContainer <String>
 [-DestBlob <String>]
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

ShareInstance

Start-AzStorageBlobCopy
 -SrcShare <CloudFileShare>
 -SrcFilePath <String>
 -DestContainer <String>
 [-DestBlob <String>]
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

DirInstance

Start-AzStorageBlobCopy
 -SrcDir <CloudFileDirectory>
 -SrcFilePath <String>
 -DestContainer <String>
 [-DestBlob <String>]
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

FileInstance

Start-AzStorageBlobCopy
 -SrcFile <CloudFile>
 -DestContainer <String>
 [-DestBlob <String>]
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

FileInstanceToBlobInstance

Start-AzStorageBlobCopy
 -SrcFile <CloudFile>
 -DestCloudBlob <CloudBlob>
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

UriPipeline

Start-AzStorageBlobCopy
 -AbsoluteUri <String>
 -DestContainer <String>
 -DestBlob <String>
 [-StandardBlobTier <String>]
 [-RehydratePriority <RehydratePriority>]
 [-Tag <Hashtable>]
 [-Context <IStorageContext>]
 [-DestContext <IStorageContext>]
 [-DestTagCondition <String>]
 [-TagCondition <String>]
 [-Force]
 [-ServerTimeoutPerRequest <Int32>]
 [-ClientTimeoutPerRequest <Int32>]
 [-DefaultProfile <IAzureContextContainer>]
 [-ConcurrentTaskCount <Int32>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

Description

The Start-AzStorageBlobCopy cmdlet starts to copy a blob.

Examples

Example 1: Copy a named blob

Start-AzStorageBlobCopy -SrcBlob "ContosoPlanning2015" -DestContainer "ContosoArchives" -SrcContainer "ContosoUploads"

This command starts the copy operation of the blob named ContosoPlanning2015 from the container named ContosoUploads to the container named ContosoArchives.

Example 2: Get a container to specify blobs to copy

Get-AzStorageContainer -Name "ContosoUploads" | Start-AzStorageBlobCopy -SrcBlob "ContosoPlanning2015" -DestContainer "ContosoArchives"

This command gets the container named ContosoUploads, by using the Get-AzStorageContainer cmdlet, and then passes the container to the current cmdlet by using the pipeline operator. That cmdlet starts the copy operation of the blob named ContosoPlanning2015. The previous cmdlet provides the source container. The DestContainer parameter specifies ContosoArchives as the destination container.

Example 3: Get all blobs in a container and copy them

Get-AzStorageBlob -Container "ContosoUploads" | Start-AzStorageBlobCopy -DestContainer "ContosoArchives"

This command gets the blobs in the container named ContosoUploads, by using the Get-AzStorageBlob cmdlet, and then passes the results to the current cmdlet by using the pipeline operator. That cmdlet starts the copy operation of the blobs to the container named ContosoArchives.

Example 4: Copy a blob specified as an object

$SrcBlob = Get-AzStorageBlob -Container "ContosoUploads" -Blob "ContosoPlanning2015"
$DestBlob = Get-AzStorageBlob -Container "ContosoArchives" -Blob "ContosoPlanning2015Archived"
Start-AzStorageBlobCopy -ICloudBlob $SrcBlob.ICloudBlob -DestICloudBlob $DestBlob.ICloudBlob

The first command gets the blob named ContosoPlanning2015 in the container named ContosoUploads. The command stores that object in the $SrcBlob variable. The second command gets the blob named ContosoPlanning2015Archived in the container named ContosoArchives. The command stores that object in the $DestBlob variable. The last command starts the copy operation from the source container to the destination container. The command uses standard dot notation to specify the ICloudBlob objects for the $SrcBlob and $DestBlob blobs.

Example 5: Copy a blob from a URI

$Context = New-AzStorageContext -StorageAccountName "ContosoGeneral" -StorageAccountKey "< Storage Key for ContosoGeneral ends with == >"
Start-AzStorageBlobCopy -AbsoluteUri "http://www.contosointernal.com/planning" -DestContainer "ContosoArchive" -DestBlob "ContosoPlanning2015" -DestContext $Context

This command creates a context for the account named ContosoGeneral that uses the specified key, and then stores that key in the $Context variable. The second command copies the file from the specified URI to the blob named ContosoPlanning in the container named ContosoArchive. The command starts the copy operation to the destination context stored in $Context. There are no source storage context, so the source Uri must have access to the source object. E.g: if the source is a none public Azure blob, the Uri should contain SAS token which has read access to the blob.

Example 6: Copy a block blob to destination container with a new blob name, and set destination blob StandardBlobTier as Hot, RehydratePriority as High

Start-AzStorageBlobCopy -SrcContainer "ContosoUploads" -SrcBlob "BlockBlobName" -DestContainer "ContosoArchives" -DestBlob "NewBlockBlobName" -StandardBlobTier Hot -RehydratePriority High

This command starts the copy operation of a block blob to destination container with a new blob name, and set destination blob StandardBlobTier as Hot, RehydratePriority as High

Parameters

-AbsoluteUri

Specifies the absolute URI of a file to copy to an Azure Storage blob.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SrcUri, SourceUri

Parameter sets

-BlobBaseClient

BlobBaseClient Object

Parameter properties

Type:BlobBaseClient
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ClientTimeoutPerRequest

Specifies the client-side time-out interval, in seconds, for one service request. If the previous call fails in the specified interval, this cmdlet retries the request. If this cmdlet does not receive a successful response before the interval elapses, this cmdlet returns an error.

Parameter properties

Type:

Nullable<T>[Int32]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:ClientTimeoutPerRequestInSeconds

Parameter sets

-CloudBlob

Specifies a CloudBlob object from Azure Storage Client library. To obtain a CloudBlob object, use the Get-AzStorageBlob cmdlet.

Parameter properties

Type:Microsoft.Azure.Storage.Blob.CloudBlob
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SrcICloudBlob, SrcCloudBlob, ICloudBlob, SourceICloudBlob, SourceCloudBlob

Parameter sets

-CloudBlobContainer

Specifies a CloudBlobContainer object from the Azure Storage Client library. This cmdlet copies a blob from the container that this parameter specifies. To obtain a CloudBlobContainer object, use the Get-AzStorageContainer cmdlet.

Parameter properties

Type:Microsoft.Azure.Storage.Blob.CloudBlobContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SourceCloudBlobContainer

Parameter sets

-ConcurrentTaskCount

Specifies the maximum concurrent network calls. You can use this parameter to limit the concurrency to throttle local CPU and bandwidth usage by specifying the maximum number of concurrent network calls. The specified value is an absolute count and is not multiplied by the core count. This parameter can help reduce network connection problems in low bandwidth environments, such as 100 kilobits per second. The default value is 10.

Parameter properties

Type:

Nullable<T>[Int32]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-Context

Specifies an Azure storage context. To obtain a storage context, use the New-AzStorageContext cmdlet.

Parameter properties

Type:IStorageContext
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SrcContext, SourceContext

Parameter sets

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRmContext, AzureCredential

Parameter sets

-DestBlob

Specifies the name of the destination blob.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DestinationBlob

Parameter sets

-DestCloudBlob

Specifies a destination CloudBlob object

Parameter properties

Type:Microsoft.Azure.Storage.Blob.CloudBlob
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DestICloudBlob, DestinationCloudBlob, DestinationICloudBlob

Parameter sets

-DestContainer

Specifies the name of the destination container.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DestinationContainer

Parameter sets

-DestContext

Specifies an Azure storage context. To obtain a storage context, use the New-AzStorageContext cmdlet.

Parameter properties

Type:IStorageContext
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DestinationContext

Parameter sets

-DestTagCondition

Optional Tag expression statement to check match condition on the destination Blob. The blob request will fail when the destination blob tags does not match the given expression. See details in https://learn.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations#tags-conditional-operations.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Force

Indicates that this cmdlet overwrites the destination blob without prompting you for confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-PremiumPageBlobTier

Premium Page Blob Tier

Parameter properties

Type:Microsoft.Azure.Storage.Blob.PremiumPageBlobTier
Default value:None
Accepted values:Unknown, P4, P6, P10, P20, P30, P40, P50, P60, P70, P80
Supports wildcards:False
DontShow:False

Parameter sets

-RehydratePriority

Block Blob RehydratePriority. Indicates the priority with which to rehydrate an archived blob. Valid values are High/Standard.

Parameter properties

Type:Microsoft.Azure.Storage.Blob.RehydratePriority
Default value:None
Accepted values:Standard, High
Supports wildcards:False
DontShow:False

Parameter sets

-ServerTimeoutPerRequest

Specifies the service side time-out interval, in seconds, for a request. If the specified interval elapses before the service processes the request, the storage service returns an error.

Parameter properties

Type:

Nullable<T>[Int32]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:ServerTimeoutPerRequestInSeconds

Parameter sets

-SrcBlob

Specifies the name of the source blob.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SourceBlob

Parameter sets

-SrcContainer

Specifies the name of the source container.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SourceContainer

Parameter sets

-SrcDir

Specifies a CloudFileDirectory object from Azure Storage Client library.

Parameter properties

Type:Microsoft.Azure.Storage.File.CloudFileDirectory
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SourceDir

Parameter sets

-SrcFile

Specifies a CloudFile object from Azure Storage Client library. You can create it or use Get-AzStorageFile cmdlet.

Parameter properties

Type:Microsoft.Azure.Storage.File.CloudFile
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SourceFile

Parameter sets

-SrcFilePath

Specifies the source file relative path of source directory or source share.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SourceFilePath

Parameter sets

-SrcShare

Specifies a CloudFileShare object from Azure Storage Client library. You can create it or use Get-AzStorageShare cmdlet.

Parameter properties

Type:Microsoft.Azure.Storage.File.CloudFileShare
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SourceShare

Parameter sets

-SrcShareName

Specifies the source share name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SourceShareName

Parameter sets

-StandardBlobTier

Block Blob Tier, valid values are Hot/Cool/Archive/Cold. See detail in https://learn.microsoft.com/azure/storage/blobs/storage-blob-storage-tiers

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Tag

Blob Tags

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-TagCondition

Optional Tag expression statement to check match condition on the source blob. The blob request will fail when the source blob tags does not match the given expression. See details in https://learn.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations#tags-conditional-operations.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.Azure.Storage.Blob.CloudBlob

Microsoft.Azure.Storage.Blob.CloudBlobContainer

Microsoft.Azure.Storage.File.CloudFile

String

IStorageContext

Outputs

AzureStorageBlob

Related Links


Feedback

Was this page helpful?