Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YAML Azure Devops: Step task reference is invalid. The task name is ambiguous

I am trying to use the AzureRmWebAppDeployment task to deploy WebJobs to an App Service (Azure App service deploy).

Here is the following YAML code (task: AzureRmWebAppDeployment@4):

- task: AzureRmWebAppDeployment@4
  inputs:
    ConnectionType: 'AzureRm'
    azureSubscription: 'hidden'
    appType: 'webApp'
    WebAppName: 'hidden'
    package: '$(Build.StagingDirectory)\WebJob'

When I try to run the build, it gives me this error:

Job DeployWebJobsCombo1: Step DeployWebJobsCombo1 task reference is invalid. The task name AzureRmWebAppDeployment is ambiguous. Specify one of the following identifiers to resolve the ambiguity: ae173df0-05de-4ac6-b5cc-853e9f951a33, 497d490f-eea7-4f2b-ab94-48d9c1acdcb1

I've tried replacing the task name with either of those IDs(task: ae173df0-05de-4ac6-b5cc-853e9f951a33@4 and task: ae173df0-05de-4ac6-b5cc-853e9f951a33 have both been tried), but it says it isn't a valid name.

I've tried setting the name property of the task (https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#task) but that doesn't accept GUIDs:

name: string  # identifier for this step (A-Z, a-z, 0-9, and underscore)

I haven't been able to find any information online on how to actually specify the identifiers ae173df0-05de-4ac6-b5cc-853e9f951a33 or 497d490f-eea7-4f2b-ab94-48d9c1acdcb1. Can anyone point me to how to use these identifiers?

like image 241
Chris Gelon Avatar asked Jan 26 '23 08:01

Chris Gelon


1 Answers

So 497d490f-eea7-4f2b-ab94-48d9c1acdcb1 appears to be the id of AzureRmWebAppDeployment@4

Github for the task here.

It looks like that error can happen when two tasks\extensions exist in your Azure DevOps organization with the same name. See support forums here and here.

I would expect that you should be able to use - task: 497d490f-eea7-4f2b-ab94-48d9c1acdcb1@4 not sure why that is not working. I just tried and it recognized it as the AzureRmWebAppDeployment task. Maybe give that another try.

Also if you would like to see the tasks that exist in your organization you can use the API and hit this url to get the YAML Schema.

https://dev.azure.com/{organization}/_apis/distributedtask/yamlschema?api-version=5.1 I would check here for possible duplicates.

like image 127
Eric Smith Avatar answered Jan 29 '23 07:01

Eric Smith