-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Azure.Monitor.Ingestion] Fix Sovereign Support for Ingestion (#39078)
- Loading branch information
1 parent
4916207
commit 5fa15a4
Showing
11 changed files
with
175 additions
and
18 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
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
18 changes: 0 additions & 18 deletions
18
sdk/monitor/Azure.Monitor.Ingestion/src/Generated/LogsIngestionClient.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
sdk/monitor/Azure.Monitor.Ingestion/src/LogsIngestionAudience.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,59 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.ComponentModel; | ||
using Azure.Core; | ||
|
||
namespace Azure.Monitor.Ingestion | ||
{ | ||
/// <summary> Cloud audiences available for Ingestion. </summary> | ||
public readonly partial struct LogsIngestionAudience : IEquatable<LogsIngestionAudience> | ||
{ | ||
private readonly string _value; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="LogsIngestionAudience"/> object. | ||
/// </summary> | ||
/// <param name="value">The Azure Active Directory audience to use when forming authorization scopes. For the language service, this value corresponds to a URL that identifies the Azure cloud where the resource is located. For more information: <see href="https://learn.microsoft.com/azure/azure-government/documentation-government-cognitiveservices" />.</param> | ||
/// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> | ||
/// <remarks>Use one of the constant members over creating a custom value, unless you have special needs for doing so.</remarks> | ||
public LogsIngestionAudience(string value) | ||
{ | ||
Argument.AssertNotNullOrEmpty(value, nameof(value)); | ||
_value = value; | ||
} | ||
|
||
private const string AzureChinaValue = "https://monitor.azure.cn//.default"; | ||
private const string AzureGovernmentValue = "https://monitor.azure.us//.default"; | ||
private const string AzurePublicCloudValue = "https://monitor.azure.com//.default"; | ||
|
||
/// <summary> Azure China. </summary> | ||
public static LogsIngestionAudience AzureChina { get; } = new LogsIngestionAudience(AzureChinaValue); | ||
|
||
/// <summary> Azure Government. </summary> | ||
public static LogsIngestionAudience AzureGovernment { get; } = new LogsIngestionAudience(AzureGovernmentValue); | ||
|
||
/// <summary> Azure Public Cloud. </summary> | ||
public static LogsIngestionAudience AzurePublicCloud { get; } = new LogsIngestionAudience(AzurePublicCloudValue); | ||
|
||
/// <summary> Determines if two <see cref="LogsIngestionAudience"/> values are the same. </summary> | ||
public static bool operator ==(LogsIngestionAudience left, LogsIngestionAudience right) => left.Equals(right); | ||
/// <summary> Determines if two <see cref="LogsIngestionAudience"/> values are not the same. </summary> | ||
public static bool operator !=(LogsIngestionAudience left, LogsIngestionAudience right) => !left.Equals(right); | ||
/// <summary> Converts a string to a <see cref="LogsIngestionAudience"/>. </summary> | ||
public static implicit operator LogsIngestionAudience(string value) => new LogsIngestionAudience(value); | ||
|
||
/// <inheritdoc /> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public override bool Equals(object obj) => obj is LogsIngestionAudience other && Equals(other); | ||
/// <inheritdoc /> | ||
public bool Equals(LogsIngestionAudience other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); | ||
|
||
/// <inheritdoc /> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public override int GetHashCode() => _value?.GetHashCode() ?? 0; | ||
/// <inheritdoc /> | ||
public override string ToString() => _value; | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
sdk/monitor/Azure.Monitor.Ingestion/src/LogsIngestionClientOptions.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,18 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Azure.Core; | ||
|
||
namespace Azure.Monitor.Ingestion | ||
{ | ||
/// <summary> Client options for <see cref="LogsIngestionClient"/>. </summary> | ||
public partial class LogsIngestionClientOptions : ClientOptions | ||
{ | ||
/// <summary> | ||
/// Gets or sets the audience to use for authentication with Azure Active Directory (AAD). The audience is not considered when using a shared key. | ||
/// </summary> | ||
/// <value>If <c>null</c>, <see cref="LogsIngestionAudience.AzurePublicCloud" /> will be assumed.</value> | ||
public LogsIngestionAudience? Audience { get; set; } | ||
} | ||
} |
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
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