Skip to content

Commit cdf3a41

Browse files
Update Akka.Hosting extension methods to support DefaultAzureCredential (#237)
* Update Akka.Hosting extension methods to support DefaultAzureCredential (cherry picked from commit b37c9db) * Make setup classes sealed * Fix missing HOCON settings * Revert const back to public Co-authored-by: Aaron Stannard <[email protected]>
1 parent 27e7121 commit cdf3a41

File tree

7 files changed

+423
-86
lines changed

7 files changed

+423
-86
lines changed

src/Akka.Persistence.Azure.Hosting/AzurePersistenceExtensions.cs

Lines changed: 390 additions & 55 deletions
Large diffs are not rendered by default.

src/Akka.Persistence.Azure.Tests/Hosting/AzurePersistenceHostingSanityCheck.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Akka.Event;
66
using Akka.Hosting;
77
using Akka.Persistence.Azure.Hosting;
8+
using Akka.Persistence.Azure.Tests.Helper;
89
using Akka.TestKit.Xunit2.Internals;
910
using FluentAssertions;
1011
using Microsoft.Extensions.DependencyInjection;
@@ -20,6 +21,7 @@ public class AzurePersistenceHostingSanityCheck
2021
public static async Task<IHost> StartHost(Action<AkkaConfigurationBuilder> testSetup)
2122
{
2223
var conn = Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR") ?? "UseDevelopmentStorage=true";
24+
await DbUtils.CleanupCloudTable(conn);
2325
var host = new HostBuilder()
2426
.ConfigureServices(collection =>
2527
{

src/Akka.Persistence.Azure/Journal/AzureTableStorageJournalSettings.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ public AzureTableStorageJournalSettings(
116116
public bool AutoInitialize { get; }
117117

118118
/// <summary>
119-
/// A <see cref="Uri"/> referencing the blob service.
120-
/// This is likely to be similar to "https://{account_name}.table.core.windows.net".
119+
/// A <see cref="Uri"/> referencing the Azure Table Storage service.
120+
/// This is likely to be similar to "https://{account_name}.table.core.windows.net".
121121
/// </summary>
122122
public Uri ServiceUri { get; }
123123

124124
/// <summary>
125-
/// The <see cref="DefaultAzureCredential"/> used to sign API requests.
125+
/// The <see cref="DefaultAzureCredential"/> used to sign API requests.
126126
/// </summary>
127127
public DefaultAzureCredential DefaultAzureCredential { get; }
128128

129129
/// <summary>
130-
/// Optional client options that define the transport pipeline policies for authentication,
131-
/// retries, etc., that are applied to every request.
130+
/// Optional client options that define the transport pipeline policies for authentication,
131+
/// retries, etc., that are applied to every request.
132132
/// </summary>
133133
public TableClientOptions TableClientOptions { get; }
134134

src/Akka.Persistence.Azure/Journal/AzureTableStorageJournalSetup.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Akka.Persistence.Azure.Journal
1313
{
14-
public class AzureTableStorageJournalSetup : Setup
14+
public sealed class AzureTableStorageJournalSetup : Setup
1515
{
1616
/// <summary>
1717
/// The connection string for connecting to Windows Azure table storage.
@@ -51,19 +51,19 @@ public class AzureTableStorageJournalSetup : Setup
5151
public bool? AutoInitialize { get; set; }
5252

5353
/// <summary>
54-
/// A <see cref="Uri"/> referencing the blob service.
55-
/// This is likely to be similar to "https://{account_name}.table.core.windows.net".
54+
/// A <see cref="Uri"/> referencing the Azure Storage Table service.
55+
/// This is likely to be similar to "https://{account_name}.table.core.windows.net".
5656
/// </summary>
5757
public Uri ServiceUri { get; set; }
5858

5959
/// <summary>
60-
/// The <see cref="DefaultAzureCredential"/> used to sign API requests.
60+
/// The <see cref="DefaultAzureCredential"/> used to sign API requests.
6161
/// </summary>
6262
public DefaultAzureCredential DefaultAzureCredential { get; set; }
6363

6464
/// <summary>
65-
/// Optional client options that define the transport pipeline policies for authentication,
66-
/// retries, etc., that are applied to every request.
65+
/// Optional client options that define the transport pipeline policies for authentication,
66+
/// retries, etc., that are applied to every request.
6767
/// </summary>
6868
public TableClientOptions TableClientOptions { get; set; }
6969

src/Akka.Persistence.Azure/Query/AzureTableStorageReadJournalSetup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace Akka.Persistence.Azure.Query
1111
{
12-
public class AzureTableStorageReadJournalSetup: Setup
12+
public sealed class AzureTableStorageReadJournalSetup: Setup
1313
{
1414
/// <summary>
1515
/// How many events to fetch in one query (replay) and keep buffered until they

src/Akka.Persistence.Azure/Snapshot/AzureBlobSnapshotSetup.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@
1313
namespace Akka.Persistence.Azure.Snapshot
1414
{
1515
/// <summary>
16-
/// Setup class for <see cref="AzureBlobSnapshotStore"/>.
17-
/// Any populated properties will override its respective HOCON setting.
16+
/// Setup class for <see cref="AzureBlobSnapshotStore"/>.
17+
/// Any populated properties will override its respective HOCON setting.
1818
/// </summary>
19-
public class AzureBlobSnapshotSetup : Setup
19+
public sealed class AzureBlobSnapshotSetup : Setup
2020
{
2121
/// <summary>
22-
/// Create a new <see cref="AzureBlobSnapshotSetup"/>
22+
/// Create a new <see cref="AzureBlobSnapshotSetup"/>
2323
/// </summary>
2424
/// <param name="serviceUri">
25-
/// A <see cref="Uri"/> referencing the blob service.
26-
/// This is likely to be similar to "https://{account_name}.blob.core.windows.net".
25+
/// A <see cref="Uri"/> referencing the blob service.
26+
/// This is likely to be similar to "https://{account_name}.blob.core.windows.net".
2727
/// </param>
2828
/// <param name="defaultAzureCredential">
29-
/// The <see cref="DefaultAzureCredential"/> used to sign requests.
29+
/// The <see cref="DefaultAzureCredential"/> used to sign requests.
3030
/// </param>
3131
/// <param name="blobClientOptions">
32-
/// Optional client options that define the transport pipeline policies for authentication,
33-
/// retries, etc., that are applied to every request.
32+
/// Optional client options that define the transport pipeline policies for authentication,
33+
/// retries, etc., that are applied to every request.
3434
/// </param>
3535
/// <returns>A new <see cref="AzureBlobSnapshotSetup"/> instance</returns>
3636
public static AzureBlobSnapshotSetup Create(
@@ -87,19 +87,19 @@ public static AzureBlobSnapshotSetup Create(
8787
public PublicAccessType? ContainerPublicAccessType { get; set; }
8888

8989
/// <summary>
90-
/// A <see cref="Uri"/> referencing the blob service.
91-
/// This is likely to be similar to "https://{account_name}.blob.core.windows.net".
90+
/// A <see cref="Uri"/> referencing the blob service.
91+
/// This is likely to be similar to "https://{account_name}.blob.core.windows.net".
9292
/// </summary>
9393
public Uri ServiceUri { get; set; }
9494

9595
/// <summary>
96-
/// The <see cref="DefaultAzureCredential"/> used to sign API requests.
96+
/// The <see cref="DefaultAzureCredential"/> used to sign API requests.
9797
/// </summary>
9898
public DefaultAzureCredential DefaultAzureCredential { get; set; }
9999

100100
/// <summary>
101-
/// Optional client options that define the transport pipeline policies for authentication,
102-
/// retries, etc., that are applied to every request.
101+
/// Optional client options that define the transport pipeline policies for authentication,
102+
/// retries, etc., that are applied to every request.
103103
/// </summary>
104104
public BlobClientOptions BlobClientOptions { get; set; }
105105

src/Akka.Persistence.Azure/Snapshot/AzureBlobSnapshotStoreSettings.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ public AzureBlobSnapshotStoreSettings(
129129
public PublicAccessType ContainerPublicAccessType { get; }
130130

131131
/// <summary>
132-
/// A <see cref="Uri"/> referencing the blob service.
133-
/// This is likely to be similar to "https://{account_name}.blob.core.windows.net".
132+
/// A <see cref="Uri"/> referencing the blob service.
133+
/// This is likely to be similar to "https://{account_name}.blob.core.windows.net".
134134
/// </summary>
135135
public Uri ServiceUri { get; }
136136

137137
/// <summary>
138-
/// The <see cref="DefaultAzureCredential"/> used to sign API requests.
138+
/// The <see cref="DefaultAzureCredential"/> used to sign API requests.
139139
/// </summary>
140140
public DefaultAzureCredential DefaultAzureCredential { get; }
141141

142142
/// <summary>
143-
/// Optional client options that define the transport pipeline policies for authentication,
144-
/// retries, etc., that are applied to every request.
143+
/// Optional client options that define the transport pipeline policies for authentication,
144+
/// retries, etc., that are applied to every request.
145145
/// </summary>
146146
public BlobClientOptions BlobClientOptions { get; }
147147

0 commit comments

Comments
 (0)