Skip to content

Commit 65fa607

Browse files
committed
Revert "fix"
This reverts commit 131c575.
1 parent 131c575 commit 65fa607

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

src/Extensions/Azure/DurableTaskSchedulerExtensions.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

44
using Azure.Core;
@@ -141,20 +141,18 @@ options.Credential is not null
141141
ChannelCredentials.SecureSsl :
142142
ChannelCredentials.Insecure;
143143
return GrpcChannel.ForAddress(endpoint, new GrpcChannelOptions
144+
{
145+
// The same credential is being used for all operations.
146+
// https://learn.microsoft.com/aspnet/core/grpc/authn-and-authz#set-the-bearer-token-with-callcredentials
147+
Credentials = ChannelCredentials.Create(channelCreds, managedBackendCreds),
144148

145-
return GrpcChannel.ForAddress(endpoint, new GrpcChannelOptions
146-
{
147-
// The same credential is being used for all operations.
148-
// https://learn.microsoft.com/aspnet/core/grpc/authn-and-authz#set-the-bearer-token-with-callcredentials
149-
Credentials = ChannelCredentials.Create(channelCreds, managedBackendCreds),
150-
151-
// TODO: This is not appropriate for use in production settings. Setting this to true should
152-
// only be done for local testing. We should hide this setting behind some kind of flag.
153-
UnsafeUseInsecureChannelCallCredentials = true,
154-
});
149+
// TODO: This is not appropriate for use in production settings. Setting this to true should
150+
// only be done for local testing. We should hide this setting behind some kind of flag.
151+
UnsafeUseInsecureChannelCallCredentials = true,
152+
});
155153
}
156154

157-
static ArgumentException RequiredOptionMissing(string optionName)
155+
static Exception RequiredOptionMissing(string optionName)
158156
{
159157
return new ArgumentException(message: $"Required option '{optionName}' was not provided.");
160158
}
@@ -181,4 +179,4 @@ public async Task<AccessToken> GetTokenAsync(CancellationToken cancellationToken
181179
return this.token.Value;
182180
}
183181
}
184-
}
182+
}

src/Extensions/Azure/DurableTaskSchedulerOptions.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) Microsoft Corporation.
2-
// Licensed under the MIT License.
2+
// Licensed under the MIT License.
33

44
using System.Globalization;
55
using Azure.Core;
@@ -15,9 +15,6 @@ public class DurableTaskSchedulerOptions
1515
/// <summary>
1616
/// Initializes a new instance of the <see cref="DurableTaskSchedulerOptions"/> class.
1717
/// </summary>
18-
/// <param name="endpointAddress">The endpoint address of the Durable Task Scheduler service.</param>
19-
/// <param name="taskHubName">The name of the task hub to connect to.</param>
20-
/// <param name="credential">The credential to use for authentication, or null for no authentication.</param>
2118
internal DurableTaskSchedulerOptions(string endpointAddress, string taskHubName, TokenCredential? credential = null)
2219
{
2320
this.EndpointAddress = endpointAddress ?? throw new ArgumentNullException(nameof(endpointAddress));
@@ -77,6 +74,7 @@ public static DurableTaskSchedulerOptions FromConnectionString(
7774
// "Endpoint=https://myaccount.westus3.durabletask.io/;Authentication=ManagedIdentity;ClientID=00000000-0000-0000-0000-000000000000;TaskHubName=th01"
7875
// "Endpoint=https://myaccount.westus3.durabletask.io/;Authentication=DefaultAzure;TaskHubName=th01"
7976
// "Endpoint=https://myaccount.westus3.durabletask.io/;Authentication=None;TaskHubName=th01" (undocumented and only intended for local testing)
77+
8078
string endpointAddress = connectionString.Endpoint;
8179

8280
if (!endpointAddress.Contains("://"))
@@ -86,6 +84,7 @@ public static DurableTaskSchedulerOptions FromConnectionString(
8684
}
8785

8886
string authType = connectionString.Authentication;
87+
8988
TokenCredential? credential;
9089

9190
// Parse the supported auth types, in a case-insensitive way and without spaces
@@ -160,4 +159,4 @@ public static DurableTaskSchedulerOptions FromConnectionString(
160159
DurableTaskSchedulerOptions options = new(endpointAddress, connectionString.TaskHubName, credential);
161160
return options;
162161
}
163-
}
162+
}

0 commit comments

Comments
 (0)