Skip to content

Add Azure Files identity authentication parity with Azure Blob Storage#143

Merged
robinrodricks merged 6 commits into
robinrodricks:developfrom
gumbarros:develop
Jul 6, 2026
Merged

Add Azure Files identity authentication parity with Azure Blob Storage#143
robinrodricks merged 6 commits into
robinrodricks:developfrom
gumbarros:develop

Conversation

@gumbarros

Copy link
Copy Markdown
Contributor

Fixes

Issue #142
Issue #110

Description

This PR adds Azure Files auth support using Azure.Identity.

  • Shared Key
  • Azure AD / Service Principal
  • Managed Identity
  • TokenCredential

Comment on lines +276 to +280
private static async Task<Stream> CopyToSeekableStreamAsync(Stream stream, CancellationToken cancellationToken) {
var memoryStream = new MemoryStream();
await stream.CopyToAsync(memoryStream, 81920, cancellationToken).ConfigureAwait(false);
memoryStream.Position = 0;
return memoryStream;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this sounds like a code smell, but only happens at non-seekable streams

@gumbarros

Copy link
Copy Markdown
Contributor Author

My recomendation is also release a v7 preview because of the runtime breaking changes at the blob props.

@gumbarros

gumbarros commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@robinrodricks I also created FluentStorage.Files.Identity to prevent code duplication, but because are just two files (AzureCloudEndpoints and AzureCloudEnvironment) (now I added AzureStorageIdentity.cs and made the lib worth, but, if you want I copy paste they on both FluentStorage.Azure.Files and FluentStorage.Azure.Blobs

@gumbarros

gumbarros commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Also, FluentStorage.Azure.Queues and FluentStorage.Azure.KeyVault can benefit from this, but they are not my use case. But if you want to approve this PR, I can also make them use the same auth flow.

Comment thread README.md

## What's New

In 2026, we added:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice touch, thanks!

@@ -0,0 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

complicated but ok.

</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\FluentStorage.Azure.Identity\FluentStorage.Azure.Identity.csproj" />

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont like this but i understand its needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, me neither, but I really need this parity and there is no other way to re-use the source between Blob and Files

@robinrodricks

Copy link
Copy Markdown
Owner

@robinrodricks I also created FluentStorage.Files.Identity to prevent code duplication, but because are just two files (AzureCloudEndpoints and AzureCloudEnvironment) (now I added AzureStorageIdentity.cs and made the lib worth, but, if you want I copy paste they on both FluentStorage.Azure.Files and FluentStorage.Azure.Blobs

lets make a new package FluntStorage.Azure which can have top level reusable stuff.

@robinrodricks

robinrodricks commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Received with MANY THANKS!

Overall, FANTASTIC JOB! a long awaited feature is finally here and I'm excited to release it.

Yes, I will accept it, please introduce the features for as well FluentStorage.Azure.Queues and FluentStorage.Azure.KeyVault. It would be greatly appreciated. These 2 libs have gotten only 20k downloads so far, so if you wanna skip it I'm fine with it.

@robinrodricks robinrodricks merged commit 6a556a3 into robinrodricks:develop Jul 6, 2026
1 check passed
@robinrodricks

Copy link
Copy Markdown
Owner

I'm going to make some changes, before you proceed further pls pull my main branch and then continue your work.

@robinrodricks

Copy link
Copy Markdown
Owner

Please suggest improvements to https://github.com/robinrodricks/FluentStorage/wiki/Azure-Blob-Storage#file-shares needed to document the new API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants