0

PowerShell (Automation Runbook) を使用して Azure Analysis Services をアップスケールおよびダウンスケールしたいのですが、Tier (Sku) の変更がうまくいかないようです。ただし、エラーはありません。助言がありますか?

# PowerShell code
# Connect to a connection to get TenantId and SubscriptionId
$Connection = Get-AutomationConnection -Name "AzureRunAsConnection"
$TenantId = $Connection.TenantId
$SubscriptionId = $Connection.SubscriptionId

# Get the service principal credentials connected to the automation account. 
$null = $SPCredential = Get-AutomationPSCredential -Name "SSISJoost"

# Login to Azure ($null is to prevent output, since Out-Null doesn't work in Azure)
Write-Output "Login to Azure using automation account 'SSISJoost'."
$null = Login-AzureRmAccount -TenantId $TenantId -SubscriptionId $SubscriptionId -Credential $SPCredential

# Select the correct subscription
Write-Output "Selecting subscription '$($SubscriptionId)'."
$null = Select-AzureRmSubscription -SubscriptionID $SubscriptionId

# Get variable values
$ResourceGroupName = Get-AutomationVariable -Name 'ResourceGroupName'
$AnalysisServerName = Get-AutomationVariable -Name 'AnalysisServerName'


# Get old status (for testing/logging purpose only)
$OldAsSetting = Get-AzureRmAnalysisServicesServer -ResourceGroupName $ResourceGroupName -Name $AnalysisServerName

try
{
    # changing tier
    Write-Output "Upgrade $($AnalysisServerName) to S1. Current tier: $($OldAsSetting.Sku.Name)" 
    Set-AzureRmAnalysisServicesServer -ResourceGroupName $ResourceGroupName -Name $AnalysisServerName -Sku "S1"
}
catch
{
        Write-Error -Message $_.Exception
        throw $_.Exception
}

Write-Output "Done"

# Get new status (for testing/logging purpose only)
$NewAsSetting = Get-AzureRmAnalysisServicesServer -ResourceGroupName $ResourceGroupName -Name $AnalysisServerName
Write-Output "New tier: $($NewAsSetting.Sku.Name)" 

ここに画像の説明を入力

Set-AzureRmAnalysisServicesServer の使用

4

1 に答える 1

0

PowerShell AzureRM.AnalysisServicesモジュールに小さなバグがありました。0.4.0で修正されました(2017 年 6 月 8 日木曜日)。

コードが最終的に機能するようになりました: http://microsoft-bitools.blogspot.com/2017/06/schedule-upscaledownscale-azure.html ここに画像の説明を入力

于 2017-06-08T20:31:15.463 に答える