Skip to content

adding prop and condition for OperationalInsightsEndpointResourceId #414

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 8 commits into from
May 9, 2024
13 changes: 13 additions & 0 deletions src/Authentication.Abstractions/AzureEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ private static AzureEnvironment MapArmToAzureEnvironment(ArmMetadata armMetadata
}
}

if (!string.IsNullOrEmpty(armMetadata.LogAnalyticsResourceId))
{
string api_version = "v1";
var logAnalyticsEndpoint = armMetadata.LogAnalyticsResourceId + '/' + api_version;
azureEnvironment.SetProperty(ExtendedEndpoint.OperationalInsightsEndpointResourceId, armMetadata.LogAnalyticsResourceId);
azureEnvironment.SetProperty(ExtendedEndpoint.OperationalInsightsEndpoint, logAnalyticsEndpoint);
}

//ManagedHsmServiceEndpointSuffix currently uses Built-in endpoint.
//In new ArmMedata, ManagedHsmServiceEndpointSuffix is provided as so 'MhsmDns'.
//But it doesn't' make sense to just refresh ManagedHsmServiceEndpointSuffix from ARM without AzureManagedHsmServiceEndpointResourceId.
Expand Down Expand Up @@ -459,6 +467,11 @@ public AzureEnvironment(IAzureEnvironment other)
/// </summary>
public string ContainerRegistryEndpointSuffix { get; set; }

/// <summary>
/// The token audience required for communicating with the Log Analytics service in this enviornment
/// </summary>
public string OperationalInsightsEndpointResourceId { get; set; }

/// <summary>
/// The set of Azure Version Profiles supported in this environment
/// </summary>
Expand Down