Skip to content

Commit

Permalink
Merge pull request #52 from Azure/analysis
Browse files Browse the repository at this point in the history
Add analysis services endpoint suffix to environment
  • Loading branch information
markcowl authored Sep 13, 2018
2 parents 5a97580 + 04ce4e7 commit c584435
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Authentication.Abstractions/AzureEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ static IDictionary<string, AzureEnvironment> InitializeBuiltInEnvironments()
};
azureCloud.SetProperty(ExtendedEndpoint.OperationalInsightsEndpoint, AzureEnvironmentConstants.AzureOperationalInsightsEndpoint);
azureCloud.SetProperty(ExtendedEndpoint.OperationalInsightsEndpointResourceId, AzureEnvironmentConstants.AzureOperationalInsightsEndpointResourceId);
azureCloud.SetProperty(ExtendedEndpoint.AnalysisServicesEndpointSuffix, AzureEnvironmentConstants.AzureAnalysisServicesEndpointSuffix);
var azureChina = new AzureEnvironment
{
Name = EnvironmentName.AzureChinaCloud,
Expand All @@ -76,6 +77,8 @@ static IDictionary<string, AzureEnvironment> InitializeBuiltInEnvironments()
BatchEndpointResourceId = AzureEnvironmentConstants.ChinaBatchEndpointResourceId,
AdTenant = "Common"
};
azureChina.SetProperty(ExtendedEndpoint.AnalysisServicesEndpointSuffix, AzureEnvironmentConstants.ChinaAnalysisServicesEndpointSuffix);

var azureUSGovernment = new AzureEnvironment
{
Name = EnvironmentName.AzureUSGovernment,
Expand All @@ -101,6 +104,7 @@ static IDictionary<string, AzureEnvironment> InitializeBuiltInEnvironments()
};
azureUSGovernment.SetProperty(ExtendedEndpoint.OperationalInsightsEndpoint, AzureEnvironmentConstants.USGovernmentOperationalInsightsEndpoint);
azureUSGovernment.SetProperty(ExtendedEndpoint.OperationalInsightsEndpointResourceId, AzureEnvironmentConstants.USGovernmentOperationalInsightsEndpointResourceId);
azureUSGovernment.SetProperty(ExtendedEndpoint.AnalysisServicesEndpointSuffix, AzureEnvironmentConstants.USGovernmentAnalysisServicesEndpointSuffix);
var azureGermany = new AzureEnvironment
{
Name = EnvironmentName.AzureGermanCloud,
Expand All @@ -124,6 +128,7 @@ static IDictionary<string, AzureEnvironment> InitializeBuiltInEnvironments()
BatchEndpointResourceId = AzureEnvironmentConstants.GermanBatchEndpointResourceId,
AdTenant = "Common"
};
azureGermany.SetProperty(ExtendedEndpoint.AnalysisServicesEndpointSuffix, AzureEnvironmentConstants.GermanAnalysisServicesEndpointSuffix);
var result = new ConcurrentDictionary<string, AzureEnvironment>(StringComparer.InvariantCultureIgnoreCase);

result[EnvironmentName.AzureCloud] = azureCloud;
Expand Down Expand Up @@ -296,7 +301,8 @@ public static class Endpoint
public static class ExtendedEndpoint
{
public const string OperationalInsightsEndpointResourceId = "OperationalInsightsEndpointResourceId",
OperationalInsightsEndpoint = "OperationalInsightsEndpoint";
OperationalInsightsEndpoint = "OperationalInsightsEndpoint",
AnalysisServicesEndpointSuffix = "AzureAnalysisServicesEndpointSuffix";
}
}
}
11 changes: 11 additions & 0 deletions src/Authentication.Abstractions/AzureEnvironmentConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,20 @@ public static class AzureEnvironmentConstants
/// </summary>
public const string AzureDataLakeServiceEndpointResourceId = "https://datalake.azure.net";

/// <summary>
/// The token audience for Batch data plane requests
/// </summary>
public const string BatchEndpointResourceId = "https://batch.core.windows.net/";
public const string ChinaBatchEndpointResourceId = "https://batch.chinacloudapi.cn/";
public const string USGovernmentBatchEndpointResourceId = "https://batch.core.usgovcloudapi.net/";
public const string GermanBatchEndpointResourceId = "https://batch.cloudapi.de/";

/// <summary>
/// The domain name suffix for Azure Analysis Services
/// </summary>
public const string AzureAnalysisServicesEndpointSuffix = "asazure.windows.net";
public const string ChinaAnalysisServicesEndpointSuffix = "asazure.chinacloudapi.cn";
public const string USGovernmentAnalysisServicesEndpointSuffix = "asazure.usgovcloudapi.net";
public const string GermanAnalysisServicesEndpointSuffix = "asazure.cloudapi.de";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ public static void SetEndpoint(this IAzureEnvironment environment, string endpoi
case AzureEnvironment.ExtendedEndpoint.OperationalInsightsEndpoint:
environment.SetProperty(AzureEnvironment.ExtendedEndpoint.OperationalInsightsEndpoint, propertyValue);
break;
case AzureEnvironment.ExtendedEndpoint.AnalysisServicesEndpointSuffix:
environment.SetProperty(AzureEnvironment.ExtendedEndpoint.AnalysisServicesEndpointSuffix, propertyValue);
break;

}
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/Authentication.ResourceManager/Models/PSAzureEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,21 @@ public string AzureOperationalInsightsEndpoint
}
}

/// <summary>
/// The domain name suffix for Azure Analysis Services
/// </summary>
public string AzureAnalysisServicesEndpointSuffix
{
get
{
return this.GetEndpointSuffix(AzureEnvironment.ExtendedEndpoint.AnalysisServicesEndpointSuffix);
}
set
{
this.SetEndpoint(AzureEnvironment.ExtendedEndpoint.AnalysisServicesEndpointSuffix, value);
}
}

public IList<string> VersionProfiles { get; } = new List<string>();

public IDictionary<string, string> ExtendedProperties { get; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
Expand Down

0 comments on commit c584435

Please sign in to comment.