PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

ACR repository authentication - non-interactively

Open Gijsreyn opened this issue 11 months ago • 5 comments

Summary of the new feature / enhancement

It's awesome to see the investment the PowerShell team is making, and I really love seeing ACR being added as private repository capabilities.

However, my instant thought came to rise, is it also possible to connect to ACR repository non-interactively? Such scenario will be extremely useful when automating tasks.

Proposed technical implementation details (optional)

No response

Gijsreyn avatar Apr 03 '24 14:04 Gijsreyn

We support the whole Azure Identity sdk which includes non-interactive options, we plan to write a doc about using it in automation in the future, for our CI we use workload identity federation https://learn.microsoft.com/en-us/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#defaultazurecredential

SydneyhSmith avatar Apr 03 '24 22:04 SydneyhSmith

Also storing the Az Access Token in Secret Store before registering can be used for non-interactive scenarios. Please see the documentation at: https://learn.microsoft.com/en-us/powershell/gallery/powershellget/how-to/credential-persistence?view=powershellget-3.x#add-a-credential-to-a-psresourcerepository

adityapatwardhan avatar Apr 04 '24 19:04 adityapatwardhan

Thanks for the quick responses @SydneyhSmith and @adityapatwardhan. I might have been a bit to fast and should have just tried it out or could have asked the question in the community call when you presented it. Anyway, will give it a go. Thanks once again!

Gijsreyn avatar Apr 05 '24 07:04 Gijsreyn

No worries. Let us know how it goes. Feedback is invaluable.

adityapatwardhan avatar Apr 05 '24 15:04 adityapatwardhan

@adityapatwardhan It wasn't even needed. I created it through Azure DevOps using the SPN from the Azure PowerShell task. Shared it for others if they want to see it at: https://gijsreijn.medium.com/build-and-publish-your-powershell-modules-to-azure-container-registry-using-azure-devops-c5aac13b001d

image

Gijsreyn avatar Apr 06 '24 11:04 Gijsreyn