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

Use service connection for MAR ingestion and use .default scope #1287

Merged
merged 2 commits into from
May 15, 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 @@ -9,12 +9,13 @@ steps:
parameters:
displayName: Wait for Image Ingestion
condition: and(${{ parameters.condition }}, eq(variables['waitForIngestionEnabled'], 'true'))
serviceConnection: $(marStatus.serviceConnectionName)
internalProjectName: 'internal'
args: >
waitForMcrImageIngestion
'${{ parameters.imageInfoPath }}'
--manifest '$(manifest)'
--repo-prefix '$(publishRepoPrefix)'
--min-queue-time '${{ parameters.minQueueTime }}'
lbussell marked this conversation as resolved.
Show resolved Hide resolved
--timeout '$(mcrImageIngestionTimeout)'
$(manifestVariables)
${{ parameters.dryRunArg }}
13 changes: 3 additions & 10 deletions src/Microsoft.DotNet.ImageBuilder/src/McrStatusClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Microsoft.DotNet.ImageBuilder
[Export(typeof(IMcrStatusClient))]
public class McrStatusClient : IMcrStatusClient
{
private const string McrStatusResource = "api://c00053c3-a979-4ee6-b94e-941881e62d8e";
private const string McrStatusResource = "api://c00053c3-a979-4ee6-b94e-941881e62d8e/.default";
// https://msazure.visualstudio.com/MicrosoftContainerRegistry/_git/docs?path=/status/status_v2.yaml
private const string BaseUri = "https://status.mscr.io/api/onboardingstatus/v2";
private readonly HttpClient _httpClient;
Expand All @@ -27,15 +27,8 @@ public class McrStatusClient : IMcrStatusClient
[ImportingConstructor]
public McrStatusClient(IHttpClientProvider httpClientProvider, ILoggerService loggerService)
{
if (loggerService is null)
{
throw new ArgumentNullException(nameof(loggerService));
}

if (httpClientProvider is null)
{
throw new ArgumentNullException(nameof(httpClientProvider));
}
ArgumentNullException.ThrowIfNull(loggerService);
ArgumentNullException.ThrowIfNull(httpClientProvider);

_httpClient = httpClientProvider.GetClient();
_httpPolicy = HttpPolicyBuilder.Create()
Expand Down
Loading