-
Notifications
You must be signed in to change notification settings - Fork 321
/
AzureStorageQueuesSettings.cs
67 lines (59 loc) · 2.22 KB
/
AzureStorageQueuesSettings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Aspire.Azure.Common;
using Azure.Core;
namespace Aspire.Azure.Storage.Queues;
/// <summary>
/// Provides the client configuration settings for connecting to Azure Storage Queues.
/// </summary>
public sealed class AzureStorageQueuesSettings : IConnectionStringSettings
{
/// <summary>
/// Gets or sets the connection string used to connect to the blob service.
/// </summary>
/// <remarks>
/// If <see cref="ConnectionString"/> is set, it overrides <see cref="ServiceUri"/> and <see cref="Credential"/>.
/// </remarks>
public string? ConnectionString { get; set; }
/// <summary>
/// A <see cref="Uri"/> referencing the queue service.
/// This is likely to be similar to "https://{account_name}.queue.core.windows.net".
/// </summary>
/// <remarks>
/// Must not contain shared access signature.
/// Used along with <see cref="Credential"/> to establish the connection.
/// </remarks>
public Uri? ServiceUri { get; set; }
/// <summary>
/// Gets or sets the credential used to authenticate to the Queues Storage.
/// </summary>
public TokenCredential? Credential { get; set; }
/// <summary>
/// Gets or sets a boolean value that indicates whether the Queues Storage health check is disabled or not.
/// </summary>
/// <value>
/// The default value is <see langword="false"/>.
/// </value>
public bool DisableHealthChecks { get; set; }
/// <summary>
/// Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is disabled or not.
/// </summary>
/// <value>
/// The default value is <see langword="false"/>.
/// </value>
public bool DisableTracing { get; set; }
void IConnectionStringSettings.ParseConnectionString(string? connectionString)
{
if (!string.IsNullOrEmpty(connectionString))
{
if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
{
ServiceUri = uri;
}
else
{
ConnectionString = connectionString;
}
}
}
}