azure - Linux VM 中的 Azure DevOps VM 规模集部署
问题描述
我正在尝试使用在 Azure DevOps Release Pipleine 中的 VM 规模集上运行自定义脚本 VM 扩展在Azure Vm 规模集中进行部署。我有一个执行部署后任务的 shell 脚本。
在发布管道中,我使用存储帐户来存档工件,并且还取消选中了Skip Archiving custom scripts。在 VMSS 部署任务中,我收到以下错误:
2020-03-06T22:59:44.7864691Z ##[error]Failed to install VM custom script extension on VMSS.
Error: VM has reported a failure when processing extension 'AzureVmssDeploymentTask'.
Error message: "Enable failed: failed to execute command: command terminated with exit status=126
[stdout]
extracting archive cs.tar.gz
Invoking command: ./"main.sh"
[stderr]
./customScriptInvoker.sh: line 12: ./main.sh: Permission denied
我在规模集 vm的/var/lib/waagent/custom-script/download/1目录下找到了customScriptInvoker.sh
#!/bin/bash
if [ -n "$1" ]; then
mkdir a
echo "extracting archive $1"
tar -xzC ./a -f $1
cd ./a
fi
command=$2" "$3
echo $command
echo "Invoking command: "$command
eval $command
这个问题应该怎么解决?
解决方案
似乎缺少 shell 执行权限
我假设您正在从我会尝试的同一个文件夹中运行 bash 脚本
chmod +rx main.sh
你可以验证权限
ls -l main.sh
推荐阅读
- spring - Spring - JPA 在抽象类中加入抽象类
- reactjs - 通过单击 li 项更改 div 文本值
- react-native - 如何使用 AsyncStorage 存储和获取主题状态
- windows - 批处理:移动文件组而不设置源/目标文件夹
- flutter - 按下时如何更改 IconButton 的图标
- python - 使用 f 字符串格式化字符串宽度
- typescript - 在没有过多深度错误的情况下迭代 TypeScript 类型级链表
- java - OpenCV 应用程序 - Android 相机一直显示黑屏
- typescript - 如何在 Cloud Firestore 中有效地获取不同集合中具有特定 ID 的文档?
- authentication - 如何在 AWS Cognito ui 中使用 nuxt auth 模块