Azure / Azure/azure-cli

Not able to fetch Azure Artifacts using Service Pricipal

Open
#24,329 6 comments 0 reactions 0 assignees View on GitHub
act-observability-squad Artifacts Auto-Assign Client customer-reported needs-team-attention question Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

I am trying to fetch Azure Artifacts through Service Principal in PowerShell but not able to do it.
Reproduction step:

**az login --service-principal --username "" -p="" --tenant ""**
Above command works fine and returns the following output:
![image](https://user-images.githubusercontent.com/43474372/197194789-79b5ffac-4295-42ab-a1a1-a9f64b49e48f.png)

Then I ran the following command to download the artifacts:

az artifacts universal download --organization "" --project "" --scope project --feed "" --name "" --version "" --path .

Error:
![image](https://user-images.githubusercontent.com/43474372/197195383-35413335-f6ad-45f6-8a20-33e9aa0795cf.png)

I am able to download the artifacts when I simply run **az login**, then pass the authentication through browser and then run the **az artifact download command**. But I want to automate this process through code so I need to login programmatically.

Please let me know what can I do? I have already spent a lot of days for this issue.
Thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.