2

我正在尝试使用 Azure Runbooks 使用 Power Shell TMSL 脚本刷新 Azure 上托管的 SSAS 表格多维数据集.

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   
}
4

1 回答 1

0

对,这需要做一些事情来解决。我和你有同样的问题。以下是帮助我解决的一些关键问题。

在我设置的 Azure 分析服务上:

  • ExternalCommand 超时从 3600 到 10800
  • ServerTimout 从 3600 到 10800
  • ExternalConnectionTimeout 从 60 到 180
  • 打开 Analysis Services 诊断以更好地了解活动

我还直接在 PowerShell 中进行了测试,即没有 Runbook。我得到了同样的错误。然后我将分析服务扩大到最大以检查超时。这也没有效果。我迅速缩小了自己的规模,以避免财务损失。

因此,Analysis Services 很好,Azure 和运行手册也很好。我仔细检查了模型。它也很漂亮。这使我的目光超越了分析服务。

我们正在将我们的模型连接到具有 TB 数据的 SQL 数据仓库。我注意到模型刷新正在破坏数据仓库,所以我提高了仓库的 DWU(性能),查询运行得更快并且错误消失了。

简而言之,通过减少下游系统的加载时间,错误就消失了。检查您的源以获取长时间运行的查询,看看您是否可以优化它们(或使用数据的子集),看看它是否能解决您的问题。

于 2018-06-06T10:26:48.250 回答