azure-devops - Azure devops 任务 AddOrUpdateUserAzure@1 失败 ubuntu-latest 托管代理
问题描述
在 Azure 管道中使用 AddOrUpdateUserAzure@1 任务使用 Microsoft 托管的代理ubuntu-latest创建 Microsoft SQL Server 数据库用户失败,并显示如下错误:
- task: AddOrUpdateUserAzure@1
displayName: DB user creation
inputs:
ConnectedServiceNameSelector: 'ConnectedServiceNameARM'
ConnectedServiceNameARM: ${{ parameters.arm_service_connection }}
serverName: test-sql-server'
databaseName: 'test-sql-db'
userName: 'admin'
userPassword: 'admin_password'
targetUserName: 'readonly-user'
targetUserPassword: 'password'
queryTimeout: '30'
错误
[错误] 当前操作系统无法运行此任务。这通常意味着该任务仅针对 Windows 编写。例如,为 Windows 桌面 PowerShell 编写。
请分享您的建议,我们可以使用 linux 代理在 Microsoft SQL Server 中创建只读用户
解决方案
此问题是由Azure Powershell 版本引起的。
我建议您尝试其他版本的powershell。尝试 Azure PowerShell 任务版本 4.157.4。
请参阅此 github 链接 - https://github.com/microsoft/azure-pipelines-tasks/issues/11283
推荐阅读
- regex - 涉及 grep 的相同 bash 脚本在一台机器上成功,但在另一台机器上失败
- c - 与静态库链接
- angular - Angular 9 + FontAwesome 0.6:“错误 NG8001:'fa-icon' 不是已知元素”
- ipfs - 如何避免 IPFS DNSLINK 的名称冲突?
- swift - 我的协议不起作用,它有什么问题?
- python - python中大列表的反向操作很慢
- python-3.x - ValueError: 层 simple_rnn_1 的输入 0 与层不兼容:预期 ndim=3,发现 ndim=2。收到的完整形状:[无,50]
- html - 在 css 中使用 Calc() 函数仅填充左侧和顶部
- python - 不再支持将列表喜欢传递给带有任何缺失标签的 .loc 或 []
- javascript - 如何将 node.js 服务器应用程序编译为可执行文件?