从Azure自动化刷新Analysis Service模型时出现错误

我正在运行自动化手册中的以下代码以刷新分析服务模型:

Add-Azureanalysisservicesaccount -RolloutEnvironment $RolloutEnvironment -ServicePrincipal -Credential $_Credential -TenantId $TenantId 

Write-output ("Refreshing Analysis Server mode $DatabaseName...")
# Perform a Process Full on the Azure Analysis Services database
Invoke-ProcessASDatabase -Server $Server -DatabaseName $DatabaseName -RefreshType Full -ServicePrincipal -Credential $_Credential 

从azure自动化帐户运行模型刷新时出现以下错误:

  

Invoke-ProcessASDatabase:无法将修改保存到服务器。   返回错误:'给定的凭证缺少必需的属性。   数据源种类:SQL。身份验证类型:OAuth2。物业名称:   accessToken。 idbconnection接口引发了异常。   技术细节:RootactivityId:   ad01e91e-a17f-4b69-8e1d-ad2f18ddbdeb日期(UTC):12/30/2019 9:59:09 AM   '。在第24行:char:1 + Invoke-ProcessASDatabase -Server $ Server   -DatabaseName $ DatabaseName ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~   + CategoryInfo:InvalidArgument:(DevOps:String)[Invoke-ProcessASDatabase],OperationException + FullyQualifiedErrorId   :microsoft.analysisservices.PowerShell.Cmdlets.ProcessASDatabase

zhuxiwangzhenliang 回答:从Azure自动化刷新Analysis Service模型时出现错误

我认为此文档-https://datatables.net/examples/api/row_details.html足够清晰,请按照它进行尝试。确保您创建的服务主体在服务器上具有服务器管理员权限,并在运行手册中创建一个凭据来存储它。

示例脚本:

param
(
    [Parameter (Mandatory = $false)]
    [object] $WebhookData,[Parameter (Mandatory = $false)]
    [String] $DatabaseName,[Parameter (Mandatory = $false)]
    [String] $AnalysisServer,[Parameter (Mandatory = $false)]
    [String] $RefreshType
)

$_Credential = Get-AutomationPSCredential -Name "ServicePrincipal"

# If runbook was called from Webhook,WebhookData will not be null.
if ($WebhookData)
{ 
    # Retrieve AAS details from Webhook request body
    $atmParameters = (ConvertFrom-Json -InputObject $WebhookData.RequestBody)
    Write-Output "CredentialName: $($atmParameters.CredentialName)"
    Write-Output "AnalysisServicesDatabaseName: $($atmParameters.AnalysisServicesDatabaseName)"
    Write-Output "AnalysisServicesServer: $($atmParameters.AnalysisServicesServer)"
    Write-Output "DatabaseRefreshType: $($atmParameters.DatabaseRefreshType)"

    $_databaseName = $atmParameters.AnalysisServicesDatabaseName
    $_analysisServer = $atmParameters.AnalysisServicesServer
    $_refreshType = $atmParameters.DatabaseRefreshType

    Invoke-ProcessASDatabase -DatabaseName $_databaseName -RefreshType $_refreshType -Server $_analysisServer -ServicePrincipal -Credential $_credential
}
else 
{
    Invoke-ProcessASDatabase -DatabaseName $DatabaseName -RefreshType $RefreshType -Server $AnalysisServer -ServicePrincipal -Credential $_Credential
}
,

这不是您的问题,上面的代码也没有任何问题。我可以一直在Azure中重新创建问题。问题是,当您使用Azure CICD进行部署而不在Visual Studio中进行部署时。

Visual Studio Marketplace中有2个插件/扩展将AAS模型部署到Azure。它们都报告部署成功,但是当您发行运行手册时,您会看到错误。如果您立即使用Visual Studio进行部署并运行Runbook,则错误会消失。

我一直在与两个扩展程序的开发人员一起工作,这似乎很不稳定。

本文链接:https://www.f2er.com/2840843.html

大家都在问