Skip to content

Azure Analysis Services: added new sku and scale up/down support #4013

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 5 commits into from
May 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/ResourceManager/AnalysisServices/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
-->
## Current Release

* New SKUs added: B1, B2, S0
* Scale up/down support added

## Version 0.3.0

## Version 0.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Management.Analysis, Version=1.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Analysis.1.0.2-preview\lib\net45\Microsoft.Azure.Management.Analysis.dll</HintPath>
<Private>True</Private>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Analysis.1.1.2\lib\net452\Microsoft.Azure.Management.Analysis.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Authorization">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
Expand Down Expand Up @@ -224,6 +224,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.AnalysisServices.Test.ScenarioTests.AsTests\TestNegativeAnalysisServicesServer.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.AnalysisServices.Test.ScenarioTests.AsTests\TestAnalysisServicesServerScaleUpDown.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public void TestAddAzureASAccountCommand()
expectedProfile.Context.TokenCache = Encoding.ASCII.GetBytes(testToken);

// Setup
// Clear the the current profile
AsAzureClientSession.Instance.Profile.Environments.Clear();

var mockAuthenticationProvider = new Mock<IAsAzureAuthenticationProvider>();
mockAuthenticationProvider.Setup(
authProvider => authProvider.GetAadAuthenticatedToken(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,21 @@ public AsTests(Xunit.Abstractions.ITestOutputHelper output)
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAnalysisServicesServer()
{
NewInstance.RunPsTest(string.Format("Test-AnalysisServicesServer -location '{0}'", AsTestsBase.resourceGroupLocation));
NewInstance.RunPsTest("Test-AnalysisServicesServer");
}


[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAnalysisServicesServerScaleUpDown()
{
NewInstance.RunPsTest("Test-AnalysisServicesServerScaleUpDown");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestNegativeAnalysisServicesServer()
{
NewInstance.RunPsTest(string.Format("Test-NegativeAnalysisServicesServer -location '{0}'", AsTestsBase.resourceGroupLocation));
NewInstance.RunPsTest("Test-NegativeAnalysisServicesServer");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ Tests Analysis Services server lifecycle (Create, Update, Get, List, Delete).
#>
function Test-AnalysisServicesServer
{
param
(
$location = "West US"
)

try
{
# Creating server
$location = Get-Location
$resourceGroupName = Get-ResourceGroupName
$serverName = Get-AnalysisServicesServerName
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
Expand Down Expand Up @@ -123,23 +119,76 @@ function Test-AnalysisServicesServer
}
}

<#
.SYNOPSIS
Tests scale up and down of Analysis Services server (B1 -> S2 -> S1).
#>
function Test-AnalysisServicesServerScaleUpDown
{
try
{
# Creating server
$location = Get-Location
$resourceGroupName = Get-ResourceGroupName
$serverName = Get-AnalysisServicesServerName
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location

$serverCreated = New-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName -Location $location -Sku 'B1' -Administrator '[email protected],[email protected]'

Assert-AreEqual $serverName $serverCreated.Name
Assert-AreEqual $location $serverCreated.Location
Assert-AreEqual "Microsoft.AnalysisServices/servers" $serverCreated.Type
Assert-AreEqual B1 $serverCreated.Sku.Name
Assert-True {$serverCreated.Id -like "*$resourceGroupName*"}
Assert-True {$serverCreated.ServerFullName -ne $null -and $serverCreated.ServerFullName.Contains("$serverName")}

# Check server was created successfully
[array]$serverGet = Get-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName
$serverGetItem = $serverGet[0]

Assert-True {$serverGetItem.ProvisioningState -like "Succeeded"}
Assert-True {$serverGetItem.State -like "Succeeded"}

Assert-AreEqual $serverName $serverGetItem.Name
Assert-AreEqual $location $serverGetItem.Location
Assert-AreEqual B1 $serverGetItem.Sku.Name
Assert-AreEqual "Microsoft.AnalysisServices/servers" $serverGetItem.Type
Assert-True {$serverGetItem.Id -like "*$resourceGroupName*"}

# Scale up B1 -> S2
$serverUpdated = Set-AzureRmAnalysisServicesServer -Name $serverName -Sku S2 -PassThru
Assert-AreEqual S2 $serverUpdated.Sku.Name

# Scale down S2 -> S1
$serverUpdated = Set-AzureRmAnalysisServicesServer -Name $serverName -Sku S1 -PassThru
Assert-AreEqual S1 $serverUpdated.Sku.Name

# Delete Analysis Servicesserver
Remove-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName -PassThru
}
finally
{
# cleanup the resource group that was used in case it still exists. This is a best effort task, we ignore failures here.
Invoke-HandledCmdlet -Command {Remove-AzureRmAnalysisServicesServer -ResourceGroupName $resourceGroupName -Name $serverName -ErrorAction SilentlyContinue} -IgnoreFailures
Invoke-HandledCmdlet -Command {Remove-AzureRmResourceGroup -Name $resourceGroupName -ErrorAction SilentlyContinue} -IgnoreFailures
}
}

<#
.SYNOPSIS
Tests Analysis Services server lifecycle Failure scenarios (Create, Update, Get, Delete).
#>
function Test-NegativeAnalysisServicesServer
{

param
(
$location = "West US",
$fakeserverName = "psfakeservertest"
)

try
{
# Creating Account
$location = Get-Location
$resourceGroupName = Get-ResourceGroupName
$serverName = Get-AnalysisServicesServerName
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
Expand Down Expand Up @@ -188,12 +237,12 @@ function Test-AnalysisServicesServerRestart
{
param
(
$rolloutEnvironment = $env.ASAZURE_TEST_ROLLOUT,
$location = "West US"
$rolloutEnvironment = $env.ASAZURE_TEST_ROLLOUT
)
try
{
# Creating server
$location = Get-Location
$resourceGroupName = Get-ResourceGroupName
$serverName = Get-AnalysisServicesServerName
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class AsTestsBase : RMTestBase
private LegacyTest.CSMTestEnvironmentFactory csmTestFactory;
private EnvironmentSetupHelper helper;
private const string AuthorizationApiVersion = "2014-07-01-preview";
internal const string resourceGroupLocation = "West US";

public ResourceManagementClient ResourceManagementClient { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ function Get-ResourceGroupName
return getAssetName
}

<#
.SYNOPSIS
Gets a location for testing.
#>
function Get-Location
{
# TODO: should be implemented via Get-AzureRmResourceProvider
return "West US"
}

<#
.SYNOPSIS
Executes a cmdlet and enables ignoring of errors if desired
Expand Down
Loading