-
Notifications
You must be signed in to change notification settings - Fork 931
Add deployed compute resources and endpoints to pipeline deployment summary #14367
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
Changes from 3 commits
e02e1d4
120d333
3640052
dbb2fdb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,8 @@ public AzureAppServiceWebSiteResource(string name, Action<AzureResourceInfrastru | |
| endpoints = []; | ||
| } | ||
|
|
||
| var anyPublicEndpoints = endpoints.Any(e => e.IsExternal); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this too early to check this? Can endpoints be added / changed between here and when the step runs?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, I didn't think AppService supports non external endpoints? But maybe that was temporary. |
||
|
|
||
| var printResourceSummary = new PipelineStep | ||
| { | ||
| Name = $"print-{targetResource.Name}-summary", | ||
|
|
@@ -61,8 +63,18 @@ public AzureAppServiceWebSiteResource(string name, Action<AzureResourceInfrastru | |
| } | ||
|
|
||
| var hostName = await GetAppServiceWebsiteNameAsync(ctx, deploymentSlot).ConfigureAwait(false); | ||
| var endpoint = $"https://{hostName}.azurewebsites.net"; | ||
| ctx.ReportingStep.Log(LogLevel.Information, $"Successfully deployed **{targetResource.Name}** to [{endpoint}]({endpoint})", enableMarkdown: true); | ||
|
|
||
| if (anyPublicEndpoints) | ||
| { | ||
| var endpoint = $"https://{hostName}.azurewebsites.net"; | ||
| ctx.ReportingStep.Log(LogLevel.Information, $"Successfully deployed **{targetResource.Name}** to [{endpoint}]({endpoint})", enableMarkdown: true); | ||
| ctx.Summary.Add(targetResource.Name, endpoint); | ||
| } | ||
| else | ||
| { | ||
| ctx.ReportingStep.Log(LogLevel.Information, $"Successfully deployed **{targetResource.Name}** to Azure App Service environment **{computerEnv.Name}**. No public endpoints were configured.", enableMarkdown: true); | ||
| ctx.Summary.Add(targetResource.Name, "No public endpoints"); | ||
|
||
| } | ||
| }, | ||
| Tags = ["print-summary"], | ||
| RequiredBySteps = [WellKnownPipelineSteps.Deploy] | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -333,6 +333,7 @@ private async Task PrintEndpointsAsync(PipelineStepContext context, DockerCompos | |||||
| context.ReportingStep.Log(LogLevel.Information, | ||||||
| $"Successfully deployed **{TargetResource.Name}** to Docker Compose environment **{environment.Name}**. No public endpoints were configured.", | ||||||
| enableMarkdown: true); | ||||||
| context.Summary.Add(TargetResource.Name, "No public endpoints"); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -346,13 +347,15 @@ private async Task PrintEndpointsAsync(PipelineStepContext context, DockerCompos | |||||
| { | ||||||
| var endpointList = string.Join(", ", endpoints.Select(e => $"[{e}]({e})")); | ||||||
| context.ReportingStep.Log(LogLevel.Information, $"Successfully deployed **{TargetResource.Name}** to {endpointList}.", enableMarkdown: true); | ||||||
| context.Summary.Add(TargetResource.Name, string.Join(", ", endpoints)); | ||||||
|
Comment on lines
348
to
+350
|
||||||
| } | ||||||
| else | ||||||
| { | ||||||
| // No published ports found in docker compose ps output. | ||||||
| context.ReportingStep.Log(LogLevel.Information, | ||||||
| $"Successfully deployed **{TargetResource.Name}** to Docker Compose environment **{environment.Name}**.", | ||||||
| enableMarkdown: true); | ||||||
| context.Summary.Add(TargetResource.Name, "No public endpoints"); | ||||||
|
||||||
| context.Summary.Add(TargetResource.Name, "No public endpoints"); | |
| context.Summary.Add(TargetResource.Name, "Endpoints unavailable (no published ports detected)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
domainValueis fetched even whenanyPublicEndpointsis false, but it’s only needed to build the public URL. Consider movingContainerAppDomain.GetValueAsync(...)inside theif (anyPublicEndpoints)branch to avoid unnecessary async work.