Я пытаюсь обновить табличный куб SSAS, размещенный в Azure, с помощью сценария Power Shell TMSL с использованием модулей Runbook Azure. Для больших разделов я получаю следующую ошибку. Я пытался увеличить время ожидания Invoke-ASCmd, даже с неограниченным временем ожидания.сталкивается с этой проблемой.
failed: {"database":"DashboardName","table":"table Name,"partition":"table-CurrentMonth"} - Non-static method requires a target. at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
at Microsoft.AnalysisServices.AadAuthenticator.BuildAadTokenHolderFromAuthenticationResult(Object result, AadAuthParams authParams, String dataSource, Boolean useAdalCache)
at Microsoft.AnalysisServices.AadAuthenticator.ReAcquireToken(String refreshToken, AadAuthParams authParams, String dataSource, Boolean useAdalCache)
at Microsoft.AnalysisServices.AadTokenHolder.GetValidAccessToken()
at Microsoft.AnalysisServices.HttpStream.GetRequestStream(Boolean isNewXmlaRequest)
at Microsoft.AnalysisServices.HttpStream.WaitForAndUpdateHttpResponseContainingXmlaPayload()
at Microsoft.AnalysisServices.HttpStream.GetResponseStream()
at Microsoft.AnalysisServices.HttpStream.GetResponseDataType()
at Microsoft.AnalysisServices.CompressedStream.GetResponseDataType()
at Microsoft.AnalysisServices.XmlaClient.EndRequest(Boolean useBinaryXml)
at Microsoft.AnalysisServices.XmlaClient.SendExecuteAndReadResponse(Boolean skipResults, Boolean throwIfError, Boolean useBinaryXml)
at Microsoft.AnalysisServices.Core.AnalysisServicesClient.Execute(String command)
at Microsoft.AnalysisServices.Core.Server.Execute(String command)
at Microsoft.AnalysisServices.PowerShell.Cmdlets.ExecuteScriptCommand.ExecuteQueryBatch(Server server, String queryStatement)
at Microsoft.AnalysisServices.PowerShell.Cmdlets.ExecuteScriptCommand.ExecuteQueryBatches(Server server)
at Microsoft.AnalysisServices.PowerShell.Cmdlets.ExecuteScriptCommand.ExecuteQuery()
at Microsoft.AnalysisServices.PowerShell.Cmdlets.ExecuteScriptCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
Сценарий, используемый для обновления:
$Credential = Get-AutomationPSCredential -Name 'XXXX'
$Objects = @(
'{"database":"Database Name","table":"tableName","partition":"CurrentMonth"}',
'{"database":"Database Name","table":"tableName","partition":"CurrentMonth"}',
'{"database":"Database Name","table":"tableName"}',
'{"database":"Database Name","table":"tableName"}'
)
$QueryPrefix = '{"refresh":{"type":"full","objects":['
$QuerySuffix = ']}}'
for ($i = 0; $i -lt $Objects.Count ; $i++) {
Sleep -s 5
$Query = $QueryPrefix + $Objects[$i] + $QuerySuffix
Invoke-ASCmd -Server "ServerName" -Database "DatabaseName" -Credential $Credential -Query $Query -ConnectionTimeout 0 -QueryTimeout 0
}