Search code examples
azure-artifacts

Create Azure Artifacts universal package feed via Azure API - Example


we want/need to create feeds in an automatic way depending on a configuration file. Looking at the official documentation neither the Azure CLI nor the Python API provides some convenience functionality to achieve my goal. There is only the REST API that is described briefly in the docs.

Is there anywhere a concrete example for a feed creation via REST API that I can reuse?

Thank you


Solution

  • Check Feed Management - Create Feed, to create a feed with specific name:

    POST https://feeds.dev.azure.com/{organization}/{project}/_apis/packaging/feeds?api-version=5.1-preview.1
    

    With request body:

    {
        "name": "MyFeedName",
        "hideDeletedPackageVersions": true,
        "upstreamEnabled": true
    }
    

    Then the feed with name MyFeedName will be created:

    enter image description here

    For more parameters about request body you can refer to this doc.