Open Gijsreyn opened 7 months ago
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
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
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!
No worries. Let us know how it goes. Feedback is invaluable.
@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
Hi @SydneyhSmith @adityapatwardhan, I see that the Az.accounts module is mandatory. Can we imagine providing an ACR access token directly instead of using this dependency? At the end of the day, you only use the Az.Accounts module to generate an ACR access token and use it when you try to access your ACR. Allowing a direct access token parameter that you will forward on your side will help people that don't want or simply can't use the Az.accounts module. Cheers
@SCOMnewbie we are using Azure Identity directly so you are not tied to Az Accounts you can use any method in this article https://learn.microsoft.com/en-us/dotnet/api/overview/azure/identity-readme?view=azure-dotnet does that help?
Where are you seeing that Az.Accounts is mandatory?
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