-
Notifications
You must be signed in to change notification settings - Fork 5k
[Azure.Monitor.Query] Add sovereign/government cloud support #41653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
540c10b
wip
nisha-bhatia e0e7912
Update CHANGELOG.md
nisha-bhatia 7283102
wip
nisha-bhatia 0648455
Update MetricsQueryClientLiveTests.cs
nisha-bhatia 27449b8
Update CHANGELOG.md
nisha-bhatia a8a02ca
wip
nisha-bhatia 2a6be30
wip
nisha-bhatia 6777da0
Update LogsTestData.cs
nisha-bhatia 68a76f2
Update test-resources.bicep
nisha-bhatia 1c6e426
Merge remote-tracking branch 'upstream/main' into nibhati-audience
nisha-bhatia b6c8324
Update service.proj
nisha-bhatia f2a69b2
wip
nisha-bhatia 98870b8
merge
nisha-bhatia d0e99d2
Update service.proj
nisha-bhatia 574ad7e
Update tests.yml
nisha-bhatia 4b25b36
wip
nisha-bhatia e40a2b2
Update Azure.Monitor.Query.netstandard2.0.cs
nisha-bhatia bd87678
Update MonitorQueryTestEnvironment.cs
nisha-bhatia f80fef8
wip
nisha-bhatia b1cbbe7
wip
nisha-bhatia 76aa314
Merge remote-tracking branch 'upstream/main' into nibhati-audience
nisha-bhatia a32aa81
wip
nisha-bhatia 72a612b
Update test-resources.bicep
nisha-bhatia 838c0ae
Merge remote-tracking branch 'upstream/main' into nibhati-audience
nisha-bhatia 5c174a4
wip
nisha-bhatia 484fe2c
wip
nisha-bhatia ebfe771
wip
nisha-bhatia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
59 changes: 59 additions & 0 deletions
59
sdk/monitor/Azure.Monitor.Query/src/Models/LogsQueryAudience.cs
This file contains hidden or 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.Query | ||
{ | ||
/// <summary> Cloud audiences available for Query. </summary> | ||
public readonly partial struct LogsQueryAudience : IEquatable<LogsQueryAudience> | ||
{ | ||
private readonly string _value; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="LogsQueryAudience"/> object. | ||
/// </summary> | ||
/// <param name="value">The Microsoft Entra 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/en-us/azure/azure-government/documentation-government-manage-oms" />.</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 LogsQueryAudience(string value) | ||
{ | ||
Argument.AssertNotNullOrEmpty(value, nameof(value)); | ||
_value = value; | ||
} | ||
|
||
private const string AzureChinaValue = "https://api.loganalytics.azure.cn"; | ||
private const string AzureGovernmentValue = "https://api.loganalytics.us"; | ||
private const string AzurePublicCloudValue = "https://api.loganalytics.io"; | ||
|
||
/// <summary> Azure China. </summary> | ||
public static LogsQueryAudience AzureChina { get; } = new LogsQueryAudience(AzureChinaValue); | ||
|
||
/// <summary> Azure US Government. </summary> | ||
public static LogsQueryAudience AzureGovernment { get; } = new LogsQueryAudience(AzureGovernmentValue); | ||
|
||
/// <summary> Azure Public Cloud. </summary> | ||
public static LogsQueryAudience AzurePublicCloud { get; } = new LogsQueryAudience(AzurePublicCloudValue); | ||
|
||
/// <summary> Determines if two <see cref="LogsQueryAudience"/> values are the same. </summary> | ||
public static bool operator ==(LogsQueryAudience left, LogsQueryAudience right) => left.Equals(right); | ||
/// <summary> Determines if two <see cref="LogsQueryAudience"/> values are not the same. </summary> | ||
public static bool operator !=(LogsQueryAudience left, LogsQueryAudience right) => !left.Equals(right); | ||
/// <summary> Converts a string to a <see cref="LogsQueryAudience"/>. </summary> | ||
public static implicit operator LogsQueryAudience(string value) => new LogsQueryAudience(value); | ||
|
||
/// <inheritdoc /> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public override bool Equals(object obj) => obj is LogsQueryAudience other && Equals(other); | ||
/// <inheritdoc /> | ||
public bool Equals(LogsQueryAudience 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; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.