【发布时间】:2018-06-05 00:58:50
【问题描述】:
我正在尝试使用 Azure Runbooks 使用 Power Shell TMSL 脚本刷新托管在 Azure 上的 SSAS 表格多维数据集 对于较大的分区,我遇到了以下错误,我尝试增加 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
}
【问题讨论】:
-
我们在使用工作流时看到了同样的情况。假设超时也是某种错误。
-
你能确认这是在约 1 小时后超时吗?
-
不,它只在一小时前给出这个错误
-
@Murray Foxcroft 这个错误是因为超时而发生的吗?我提到超时为 0,即无限超时
-
在下方添加了答案
标签: powershell azure ssas-tabular xmla azure-runbook