-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DefaultAzureIdentity support (#155)
* Add DefaultAzureIdentity support for blob snapshot * Add documentation.
- Loading branch information
Showing
4 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/Akka.Persistence.Azure/Snapshot/AzureBlobSnapshotSetup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Akka.Actor.Setup; | ||
using Azure.Identity; | ||
using Azure.Storage.Blobs; | ||
|
||
namespace Akka.Persistence.Azure.Snapshot | ||
{ | ||
public class AzureBlobSnapshotSetup : Setup | ||
{ | ||
/// <summary> | ||
/// Create a new <see cref="AzureBlobSnapshotSetup"/> | ||
/// </summary> | ||
/// <param name="serviceUri"> | ||
/// A <see cref="Uri"/> referencing the blob service. | ||
/// This is likely to be similar to "https://{account_name}.blob.core.windows.net". | ||
/// </param> | ||
/// <param name="defaultAzureCredential"> | ||
/// The <see cref="DefaultAzureCredential"/> used to sign requests. | ||
/// </param> | ||
/// <param name="blobClientOptions"> | ||
/// Optional client options that define the transport pipeline policies for authentication, | ||
/// retries, etc., that are applied to every request. | ||
/// </param> | ||
/// <returns>A new <see cref="AzureBlobSnapshotSetup"/> instance</returns> | ||
public static AzureBlobSnapshotSetup Create( | ||
Uri serviceUri, | ||
DefaultAzureCredential defaultAzureCredential, | ||
BlobClientOptions blobClientOptions = default) | ||
=> new AzureBlobSnapshotSetup(serviceUri, defaultAzureCredential, blobClientOptions); | ||
|
||
private AzureBlobSnapshotSetup( | ||
Uri serviceUri, | ||
DefaultAzureCredential azureCredential, | ||
BlobClientOptions blobClientOptions) | ||
{ | ||
ServiceUri = serviceUri; | ||
DefaultAzureCredential = azureCredential; | ||
BlobClientOptions = blobClientOptions; | ||
} | ||
|
||
public Uri ServiceUri { get; } | ||
|
||
public DefaultAzureCredential DefaultAzureCredential { get; } | ||
|
||
public BlobClientOptions BlobClientOptions { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters