[英]Bicep roleAssignments/write permission error when assigning a role to Keyvault
[英]Bicep Deployment error : An error occurred reading file. Could not find a part of the path '/home/vsts/work/1/s/bicep/storageaccount.bicep'
我正在尝试在 devOps yml 管道中使用 powershell 任务部署二头肌模板。
我有以下任务:
- task: AzurePowerShell@4
displayName: "4.3) Deploy xxxxxx Synapse Infra"
enabled: true
inputs:
azureSubscription: ${{parameters.azureServiceConnection}}
ScriptType: "InlineScript"
azurePowerShellVersion: "LatestVersion"
continueOnError: true
errorActionPreference : "continue"
Inline: |
echo "Deploy Bicep template"
$deployment = New-AzResourceGroupDeployment `
-ResourceGroupName "rg-emdi-data-${{parameters.environment}}" `
-TemplateFile "$env:BUILD_SOURCESDIRECTORY\bicep\storageaccount.bicep" `
-envName "${{parameters.environment}}" `
-location "${{parameters.location}}" `
-storageId "$(storageID)" `
但是,当我运行它时,我收到以下错误消息:
ERROR: An error occurred reading file. Could not find a part of the path '/home/vsts/work/1/s/bicep/storageaccount.bicep'.
如果我部署 main.bicep 但在部署存储帐户模块时失败,它会起作用。 任何帮助都会很棒。
部署作业不会自动克隆源代码库,因此您可以使用 Thomas 提到的工件方法,也可以添加一个checkout: self
步骤。
来自文档: 部署作业
部署作业不会自动克隆源代码库。 您可以使用 checkout: self 在您的工作中检出源代码库。 部署作业仅支持一个结帐步骤。
这在 YAML 管道中看起来像这样:
- stage: Deployment
jobs:
- deployment: DeployBicep
environment: $(Environment)
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: AzurePowerShell@4
displayName: "4.3) Deploy xxxxxx Synapse Infra"
enabled: true
inputs:
azureSubscription: ${{parameters.azureServiceConnection}}
ScriptType: "InlineScript"
azurePowerShellVersion: "LatestVersion"
continueOnError: true
errorActionPreference : "continue"
Inline: |
echo "Deploy Bicep template"
$deployment = New-AzResourceGroupDeployment `
-ResourceGroupName "rg-emdi-data-${{parameters.environment}}" `
-TemplateFile "$env:BUILD_SOURCESDIRECTORY\bicep\storageaccount.bicep" `
-envName "${{parameters.environment}}" `
-location "${{parameters.location}}" `
-storageId "$(storageID)" `
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.