Skip to content

Commit fb4a16b

Browse files
committed
Fixing bug
1 parent 83fe3f1 commit fb4a16b

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.ServiceManagement/Commands.AnalysisServices.ServiceManagement.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@
9090
<ItemGroup>
9191
<Compile Include="Commands\AddAzureASAccount.cs" />
9292
<Compile Include="Models\AsAzureAccount.cs" />
93-
<Compile Include="Models\AsAzureClientUtility.cs" />
93+
<Compile Include="Models\AsAzureClientSession.cs" />
9494
<Compile Include="Models\ASAzureContext.cs" />
9595
<Compile Include="Models\AsAzureEnvironment.cs" />
9696
<Compile Include="Models\AsAzureProfile.cs" />
97-
<Compile Include="Commands\Restart-AzureAnalysisServer.cs" />
97+
<Compile Include="Commands\Restart-AzureAsInstance.cs" />
9898
<Compile Include="Properties\AssemblyInfo.cs" />
9999
<Compile Include="Properties\Resources.Designer.cs">
100100
<DependentUpon>Resources.resx</DependentUpon>

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.ServiceManagement/Commands/AddAzureASAccount.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ namespace Microsoft.Azure.Commands.AnalysisServices.ServiceManagement
2626
/// <summary>
2727
/// Cmdlet to log into an Analysis Services environment
2828
/// </summary>
29-
[Cmdlet("Add", "AzureASAccount", SupportsShouldProcess=true)]
30-
[Alias("Login-AzureASAccount")]
29+
[Cmdlet("Add", "AzureAsAccount", SupportsShouldProcess=true)]
30+
[Alias("Login-AzureAsAccount")]
3131
[OutputType(typeof(AsAzureProfile))]
3232
public class AddAzureASAccountCommand : AzurePSCmdlet, IModuleAssemblyInitializer
3333
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace Microsoft.Azure.Commands.AnalysisServices.ServiceManagement
2727
/// <summary>
2828
/// Cmdlet to log into an Analysis Services environment
2929
/// </summary>
30-
[Cmdlet("Restart", "AzureAnalysisServer", SupportsShouldProcess=true)]
30+
[Cmdlet("Restart", "AzureAsInstance", SupportsShouldProcess=true)]
3131
[Alias("Restart-AzureAs")]
3232
[OutputType(typeof(AsAzureProfile))]
3333
public class RestartAzureAnalysisServer: AzurePSCmdlet, IModuleAssemblyInitializer
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ public static string GetAadAuthenticatedToken(AsAzureContext asAzureContext, Sec
120120
return result.AccessToken;
121121
}
122122

123+
public static string GetAuthorityUrlForEnvironment(AsAzureEnvironment environment)
124+
{
125+
return environment.Name.Contains("asazure-int") ? AadAuthorityUrlPpe : AadAuthorityUrlProd;
126+
}
127+
123128
public void SetCurrentContext(AsAzureAccount azureAccount, AsAzureEnvironment asEnvironment)
124129
{
125130
_profile.Context = new AsAzureContext(azureAccount, asEnvironment)

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.ServiceManagement/Models/AsAzureProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public override string ToString()
5454
public AsAzureEnvironment CreateEnvironment(string environmentName)
5555
{
5656
var env = new AsAzureEnvironment(environmentName);
57-
env.Endpoints.Add(AsAzureEnvironment.AsRolloutEndpoints.AdAuthorityBaseUrl, AsAzureClientSession.AadAuthorityUrlProd);
57+
env.Endpoints.Add(AsAzureEnvironment.AsRolloutEndpoints.AdAuthorityBaseUrl, AsAzureClientSession.GetAuthorityUrlForEnvironment(env));
5858
env.Endpoints.Add(AsAzureEnvironment.AsRolloutEndpoints.RestartEndpointFormat, AsAzureClientSession.RestartEndpointPathFormat);
5959

6060
return env;

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Test/ScenarioTests/AsTests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ function Test-AnalysisServicesServerRestart
187187
$serverCreated = New-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName -Location $location -Sku 'S1' -Administrators '[email protected],[email protected]'
188188
Assert-True {$serverCreated.ProvisioningState -like "Succeeded"}
189189

190-
Login-AzureASAccount -EnvironmentName $environment
191-
Restart-AzureAnalysisServer -Instance $serverName
190+
Login-AzureAsAccount -EnvironmentName $environment
191+
Restart-AzureAsInstance -Instance $serverName
192192
}
193193
finally
194194
{

0 commit comments

Comments
 (0)