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

Merged
merged 9 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all 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,10 +22,19 @@ 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.
/// AcrTargetResourceUri to acquire 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.
/// 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 Uri AcrTargetResourceUri { get; set; } = new Uri("https://management.azure.com/");

/// <summary>
/// ArmResourceManagerId to acquire 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.
/// </summary>
[Obsolete("Use AcrTargetResourceUri instead.")]
public string ArmResourceManagerId { get; set; } = "https://management.azure.com/";

/// <summary>
Expand Down
Loading