Adding a private package into my own package in AZURE artifact feed (different organisations)

45 Views Asked by At

I want to add a private package that resides in another organization in azure artifact feed. I want to add it and then publish my package so that whenever I deploy my package it installs the private package as well.

I have tried multiple approaches now

1st approach: tried adding the private package in setup.py through data_files=[("", ["requirements.txt"])], attribute

2nd approach: tried installing the privatepackage (got installed correctly) and then made a package using TAR.

in both cases i published using the command: "python -m twine upload --repository-url https://link --username token --password $(PypiToken) $(Build.ArtifactStagingDirectory)/*"

but at the end when i deploy my created package I get the error:

ERROR: Could not find a version that satisfies the requirement "privatepackage" (from newpackage) (from versions: none) ERROR: No matching distribution found for "privatepackage"

*Private package is the package that resides in the different organization (that i access with credentials) *newpackage is my created package

I also tried creating an upstream but failed to find the private package through it.

1

There are 1 best solutions below

0
Ziyang Liu-MSFT On

You can use upstream source to download packages from a different organization. Refer to the steps below.

  1. Set the visibility of the feed containing your private package to "Members of your Microsoft Entra tenant".

enter image description here

  1. Add the feed containing your private package as the upstream source of the feed in another organization.

    Go to Feed Settings -> Upstream Sources -> Add Upstream -> Select Azure Artifacts feed in another organization -> Fill in the Azure Artifacts feed locator. If your upstream feed (containing your private package) is project-level, then you need to provide the project name.

enter image description here

  1. Add your private package with version to your requirements.txt. Then the private package will be downloaded into the downstream feed when you install the required dependencies. You can see the source once it's downloaded.

enter image description here