持续集成并以表格形式将SSAS部署到Azure Analysis Services [英] Continuous integration and Deploy SSAS tabular to Azure Analysis Services

查看:83
本文介绍了持续集成并以表格形式将SSAS部署到Azure Analysis Services的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过MS生成和发布过程将SSAS表格模型部署到Azure Analysis Server.

I am trying to deploy SSAS Tabular model to Azure Analysis Server through MS Build and Release process.

我能够成功执行Invoke-ProcessASDatabase.但是我在将新对象部署到Azure服务器时遇到问题.

I am able to successfully execute Invoke-ProcessASDatabase. But I am having problem with Deploying new objects to the Azure Server.

我正在使用命令行通过以下命令部署表格模型

I am using Command Line to deploy the tabular model using below command

"C:\ Program Files(x86)\ Microsoft SQL Server \ 140 \ Tools \ Binn \ ManagementStudio \ Microsoft.AnalysisServices.Deployment.exe"

"C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Microsoft.AnalysisServices.Deployment.exe"

并且失败,并显示错误-

and it fails with error -

身份验证失败:用户界面不可用时,需要用户ID和密码.

Authentication failed: User ID and Password are required when user interface is not available.

我看不到如何在命令行任务中提供凭据的方法.

I don't see a way how I can provide credentials in my command line task.

推荐答案

即使我试图自动化模型部署.

Even I was trying to automate model deployment.

这是我编写的Power Shell脚本.希望这会有所帮助.

Here is the power shell script I wrote. Hope this helps.

$msBuildPath = Get-MSBuildToPath
$Microsoft_AnalysisServices_Deployment_Exe_Path = Get-Microsoft_AnalysisServices_Deployment_Exe_Path

# BUild smproj 
& $msBuildPath $projPath "/p:Configuration=validation" /t:Build

Get-ChildItem $binPath | Copy -Destination $workingFolder -Recurse

$secureStringRecreated = ConvertTo-SecureString -String $AnalysisServerPassword -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($AnalysisServerUserName, $secureStringRecreated)
#$plainText = $cred.GetNetworkCredential().Password

#region begin Update Model.deploymenttargets
# Read Model.deploymenttargets
[xml]$deploymenttargets = Get-Content -Path  $deploymenttargetsFilePath

$deploymenttargets.DeploymentTarget.Database = $AnalysisDatabase
$deploymenttargets.DeploymentTarget.Server = $AnalysisServer
$deploymenttargets.DeploymentTarget.ConnectionString = "DataSource=$AnalysisServer;Timeout=0;UID=$AnalysisServerUserName;Password=$AnalysisServerPassword;"
$deploymenttargets.Save($deploymenttargetsFilePath);
#endregion

#region begin Update Model.deploymentoptions
# Read Model.deploymentoptions
[xml]$deploymentoptions = Get-Content -Path  $deploymentoptionsFilePath

# Update ProcessingOption to DoNotProcess otherwise correct xmla file wont be generated.
$deploymentoptions.Deploymentoptions.ProcessingOption = 'DoNotProcess'
$deploymentoptions.Deploymentoptions.TransactionalDeployment = 'false'
$deploymentoptions.Save($deploymentoptionsFilePath);
#endregion

# Create xmla deployment file.
& $Microsoft_AnalysisServices_Deployment_Exe_Path $asdatabaseFilePath  /s:$logFilePath  /o:$xmlaFilePath

#region begin Update .xmla
#Add passowrd in .xmla file.
$xmladata = Get-Content -Path $xmlaFilePath | ConvertFrom-Json

foreach ($ds in $xmladata.createOrReplace.database.model.dataSources){
    $ds.Credential.AuthenticationKind = 'Windows'
    $ds.Credential.Username = $AnalysisServerUserName

    #Add password property to the object.
    $ds.credential | Add-Member -NotePropertyName Password -NotePropertyValue $AnalysisServerPassword
}

$xmladata | ConvertTo-Json -depth 100 | Out-File $xmlaFilePath
#endregion

#Deploy model xmla.
Invoke-ASCmd -InputFile $xmlaFilePath -Server $AnalysisServer -Credential $cred

这篇关于持续集成并以表格形式将SSAS部署到Azure Analysis Services的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆