通过Azure Devops用于MDS的CICD [英] CICD for MDS via Azure Devops

查看:61
本文介绍了通过Azure Devops用于MDS的CICD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Azure Devops为MDS实施CICD.以下是我遵循的步骤:

I am trying to implement CICD for MDS via Azure Devops. Below are the steps which I have followed :

  1. 创建一个安装了SSDT的自托管代理
  2. 尝试从我作为自托管代理创建的VM执行MDS Cmd查询,成功了:

  1. 在Azure Devops中,使用了自托管代理和CMD任务:

并添加了内联查询:

cd C:\Program Files\Microsoft SQL Server\110\Master Data Services\Configuration

MDSModelDeploy createpackage -service MDS1 -model SalesBI -package "C:\MDS\CICD\SalesBI_CICD.pkg" 

在执行管道之后,我得到了错误消息:

And after execution of the pipeline, I am getting the error :

主数据服务实例的Web配置文件无法加载.加载配置文件时发生错误:访问路径'C:\ Program Files \ Microsoft SQL Server \ 110 \ Master数据服务\ WebApplication \ web.config'被拒绝.(C:\ Program文件\ Microsoft SQL Server \ 110 \主数据Services \ WebApplication \ web.config)

The web configuration file for the Master Data Services instance cannot be loaded. An error occurred loading a configuration file: Access to the path 'C:\Program Files\Microsoft SQL Server\110\Master Data Services\WebApplication\web.config' is denied. (C:\Program Files\Microsoft SQL Server\110\Master Data Services\WebApplication\web.config)

在Devops中设置自托管代理时,还有什么我缺少的东西,因为通过手动登录同一VM执行相同的命令已成功执行.

So is there anything which I am missing out while setting up the self hosted agent in Devops because executing the same commands by manually logging into the same VM is getting executed successfully.

推荐答案

在Azure DevOps中,如果要通过自托管代理访问azure devops管道中的本地文件,它将通过 service帐户访问该文件而不是 Personal account ,因此您可以从计算机本地运行cmd,并在azure devops管道中出现错误.

In the Azure DevOps, If you want to access local file in the azure devops pipeline via self-hosted agent, It accesses the file via service account instead of Personal account, so you can run the cmd locally from your computer, and get error in the azure devops pipeline.

解决方法

我们可以打开检查文件权限并配置服务帐户权限.服务帐户格式用户/管理员/管理员({Agent.ComputerName} \用户/管理员/管理员)

We could open check the file permission and configure the service account permission. service account format User/Administrator/Administrators({Agent.ComputerName}\User/Administrator/Administrators)

此外,我们可以将代理服务帐户更改为您的所有者帐户.

Also, we could change the agent service account to your owner account.

步骤:在代理机器上打开服务并搜索代理服务帐户,检查下图,只需将帐户名和密码更改为您的帐户名和密码,然后它将使用该帐户执行操作.

Steps: Open service on the agent machine and search the agent service account, check the pic below, just change the account name and password to yours, then It will use this account to perform the operation.

这篇关于通过Azure Devops用于MDS的CICD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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