最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

azure devops - No template with an identifier of 'xamarinandroid' could be found - Stack Overflow

programmeradmin2浏览0评论

Could not find a question about this, and just spent 1 day figuring this out, so as community service:

Trying to create new Pipeline in a private Azure Devops project always results in the following error: No template with an identifier of 'xamarinandroid' could be found.

My repository has nothing to do with Xamarin. There are no options to choose from and I cannot finish pipeline creation.

How can I create a new Pipeline?

Could not find a question about this, and just spent 1 day figuring this out, so as community service:

Trying to create new Pipeline in a private Azure Devops project always results in the following error: No template with an identifier of 'xamarinandroid' could be found.

My repository has nothing to do with Xamarin. There are no options to choose from and I cannot finish pipeline creation.

How can I create a new Pipeline?

Share Improve this question edited Feb 18 at 6:24 tonsteri asked Feb 16 at 8:34 tonsteritonsteri 8458 silver badges21 bronze badges 6
  • 2 developer community thread about the problem: developercommunity.visualstudio/t/…? – tonsteri Commented Feb 18 at 6:27
  • 2 thanks for the info. Not all region users can reproduce the issue, and it's caused by the xamarin template was accidently deleted from backend server. You can monitor on the Developer Community ticket for the fix progress. – wade zhou - MSFT Commented Feb 18 at 7:03
  • Yes. It started to happen about a week ago, especially for new accounts that created projects for the first time. As for a newbies using the POST request to the API might be a bit difficult, we figure out that you could delete your .sln file, in order to NOT confuse the UI, create your pipelines through the UI as you would do, set it up, and simply revert the changes and get back your .sln just before the build. I will use that one until a regular fix is done. – Danko Valkov Commented Feb 18 at 21:47
  • 1 Interesting, two more approaches that you could try still in your case to see if that would have any positive effect for you: 1. Try to use the classic view and create the pipeline through it. 2. Get another azure-pipelines.yml file from another repo temporarily overriding the current one, and see afterwards if the UI will work for you in that case? – Danko Valkov Commented 2 days ago
  • 1 @DankoValkov For me this is already resolved, but I tested those methods too and 1. I cannot choose classic view But method 2 works, I just didn't know about the special filename. thanks! – tonsteri Commented 2 days ago
 |  Show 1 more comment

4 Answers 4

Reset to default 4

Until MS fixes the problem, you can use devops REST API to create the pipeline, but official documentation is lacking important details about the request body.

The following works via command line

  1. create-pipeline.json (request body):
{
    "folder": null,
    "name": "pipeline-name",
    "configuration": {
      "type": "yaml",
      "path": "/my-pipelines/my-pipeline-file.yaml",
      "repository": {
        "id": "d862c503-f545-47bc-913b-575c48f99864",
        "name": "repo-name-exactly",
        "type": "azureReposGit"
      }
    }
  }

where repository.id is a guid you see on browser url when navigating into Project Settings -> Repositories -> select your repo

  1. Go to User Settings -> Personal Access Tokens -> Create token -> copy token
export AT={paste token}
http POST https://dev.azure/{anization}/{project}/_apis/pipelines\?api-version\=7.1  Authorization:"Bearer $AT" < create-pipeline.json

And you have a pipeline that you can edit in DevOps. This works only for Azure DevOps Git repositories.

Edit If you put a valid azure-pipelines.yml at the root of the repo before creating a pipeline, DevOps will pick that up automatically and I get past the error. (I am just used to placing my pipelines in a infra-related folder) (suggested by @DankoValkov)

for people using the restclient extension in vscode (I'm not 100% certain but I thing there is also one for visual studio), here is an example of an *.http file to create a pipeline based on the answer by tonsteri

@token=your-actual-personal-access-token
@anization=your-anization
@project=your-project
@repositoryName=your-repository-name
@repositoryId=the-id-of-the-repository

### Create Pipeline and anize into folder /Publish or set to null
POST https://dev.azure/{{anization}}/{{project}}/_apis/pipelines/?api-version=7.1
content-type: application/json
Authorization: Bearer {{token}}

{
    "folder": "/Publish",
    "name": "the-name-of-the-pipeline",
    "configuration": {
      "type": "yaml",
      "path": "the-path-to-the-pipeline-yml-file",
      "repository": {
        "id": "{{repositoryId}}",
        "name": "{{repositoryName}}",
        "type": "azureReposGit"
      }
    }
}

copy, save as *.http file in vscode and then you should be able to click on the "Send Request"

Since it started to happen about a week ago, there are few other options that potentially would work as a workarounds, until the UI gets fixed.

  1. What you could do is to delete your .sln file, in order to NOT confuse the UI, afterwards create your pipelines through the UI as you would do regularly, than set it up, and simply revert the changes in your repo to get back your .sln file just before running the build.

  2. Get another azure-pipelines.yml file from another repo temporarily, overriding the current one, and see afterwards if the UI will work for you in that case as usual.

  3. Use az pipelines as part of the azure-devops extension.

    az pipelines create --name 'NewBuild' --description 'PipelineForYourProject' --repository SampleRepoName --branch main --repository-type tfsgit
    

As more details around the last approach are available at the link below: https://learn.microsoft/en-us/cli/azure/pipelines?view=azure-cli-latest#az-pipelines-create

One of the quotes in the community discuss linked in a comment on the main post mentions that you can use the classic pipeline editor. Just tested and can confirm that works.

发布评论

评论列表(0)

  1. 暂无评论