diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs index 16395130b57b6..d7eccdafdffbb 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/src/ShareFilesStorageResourceProvider.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Storage.Files.Shares; +using Azure.Storage.Files.Shares.Models; namespace Azure.Storage.DataMovement.Files.Shares { @@ -300,7 +301,10 @@ public StorageResource FromDirectory(Uri directoryUri, ShareFileStorageResourceO { CredentialType.None => new ShareDirectoryClient(directoryUri), CredentialType.SharedKey => new ShareDirectoryClient(directoryUri, _getStorageSharedKeyCredential(directoryUri, false)), - CredentialType.Token => new ShareDirectoryClient(directoryUri, _getTokenCredential(directoryUri, false)), + CredentialType.Token => new ShareDirectoryClient( + directoryUri, + _getTokenCredential(directoryUri, false), + new ShareClientOptions { ShareTokenIntent = ShareTokenIntent.Backup }), CredentialType.Sas => new ShareDirectoryClient(directoryUri, _getAzureSasCredential(directoryUri, false)), _ => throw BadCredentialTypeException(_credentialType), }; @@ -327,7 +331,10 @@ public StorageResource FromFile( { CredentialType.None => new ShareFileClient(fileUri), CredentialType.SharedKey => new ShareFileClient(fileUri, _getStorageSharedKeyCredential(fileUri, false)), - CredentialType.Token => new ShareFileClient(fileUri, _getTokenCredential(fileUri, false)), + CredentialType.Token => new ShareFileClient( + fileUri, + _getTokenCredential(fileUri, false), + new ShareClientOptions { ShareTokenIntent = ShareTokenIntent.Backup }), CredentialType.Sas => new ShareFileClient(fileUri, _getAzureSasCredential(fileUri, false)), _ => throw BadCredentialTypeException(_credentialType), };