Azure Devops-获取错误代码:InvalidDeploymentParameterKey

问题描述 投票:0回答:1

我正在尝试使用arm模板为mlops部署基本基础设施

但出现以下错误

There were errors in your deployment. Error code: InvalidDeploymentParameterKey.
##[error]One of the deployment parameters has an empty key.

我有一个变量组 - mlops_infra_variable_grp 并且没有一个键是空的

下面是部署时使用的arm模板

模板 - iac-create-environment-pipeline-arm.yml

pr: none
trigger: none

variables:
- group: mlops_infra_variable_grp

stages:
- stage: 'Dev'
  displayName: 'Dev'
  jobs:
  - job: "Provision_Dev"
    displayName: "Provision Dev resources"
    pool:
      vmImage: 'ubuntu-latest'
    timeoutInMinutes: 0
    steps:
    - task: AzureResourceGroupDeployment@2
      inputs:
        azureSubscription: '$(AZURE_SERVICE_CON)'
        action: 'Create Or Update Resource Group'
        resourceGroupName: '$(RESOURCE_GROUP)'
        location: $(LOCATION)
        templateLocation: 'Linked artifact'
        csmFile: '$(Build.SourcesDirectory)/environment_setup/cloud-environment.json'
        overrideParameters: '-baseName $(BASE_NAME) -location $(LOCATION) -workspace $(WORKSPACE_NAME)'
        deploymentMode: 'Incremental'
      displayName: 'Deploy OH resources to Azure'

导致错误的原因是什么?

azure azure-devops azure-cloud-services azure-artifacts
1个回答
0
投票

尝试在本地计算机上使用Azure CLI命令az部署组创建进行部署,并检查是否存在相同的错误。将 { } 替换为您的实际值。

templateFile="{provide-the-path-to-the-template-file}"
az deployment group create \
  --resource-group {yourResourceGroup} \
  --template-file $templateFile \
  --parameters baseName={ } location={ } workspace={ }

如果出现同样的错误,请检查您的模板是否有问题。如果本地可以运行,则问题可能与管道设置有关。您可以尝试在 AzureCLI@2 - Azure CLI v2 任务 中运行相同的命令并检查结果。

© www.soinside.com 2019 - 2024. All rights reserved.