Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AAD token request target resource uri for ACR access #4654

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public async Task<string> GetTokenAsync(string registryServer, CancellationToken
{
EnsureArg.IsNotNullOrEmpty(registryServer, nameof(registryServer));

var aadResourceUri = new Uri(_convertDataConfiguration.ArmResourceManagerId);
var aadResourceUri = _convertDataConfiguration.AcrTargetResourceUri;
ShaunDonn2 marked this conversation as resolved.
Show resolved Hide resolved
string aadToken;
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ public class ConvertDataConfiguration
public ICollection<string> ContainerRegistryServers { get; } = new List<string>();

/// <summary>
/// ArmResourceManagerId to aquire AAD token for ACR access token since ACR is not an AAD resource.
/// The value is "https://management.azure.com/" for AzureCloud and DogFood.
/// Could be changed to "https://management.usgovcloudapi.net/" for Azure Government and "https://management.chinacloudapi.cn/ " for Azure China.
/// AcrTargetResourceUri to acquire AAD token for ACR access token since ACR is not an AAD resource.
/// To enable Trusted Services scenarios, we must use the ACR-specific URI rather than the more generic ARM URI.
/// https://dev.azure.com/msazure/AzureContainerRegistry/_wiki/wikis/ACR%20Specs/480000/TrustedServicesPatterns
/// The value is "https://containerregistry.azure.net/" for all cloud environments.
/// </summary>
public string ArmResourceManagerId { get; set; } = "https://management.azure.com/";
public Uri AcrTargetResourceUri { get; set; } = new Uri("https://containerregistry.azure.net/");

/// <summary>
/// Configuration for templates.
Expand Down
Loading