Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage] [DataMovement] Using Entra ID with Share File will set the ShareFileIntent for FromDirectory and FromFile #47010

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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