Skip to content

Commit 538c35c

Browse files
authored
Use service connection for MAR ingestion and use .default scope (#1287)
1 parent 51da240 commit 538c35c

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

Diff for: eng/common/templates/steps/wait-for-mcr-image-ingestion.yml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ steps:
99
parameters:
1010
displayName: Wait for Image Ingestion
1111
condition: and(${{ parameters.condition }}, eq(variables['waitForIngestionEnabled'], 'true'))
12+
serviceConnection: $(marStatus.serviceConnectionName)
13+
internalProjectName: 'internal'
1214
args: >
1315
waitForMcrImageIngestion
1416
'${{ parameters.imageInfoPath }}'

Diff for: src/Microsoft.DotNet.ImageBuilder/src/McrStatusClient.cs

+3-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Microsoft.DotNet.ImageBuilder
1717
[Export(typeof(IMcrStatusClient))]
1818
public class McrStatusClient : IMcrStatusClient
1919
{
20-
private const string McrStatusResource = "api://c00053c3-a979-4ee6-b94e-941881e62d8e";
20+
private const string McrStatusResource = "api://c00053c3-a979-4ee6-b94e-941881e62d8e/.default";
2121
// https://msazure.visualstudio.com/MicrosoftContainerRegistry/_git/docs?path=/status/status_v2.yaml
2222
private const string BaseUri = "https://status.mscr.io/api/onboardingstatus/v2";
2323
private readonly HttpClient _httpClient;
@@ -27,15 +27,8 @@ public class McrStatusClient : IMcrStatusClient
2727
[ImportingConstructor]
2828
public McrStatusClient(IHttpClientProvider httpClientProvider, ILoggerService loggerService)
2929
{
30-
if (loggerService is null)
31-
{
32-
throw new ArgumentNullException(nameof(loggerService));
33-
}
34-
35-
if (httpClientProvider is null)
36-
{
37-
throw new ArgumentNullException(nameof(httpClientProvider));
38-
}
30+
ArgumentNullException.ThrowIfNull(loggerService);
31+
ArgumentNullException.ThrowIfNull(httpClientProvider);
3932

4033
_httpClient = httpClientProvider.GetClient();
4134
_httpPolicy = HttpPolicyBuilder.Create()

0 commit comments

Comments
 (0)