gpt4 book ai didi

azure - 持续集成 SSAS 表格并将其部署到 Azure Analysis Services

转载 作者:行者123 更新时间:2023-12-02 07:07:48 25 4
gpt4 key购买 nike

我正在尝试通过 MS 构建和发布过程将 SSAS 表格模型部署到 Azure 分析服务器。

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

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

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

并且失败并出现错误 -

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

我看不出如何在命令行任务中提供凭据。

最佳答案

即使我也在尝试自动化模型部署。

这是我编写的 power shell 脚本。希望这会有所帮助。

$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

关于azure - 持续集成 SSAS 表格并将其部署到 Azure Analysis Services,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52657565/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com