0
votes
  1. I have a python package build successfully and trying Publish Python packages to Azure Artifacts feeds. My package directory structure is following:
my_pkg
  my_pkg
    start.py
 tests
    test_start.py
.pypirc
  1. .pypirc looks like this:

     [distutils]
     Index-servers =
      ddey-feed
    
     [ddey-feed]
     Repository = https://pkgs.dev.azure.com/project 
    
  2. Below is my pipeline:

enter image description here

  1. yaml set-up for Command Line script for Artifact Feed is following:

steps:

- script: |
   pip install twine keyring artifacts-keyring
   
   echo "$(PYPIRC_PATH)"
   
   python -m twine upload -r ddey-feed --config-file $(PYPIRC_PATH) build/*
  displayName: 'Command Line Script for Artifact Feed'
  env:
    PYPIRC_PATH: $(Build.ArtifactStagingDirectory)

Problem Statement: Although I set-up the variable PYPIRC_PATH to point to $(Build.ArtifactStagingDirectory), when I printed it is showing following "D:\a\_temp\twineAuthenticate\MXAJzL\.pypirc". It leads to the following below error to execute this command.

HTTPError: 403 Forbidden from https://pkgs.dev.azure.com/

Any suggestion how to set-up PYPIRC_PATH in yaml for windows?

1

1 Answers

0
votes

Build Scope permission issue was propagating from the fact that the project build was being feed from Azure pipeline(Build Artifacts) and it requires different level of permission for the Azure Feed - Azure Pipelines

To use packages from a feed in Azure Pipelines, the appropriate build identity must have permission to your feed. By default, the Project Collection Build Service is a Contributor. If you've changed your builds to run at project scope, you'll need to add the project-level build identity as a Reader or Contributor, as desired.

enter image description here