docs: add an example of authentication with Azure Container Registry#321
Open
wangxiaoxuan273 wants to merge 13 commits intooras-project:mainfrom
Open
docs: add an example of authentication with Azure Container Registry#321wangxiaoxuan273 wants to merge 13 commits intooras-project:mainfrom
wangxiaoxuan273 wants to merge 13 commits intooras-project:mainfrom
Conversation
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #321 +/- ##
=======================================
Coverage 91.76% 91.76%
=======================================
Files 64 64
Lines 2755 2755
Branches 364 364
=======================================
Hits 2528 2528
Misses 138 138
Partials 89 89 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds documentation and example code demonstrating how to authenticate with Azure Container Registry (ACR) using Azure Active Directory (AAD) credentials in the ORAS .NET library.
Changes:
- Added
AzureCredentialProviderclass implementingICredentialProviderfor ACR authentication via AAD token exchange - Added
AzureContainerRegistryAuthenticationexample demonstrating ACR authentication and cross-registry copy operations - Added Azure SDK dependencies (
Azure.Containers.ContainerRegistry1.3.0,Azure.Identity1.13.1) - Updated API documentation index to include the new ACR authentication example
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs | Implements ICredentialProvider for ACR authentication using Azure DefaultAzureCredential and AAD token exchange |
| tests/OrasProject.Oras.Tests/examples/AzureContainerRegistryAuthentication.cs | Demonstrates usage of AzureCredentialProvider for cross-registry artifact copy operations |
| tests/OrasProject.Oras.Tests/OrasProject.Oras.Tests.csproj | Adds Azure SDK package references for ACR and Azure Identity support |
| docs/api/index.md | Adds link to the new ACR authentication documentation |
| docs/api/authenticate_with_ACR.md | Documentation page that includes the ACR authentication examples |
tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
examples/OrasProject.Oras.Examples.Azure/AzureContainerRegistryAuthentication.cs
Show resolved
Hide resolved
tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
sajayantony
reviewed
Feb 2, 2026
tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
sajayantony
requested changes
Feb 2, 2026
tests/OrasProject.Oras.Tests/examples/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
examples/OrasProject.Oras.Examples.Azure/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
examples/OrasProject.Oras.Examples.Azure/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
lizMSFT
reviewed
Feb 3, 2026
examples/OrasProject.Oras.Examples.Azure/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Wwwsylvia
reviewed
Feb 4, 2026
lizMSFT
reviewed
Feb 5, 2026
examples/OrasProject.Oras.Examples.Azure/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
lizMSFT
reviewed
Feb 5, 2026
examples/OrasProject.Oras.Examples.Azure/AzureCredentialProvider.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
lizMSFT
approved these changes
Feb 6, 2026
examples/OrasProject.Oras.Examples.Azure/AzureContainerRegistryAuthentication.cs
Show resolved
Hide resolved
examples/OrasProject.Oras.Examples.Azure/AzureContainerRegistryAuthentication.cs
Outdated
Show resolved
Hide resolved
e80f686 to
7ae9386
Compare
examples/OrasProject.Oras.Examples.Azure/AzureContainerRegistryAuthentication.cs
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
This PR adds an example of using oras-dotnet to authenticate with Azure Container Registry.
Which issue(s) this PR resolves / fixes
Resolves / Fixes #267
Please check the following list