Skip to content

Commit

Permalink
[Storage] [DataMovement] Using Entra ID with Share File will set the …
Browse files Browse the repository at this point in the history
…ShareFileIntent for FromDirectory and FromFile (#47010)

* On default using Entra ID with Share File will set the ShareFileIntent header

* Extra whitespace
  • Loading branch information
amnguye authored Nov 7, 2024
1 parent 36abf5f commit b9342e8
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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),
};
Expand All @@ -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),
};
Expand Down

0 comments on commit b9342e8

Please sign in to comment.