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 1 commit
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 = new Uri(_convertDataConfiguration.AcrTargetResourceUri);
string aadToken;
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
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.

Check failure on line 25 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build (csharp)

Check failure on line 25 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build (csharp)

Check failure on line 25 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build (csharp)

Check failure on line 25 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build (csharp)

Check failure on line 25 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View check run for this annotation

Azure Pipelines / PR Build & Deploy (Build and run unit tests Linux_dotnet6)

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs#L25

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs(25,109): Error SA1028: Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 25 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View check run for this annotation

Azure Pipelines / PR Build & Deploy (Build artifacts Linux_BuildAndPackage)

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs#L25

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs(25,109): Error SA1028: Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 25 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View check run for this annotation

Azure Pipelines / PR Build & Deploy (Build artifacts Linux_BuildAndPackage)

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs#L25

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs(25,109): Error SA1028: Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 25 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View check run for this annotation

Azure Pipelines / PR Build & Deploy

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs#L25

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs(25,109): Error SA1028: Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)
/// 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 AzureCloud and DogFood.
/// </summary>
public string ArmResourceManagerId { get; set; } = "https://management.azure.com/";
public string AcrTargetResourceUri { get; set; } = "https://containerregistry.azure.net/";

Check failure on line 30 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build (csharp)

Change the type of property 'ConvertDataConfiguration.AcrTargetResourceUri' from 'string' to 'System.Uri' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1056)

Check failure on line 30 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build (csharp)

Change the type of property 'ConvertDataConfiguration.AcrTargetResourceUri' from 'string' to 'System.Uri' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1056)

Check failure on line 30 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build (csharp)

Change the type of property 'ConvertDataConfiguration.AcrTargetResourceUri' from 'string' to 'System.Uri' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1056)

Check failure on line 30 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View workflow job for this annotation

GitHub Actions / CodeQL-Build (csharp)

Change the type of property 'ConvertDataConfiguration.AcrTargetResourceUri' from 'string' to 'System.Uri' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1056)

Check failure on line 30 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View check run for this annotation

Azure Pipelines / PR Build & Deploy (Build and run unit tests Linux_dotnet6)

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs#L30

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs(30,23): Error CA1056: Change the type of property 'ConvertDataConfiguration.AcrTargetResourceUri' from 'string' to 'System.Uri' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1056)

Check failure on line 30 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View check run for this annotation

Azure Pipelines / PR Build & Deploy (Build artifacts Linux_BuildAndPackage)

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs#L30

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs(30,23): Error CA1056: Change the type of property 'ConvertDataConfiguration.AcrTargetResourceUri' from 'string' to 'System.Uri' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1056)

Check failure on line 30 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View check run for this annotation

Azure Pipelines / PR Build & Deploy (Build artifacts Linux_BuildAndPackage)

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs#L30

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs(30,23): Error CA1056: Change the type of property 'ConvertDataConfiguration.AcrTargetResourceUri' from 'string' to 'System.Uri' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1056)

Check failure on line 30 in src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs

View check run for this annotation

Azure Pipelines / PR Build & Deploy

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs#L30

src/Microsoft.Health.Fhir.Core/Configs/ConvertDataConfiguration.cs(30,23): Error CA1056: Change the type of property 'ConvertDataConfiguration.AcrTargetResourceUri' from 'string' to 'System.Uri' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1056)

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