Непрерывная интеграция и табличное развертывание SSAS в службы анализа Azure - PullRequest
0 голосов
/ 05 октября 2018

Я пытаюсь развернуть табличную модель SSAS на Azure Analysis Server с помощью процесса сборки и выпуска MS.

Я могу успешно выполнить Invoke-ProcessASDatabase.Но у меня проблема с развертыванием новых объектов на сервере Azure.

Я использую командную строку для развертывания табличной модели, используя приведенную ниже команду

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

, и ошибка завершается с ошибкой -

" Ошибка аутентификации: требуется идентификатор пользователя и пароль, когда пользовательский интерфейс недоступен. "

Я не вижу способа, как я могу предоставить учетные данные в моей задаче командной строки.

Просьба предоставить ваши входные данные.

1 Ответ

0 голосов
/ 16 октября 2018

Даже я пытался автоматизировать развертывание модели.

Вот сценарий 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
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...