From ae323c74ace9ddf4a9350ba1854f97f97b5daaea Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Sun, 6 Apr 2025 01:39:44 +0000 Subject: [PATCH 1/6] PublishingActivityReporter fixes --- .../Publishers.AppHost/docker-compose.yaml | 15 ++++ src/Aspire.Cli/Commands/PublishCommand.cs | 16 ++-- .../Backchannel/AppHostRpcTarget.cs | 14 ++-- .../DistributedApplicationRunner.cs | 12 ++- .../PublishingActivityProgressReporter.cs | 79 ++++++++++++++----- .../ResourceContainerImageBuilder.cs | 20 +++-- 6 files changed, 112 insertions(+), 44 deletions(-) diff --git a/playground/publishers/Publishers.AppHost/docker-compose.yaml b/playground/publishers/Publishers.AppHost/docker-compose.yaml index d069b28070a..468e2f06cc2 100644 --- a/playground/publishers/Publishers.AppHost/docker-compose.yaml +++ b/playground/publishers/Publishers.AppHost/docker-compose.yaml @@ -22,6 +22,9 @@ services: ports: - "8002:8001" - "8004:8003" + depends_on: + pg: + condition: "service_started" networks: - "aspire" api: @@ -37,6 +40,11 @@ services: ports: - "8006:8005" - "8008:8007" + depends_on: + pg: + condition: "service_started" + dbsetup: + condition: "service_completed_successfully" networks: - "aspire" sqlserver: @@ -70,6 +78,13 @@ services: ports: - "8011:8010" - "8013:8012" + depends_on: + api: + condition: "service_started" + networks: + - "aspire" + mycontainer: + image: "${MYCONTAINER_IMAGE}" networks: - "aspire" networks: diff --git a/src/Aspire.Cli/Commands/PublishCommand.cs b/src/Aspire.Cli/Commands/PublishCommand.cs index 45bf36f6660..a7dc712d5c2 100644 --- a/src/Aspire.Cli/Commands/PublishCommand.cs +++ b/src/Aspire.Cli/Commands/PublishCommand.cs @@ -152,7 +152,7 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell var backchannelCompletionSource = new TaskCompletionSource(); - var launchingAppHostTask = context.AddTask(":play_button: Launching apphost"); + var launchingAppHostTask = context.AddTask(":play_button: Launching apphost"); launchingAppHostTask.IsIndeterminate(); launchingAppHostTask.StartTask(); @@ -167,7 +167,7 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell var backchannel = await backchannelCompletionSource.Task.ConfigureAwait(false); - launchingAppHostTask.Description = $":check_mark: Launching apphost"; + launchingAppHostTask.Description = $":check_mark: Launching apphost"; launchingAppHostTask.Value = 100; launchingAppHostTask.StopTask(); @@ -175,8 +175,12 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell var progressTasks = new Dictionary(); + (string Id, string StatusText, bool IsComplete, bool IsError)? lastPublishingActivity = null; + await foreach (var publishingActivity in publishingActivities) { + lastPublishingActivity = publishingActivity; + if (!progressTasks.TryGetValue(publishingActivity.Id, out var progressTask)) { progressTask = context.AddTask(publishingActivity.Id); @@ -185,17 +189,17 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell progressTasks.Add(publishingActivity.Id, progressTask); } - progressTask.Description = $":play_button: {publishingActivity.StatusText}"; + progressTask.Description = $":play_button: {publishingActivity.StatusText}"; if (publishingActivity.IsComplete && !publishingActivity.IsError) { - progressTask.Description = $":check_mark: {publishingActivity.StatusText}"; + progressTask.Description = $":check_mark: {publishingActivity.StatusText}"; progressTask.Value = 100; progressTask.StopTask(); } else if (publishingActivity.IsError) { - progressTask.Description = $"[red bold]:cross_mark: {publishingActivity.StatusText}[/]"; + progressTask.Description = $"[red bold]:cross_mark: {publishingActivity.StatusText}[/]"; progressTask.Value = 0; break; } @@ -205,8 +209,6 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell } } - await backchannel.RequestStopAsync(cancellationToken).ConfigureAwait(false); - // When we are running in publish mode we don't want the app host to // stop itself while we might still be streaming data back across // the RPC backchannel. So we need to take responsibility for stopping diff --git a/src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs b/src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs index 328d4ff457d..667742b7210 100644 --- a/src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs +++ b/src/Aspire.Hosting/Backchannel/AppHostRpcTarget.cs @@ -28,9 +28,9 @@ IHostApplicationLifetime lifetime { while (cancellationToken.IsCancellationRequested == false) { - var publishingActivity = await activityReporter.ActivitiyUpdated.Reader.ReadAsync(cancellationToken).ConfigureAwait(false); + var publishingActivityStatus = await activityReporter.ActivityStatusUpdated.Reader.ReadAsync(cancellationToken).ConfigureAwait(false); - if (publishingActivity == null) + if (publishingActivityStatus == null) { // If the publishing activity is null, it means that the activity has been removed. // This can happen if the activity is complete or an error occurred. @@ -38,13 +38,13 @@ IHostApplicationLifetime lifetime } yield return ( - publishingActivity.Id, - publishingActivity.StatusMessage, - publishingActivity.IsComplete, - publishingActivity.IsError + publishingActivityStatus.Activity.Id, + publishingActivityStatus.StatusText, + publishingActivityStatus.IsComplete, + publishingActivityStatus.IsError ); - if ( publishingActivity.IsPrimary &&(publishingActivity.IsComplete || publishingActivity.IsError)) + if ( publishingActivityStatus.Activity.IsPrimary &&(publishingActivityStatus.IsComplete || publishingActivityStatus.IsError)) { // If the activity is complete or an error and it is the primary activity, // we can stop listening for updates. diff --git a/src/Aspire.Hosting/DistributedApplicationRunner.cs b/src/Aspire.Hosting/DistributedApplicationRunner.cs index 8af3ce11a76..30285a6e2a6 100644 --- a/src/Aspire.Hosting/DistributedApplicationRunner.cs +++ b/src/Aspire.Hosting/DistributedApplicationRunner.cs @@ -49,8 +49,10 @@ await eventing.PublishAsync( new AfterPublishEvent(serviceProvider, model), stoppingToken ).ConfigureAwait(false); - publishingActivity.IsComplete = true; - await activityReporter.UpdateActivityAsync(publishingActivity, stoppingToken).ConfigureAwait(false); + await activityReporter.UpdateActivityStatusAsync( + publishingActivity, + (status) => status with { IsComplete = true }, + stoppingToken).ConfigureAwait(false); // If we are running in publish mode and a backchannel is being // used then we don't want to stop the app host. Instead the @@ -65,8 +67,10 @@ await eventing.PublishAsync( catch (Exception ex) { logger.LogError(ex, "Failed to publish the distributed application."); - publishingActivity.IsError = true; - await activityReporter.UpdateActivityAsync(publishingActivity, stoppingToken).ConfigureAwait(false); + await activityReporter.UpdateActivityStatusAsync( + publishingActivity, + (status) => status with { IsError = true }, + stoppingToken).ConfigureAwait(false); if (!backchannelService.IsBackchannelExpected) { diff --git a/src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs b/src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs index bea1024aa3e..913350f4a9b 100644 --- a/src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs +++ b/src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs @@ -14,10 +14,9 @@ namespace Aspire.Hosting.Publishing; [Experimental("ASPIREPUBLISHERS001")] public sealed class PublishingActivity { - internal PublishingActivity(string id, string initialStatusText, bool isPrimary = false) + internal PublishingActivity(string id, bool isPrimary = false) { Id = id; - StatusMessage = initialStatusText; IsPrimary = isPrimary; } @@ -27,25 +26,41 @@ internal PublishingActivity(string id, string initialStatusText, bool isPrimary public string Id { get; private set; } /// - /// Status message of the publishing activity. + /// Indicates whether the publishing activity is the primary activity. /// - public string StatusMessage { get; set; } + public bool IsPrimary { get; private set; } /// - /// Indicates whether the publishing activity is complete. + /// The status text of the publishing activity. /// - public bool IsComplete { get; set; } + public PublishingActivityStatus? LastStatus { get; internal set; } +} +/// +/// Represents the status of a publishing activity. +/// +[Experimental("ASPIREPUBLISHERS001")] +public sealed record PublishingActivityStatus +{ /// - /// Indicates whether the publishing activity is the primary activity. + /// The publishing activity associated with this status. /// - public bool IsPrimary { get; private set; } + public required PublishingActivity Activity { get; init; } /// - /// Indicates whether the publishing activity has encountered an error. + /// The status text of the publishing activity. /// - public bool IsError { get; set; } + public required string StatusText { get; init; } + /// + /// Indicates whether the publishing activity is complete. + /// + public required bool IsComplete { get; init; } + + /// + /// Indicates whether the publishing activity encountered an error. + /// + public required bool IsError { get; init; } } /// @@ -73,31 +88,59 @@ public interface IPublishingActivityProgressReporter /// Updates the status of an existing publishing activity. /// /// The activity with updated properties. + /// /// The cancellation token. /// - Task UpdateActivityAsync(PublishingActivity publishingActivity, CancellationToken cancellationToken); + Task UpdateActivityStatusAsync(PublishingActivity publishingActivity, Func statusUpdate, CancellationToken cancellationToken); } internal sealed class PublishingActivityProgressReporter : IPublishingActivityProgressReporter { public async Task CreateActivityAsync(string id, string initialStatusText, bool isPrimary, CancellationToken cancellationToken) { - var publishingActivity = new PublishingActivity(id, initialStatusText, isPrimary); - await ActivitiyUpdated.Writer.WriteAsync(publishingActivity, cancellationToken).ConfigureAwait(false); + var publishingActivity = new PublishingActivity(id, isPrimary); + await UpdateActivityStatusAsync( + publishingActivity, + (status) => status with + { + StatusText = initialStatusText, + IsComplete = false, + IsError = false + }, + cancellationToken + ).ConfigureAwait(false); + return publishingActivity; } - public async Task UpdateActivityAsync(PublishingActivity publishingActivity, CancellationToken cancellationToken) + public async Task UpdateActivityStatusAsync(PublishingActivity publishingActivity, Func statusUpdate, CancellationToken cancellationToken) { - await ActivitiyUpdated.Writer.WriteAsync(publishingActivity, cancellationToken).ConfigureAwait(false); + var lastStatus = publishingActivity.LastStatus ?? new PublishingActivityStatus + { + Activity = publishingActivity, + StatusText = string.Empty, + IsComplete = false, + IsError = false + }; + + publishingActivity.LastStatus = statusUpdate(lastStatus); + + if (lastStatus == publishingActivity.LastStatus) + { + throw new DistributedApplicationException( + $"The status of the publishing activity '{publishingActivity.Id}' was not updated. The status update function must return a new instance of the status." + ); + } + + await ActivityStatusUpdated.Writer.WriteAsync(publishingActivity.LastStatus, cancellationToken).ConfigureAwait(false); - if (publishingActivity.IsPrimary && (publishingActivity.IsComplete || publishingActivity.IsError)) + if (publishingActivity.IsPrimary && (publishingActivity.LastStatus.IsComplete || publishingActivity.LastStatus.IsError)) { // If the activity is complete or an error and it is the primary activity, // we can stop listening for updates. - ActivitiyUpdated.Writer.Complete(); + ActivityStatusUpdated.Writer.Complete(); } } - internal Channel ActivitiyUpdated { get; } = Channel.CreateUnbounded(); + internal Channel ActivityStatusUpdated { get; } = Channel.CreateUnbounded(); } \ No newline at end of file diff --git a/src/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs b/src/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs index cd463079792..0ab76d76ce4 100644 --- a/src/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs +++ b/src/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs @@ -130,15 +130,17 @@ private async Task BuildProjectContainerImageAsync(IResource resource, C stdout, stderr); - publishingActivity.IsError = true; - await activityReporter.UpdateActivityAsync(publishingActivity, cancellationToken).ConfigureAwait(false); + await activityReporter.UpdateActivityStatusAsync( + publishingActivity, (status) => status with { IsError = true }, + cancellationToken).ConfigureAwait(false); throw new DistributedApplicationException($"Failed to build container image, stdout: {stdout}, stderr: {stderr}"); } else { - publishingActivity.IsComplete = true; - await activityReporter.UpdateActivityAsync(publishingActivity, cancellationToken).ConfigureAwait(false); + await activityReporter.UpdateActivityStatusAsync( + publishingActivity, (status) => status with { IsComplete = true }, + cancellationToken).ConfigureAwait(false); logger.LogDebug( ".NET CLI completed with exit code: {ExitCode}", @@ -171,8 +173,9 @@ private async Task BuildContainerImageFromDockerfileAsync(string resourc imageName, cancellationToken).ConfigureAwait(false); - publishingActivity.IsComplete = true; - await activityReporter.UpdateActivityAsync(publishingActivity, cancellationToken).ConfigureAwait(false); + await activityReporter.UpdateActivityStatusAsync( + publishingActivity, (status) => status with { IsComplete = true }, + cancellationToken).ConfigureAwait(false); return image; } @@ -180,8 +183,9 @@ private async Task BuildContainerImageFromDockerfileAsync(string resourc { logger.LogError(ex, "Failed to build container image from Dockerfile."); - publishingActivity.IsError = true; - await activityReporter.UpdateActivityAsync(publishingActivity, cancellationToken).ConfigureAwait(false); + await activityReporter.UpdateActivityStatusAsync( + publishingActivity, (status) => status with { IsError = true }, + cancellationToken).ConfigureAwait(false); throw; } From 9e952315769ed5aed2fbd47fe813919a55b3d58c Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Sun, 6 Apr 2025 23:09:05 +0000 Subject: [PATCH 2/6] Introduce lock around status updates. --- .../PublishingActivityProgressReporter.cs | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs b/src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs index 913350f4a9b..b3592b7b6fa 100644 --- a/src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs +++ b/src/Aspire.Hosting/Publishing/PublishingActivityProgressReporter.cs @@ -113,28 +113,37 @@ await UpdateActivityStatusAsync( return publishingActivity; } + private readonly object _updateLock = new object(); + public async Task UpdateActivityStatusAsync(PublishingActivity publishingActivity, Func statusUpdate, CancellationToken cancellationToken) { - var lastStatus = publishingActivity.LastStatus ?? new PublishingActivityStatus - { - Activity = publishingActivity, - StatusText = string.Empty, - IsComplete = false, - IsError = false - }; + PublishingActivityStatus? lastStatus; + PublishingActivityStatus? newStatus; - publishingActivity.LastStatus = statusUpdate(lastStatus); + lock (_updateLock) + { + lastStatus = publishingActivity.LastStatus ?? new PublishingActivityStatus + { + Activity = publishingActivity, + StatusText = string.Empty, + IsComplete = false, + IsError = false + }; + + newStatus = statusUpdate(lastStatus); + publishingActivity.LastStatus = newStatus; + } - if (lastStatus == publishingActivity.LastStatus) + if (lastStatus == newStatus) { throw new DistributedApplicationException( $"The status of the publishing activity '{publishingActivity.Id}' was not updated. The status update function must return a new instance of the status." ); } - await ActivityStatusUpdated.Writer.WriteAsync(publishingActivity.LastStatus, cancellationToken).ConfigureAwait(false); + await ActivityStatusUpdated.Writer.WriteAsync(newStatus, cancellationToken).ConfigureAwait(false); - if (publishingActivity.IsPrimary && (publishingActivity.LastStatus.IsComplete || publishingActivity.LastStatus.IsError)) + if (publishingActivity.IsPrimary && (newStatus.IsComplete || newStatus.IsError)) { // If the activity is complete or an error and it is the primary activity, // we can stop listening for updates. From 7ad5e678dfa7cf1ae0759eec66490be91694bfc6 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Sun, 6 Apr 2025 23:09:08 +0000 Subject: [PATCH 3/6] Lock on status updates. --- .../publishers/Publishers.AppHost/Chart.yaml | 11 ++ .../infra3/api-identity/api-identity.bicep | 15 ++ .../api-roles-azpg/api-roles-azpg.bicep | 21 +++ .../Publishers.AppHost/infra3/api/api.bicep | 103 +++++++++++++ .../Publishers.AppHost/infra3/azpg/azpg.bicep | 50 ++++++ .../infra3/dbsetup/dbsetup.bicep | 88 +++++++++++ .../Publishers.AppHost/infra3/env/env.bicep | 142 ++++++++++++++++++ .../infra3/frontend/frontend.bicep | 125 +++++++++++++++ .../Publishers.AppHost/infra3/main.bicep | 69 +++++++++ .../infra3/mycontainer/mycontainer.bicep | 46 ++++++ .../Publishers.AppHost/infra3/pg/pg.bicep | 60 ++++++++ .../infra3/sqlserver/sqlserver.bicep | 67 +++++++++ .../templates/api/configmap.yaml | 16 ++ .../templates/api/deployment.yaml | 39 +++++ .../templates/api/secret.yaml | 11 ++ .../templates/api/service.yaml | 19 +++ .../templates/dbsetup/configmap.yaml | 15 ++ .../templates/dbsetup/deployment.yaml | 39 +++++ .../templates/dbsetup/secret.yaml | 11 ++ .../templates/dbsetup/service.yaml | 19 +++ .../templates/frontend/configmap.yaml | 20 +++ .../templates/frontend/deployment.yaml | 39 +++++ .../templates/frontend/secret.yaml | 12 ++ .../templates/frontend/service.yaml | 19 +++ .../templates/mycontainer/deployment.yaml | 27 ++++ .../templates/pg/configmap.yaml | 12 ++ .../templates/pg/secret.yaml | 11 ++ .../templates/pg/service.yaml | 15 ++ .../templates/pg/statefulset.yaml | 35 +++++ .../templates/sqlserver/configmap.yaml | 10 ++ .../templates/sqlserver/secret.yaml | 11 ++ .../templates/sqlserver/service.yaml | 15 ++ .../templates/sqlserver/statefulset.yaml | 41 +++++ .../publishers/Publishers.AppHost/values.yaml | 51 +++++++ 34 files changed, 1284 insertions(+) create mode 100644 playground/publishers/Publishers.AppHost/Chart.yaml create mode 100644 playground/publishers/Publishers.AppHost/infra3/api-identity/api-identity.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/api-roles-azpg/api-roles-azpg.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/api/api.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/azpg/azpg.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/dbsetup/dbsetup.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/env/env.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/frontend/frontend.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/main.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/mycontainer/mycontainer.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/pg/pg.bicep create mode 100644 playground/publishers/Publishers.AppHost/infra3/sqlserver/sqlserver.bicep create mode 100644 playground/publishers/Publishers.AppHost/templates/api/configmap.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/api/deployment.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/api/secret.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/api/service.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/dbsetup/configmap.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/dbsetup/deployment.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/dbsetup/secret.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/dbsetup/service.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/frontend/configmap.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/frontend/deployment.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/frontend/secret.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/frontend/service.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/mycontainer/deployment.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/pg/configmap.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/pg/secret.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/pg/service.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/pg/statefulset.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/sqlserver/configmap.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/sqlserver/secret.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/sqlserver/service.yaml create mode 100644 playground/publishers/Publishers.AppHost/templates/sqlserver/statefulset.yaml create mode 100644 playground/publishers/Publishers.AppHost/values.yaml diff --git a/playground/publishers/Publishers.AppHost/Chart.yaml b/playground/publishers/Publishers.AppHost/Chart.yaml new file mode 100644 index 00000000000..5a1d07a4bbb --- /dev/null +++ b/playground/publishers/Publishers.AppHost/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: "v2" +name: "aspire" +version: "0.1.0" +kubeVersion: ">= 1.18.0-0" +description: "Aspire Helm Chart" +type: "application" +keywords: + - "aspire" + - "kubernetes" +appVersion: "0.1.0" +deprecated: false diff --git a/playground/publishers/Publishers.AppHost/infra3/api-identity/api-identity.bicep b/playground/publishers/Publishers.AppHost/infra3/api-identity/api-identity.bicep new file mode 100644 index 00000000000..0ff5902d5b0 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/api-identity/api-identity.bicep @@ -0,0 +1,15 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +resource api_identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { + name: take('api_identity-${uniqueString(resourceGroup().id)}', 128) + location: location +} + +output id string = api_identity.id + +output clientId string = api_identity.properties.clientId + +output principalId string = api_identity.properties.principalId + +output principalName string = api_identity.name \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/api-roles-azpg/api-roles-azpg.bicep b/playground/publishers/Publishers.AppHost/infra3/api-roles-azpg/api-roles-azpg.bicep new file mode 100644 index 00000000000..5595e0de2aa --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/api-roles-azpg/api-roles-azpg.bicep @@ -0,0 +1,21 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +param azpg_outputs_name string + +param principalId string + +param principalName string + +resource azpg 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' existing = { + name: azpg_outputs_name +} + +resource azpg_admin 'Microsoft.DBforPostgreSQL/flexibleServers/administrators@2024-08-01' = { + name: principalId + properties: { + principalName: principalName + principalType: 'ServicePrincipal' + } + parent: azpg +} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/api/api.bicep b/playground/publishers/Publishers.AppHost/infra3/api/api.bicep new file mode 100644 index 00000000000..c6d4f85bc2e --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/api/api.bicep @@ -0,0 +1,103 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +param api_identity_outputs_id string + +param api_identity_outputs_clientid string + +param api_containerport string + +@secure() +param pg_password_value string + +param azpg_outputs_connectionstring string + +param env_outputs_azure_container_apps_environment_default_domain string + +param env_outputs_azure_container_apps_environment_id string + +param env_outputs_azure_container_registry_endpoint string + +param env_outputs_azure_container_registry_managed_identity_id string + +param api_containerimage string + +resource api 'Microsoft.App/containerApps@2024-03-01' = { + name: 'api' + location: location + properties: { + configuration: { + secrets: [ + { + name: 'connectionstrings--db' + value: 'Host=pg;Port=5432;Username=postgres;Password=${pg_password_value};Database=db' + } + ] + activeRevisionsMode: 'Single' + ingress: { + external: true + targetPort: api_containerport + transport: 'http' + } + registries: [ + { + server: env_outputs_azure_container_registry_endpoint + identity: env_outputs_azure_container_registry_managed_identity_id + } + ] + } + environmentId: env_outputs_azure_container_apps_environment_id + template: { + containers: [ + { + image: api_containerimage + name: 'api' + env: [ + { + name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES' + value: 'true' + } + { + name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES' + value: 'true' + } + { + name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY' + value: 'in_memory' + } + { + name: 'ASPNETCORE_FORWARDEDHEADERS_ENABLED' + value: 'true' + } + { + name: 'HTTP_PORTS' + value: api_containerport + } + { + name: 'ConnectionStrings__db' + secretRef: 'connectionstrings--db' + } + { + name: 'ConnectionStrings__azdb' + value: '${azpg_outputs_connectionstring};Database=azdb' + } + { + name: 'AZURE_CLIENT_ID' + value: api_identity_outputs_clientid + } + ] + } + ] + scale: { + minReplicas: 2 + } + } + } + identity: { + type: 'UserAssigned' + userAssignedIdentities: { + '${api_identity_outputs_id}': { } + '${env_outputs_azure_container_registry_managed_identity_id}': { } + } + } +} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/azpg/azpg.bicep b/playground/publishers/Publishers.AppHost/infra3/azpg/azpg.bicep new file mode 100644 index 00000000000..426bcd63e72 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/azpg/azpg.bicep @@ -0,0 +1,50 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +resource azpg 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' = { + name: take('azpg-${uniqueString(resourceGroup().id)}', 63) + location: location + properties: { + authConfig: { + activeDirectoryAuth: 'Enabled' + passwordAuth: 'Disabled' + } + availabilityZone: '1' + backup: { + backupRetentionDays: 7 + geoRedundantBackup: 'Disabled' + } + highAvailability: { + mode: 'Disabled' + } + storage: { + storageSizeGB: 32 + } + version: '16' + } + sku: { + name: 'Standard_B1ms' + tier: 'Burstable' + } + tags: { + 'aspire-resource-name': 'azpg' + } +} + +resource postgreSqlFirewallRule_AllowAllAzureIps 'Microsoft.DBforPostgreSQL/flexibleServers/firewallRules@2024-08-01' = { + name: 'AllowAllAzureIps' + properties: { + endIpAddress: '0.0.0.0' + startIpAddress: '0.0.0.0' + } + parent: azpg +} + +resource azdb 'Microsoft.DBforPostgreSQL/flexibleServers/databases@2024-08-01' = { + name: 'azdb' + parent: azpg +} + +output connectionString string = 'Host=${azpg.properties.fullyQualifiedDomainName}' + +output name string = azpg.name \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/dbsetup/dbsetup.bicep b/playground/publishers/Publishers.AppHost/infra3/dbsetup/dbsetup.bicep new file mode 100644 index 00000000000..16787ec94f1 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/dbsetup/dbsetup.bicep @@ -0,0 +1,88 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +param dbsetup_containerport string + +@secure() +param pg_password_value string + +param env_outputs_azure_container_apps_environment_default_domain string + +param env_outputs_azure_container_apps_environment_id string + +param env_outputs_azure_container_registry_endpoint string + +param env_outputs_azure_container_registry_managed_identity_id string + +param dbsetup_containerimage string + +resource dbsetup 'Microsoft.App/containerApps@2024-03-01' = { + name: 'dbsetup' + location: location + properties: { + configuration: { + secrets: [ + { + name: 'connectionstrings--db' + value: 'Host=pg;Port=5432;Username=postgres;Password=${pg_password_value};Database=db' + } + ] + activeRevisionsMode: 'Single' + ingress: { + external: false + targetPort: dbsetup_containerport + transport: 'http' + } + registries: [ + { + server: env_outputs_azure_container_registry_endpoint + identity: env_outputs_azure_container_registry_managed_identity_id + } + ] + } + environmentId: env_outputs_azure_container_apps_environment_id + template: { + containers: [ + { + image: dbsetup_containerimage + name: 'dbsetup' + env: [ + { + name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES' + value: 'true' + } + { + name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES' + value: 'true' + } + { + name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY' + value: 'in_memory' + } + { + name: 'ASPNETCORE_FORWARDEDHEADERS_ENABLED' + value: 'true' + } + { + name: 'HTTP_PORTS' + value: dbsetup_containerport + } + { + name: 'ConnectionStrings__db' + secretRef: 'connectionstrings--db' + } + ] + } + ] + scale: { + minReplicas: 1 + } + } + } + identity: { + type: 'UserAssigned' + userAssignedIdentities: { + '${env_outputs_azure_container_registry_managed_identity_id}': { } + } + } +} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/env/env.bicep b/playground/publishers/Publishers.AppHost/infra3/env/env.bicep new file mode 100644 index 00000000000..f3c8886059e --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/env/env.bicep @@ -0,0 +1,142 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +param userPrincipalId string + +param tags object = { } + +resource mi 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { + name: take('mi-${uniqueString(resourceGroup().id)}', 128) + location: location + tags: tags +} + +resource acr 'Microsoft.ContainerRegistry/registries@2023-07-01' = { + name: take('acr${uniqueString(resourceGroup().id)}', 50) + location: location + sku: { + name: 'Basic' + } + tags: tags +} + +resource acr_mi_AcrPull 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid(acr.id, mi.id, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d')) + properties: { + principalId: mi.properties.principalId + roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') + principalType: 'ServicePrincipal' + } + scope: acr +} + +resource law 'Microsoft.OperationalInsights/workspaces@2023-09-01' = { + name: take('law-${uniqueString(resourceGroup().id)}', 63) + location: location + properties: { + sku: { + name: 'PerGB2018' + } + } + tags: tags +} + +resource cae 'Microsoft.App/managedEnvironments@2024-03-01' = { + name: take('cae${uniqueString(resourceGroup().id)}', 24) + location: location + properties: { + appLogsConfiguration: { + destination: 'log-analytics' + logAnalyticsConfiguration: { + customerId: law.properties.customerId + sharedKey: law.listKeys().primarySharedKey + } + } + workloadProfiles: [ + { + name: 'consumption' + workloadProfileType: 'Consumption' + } + ] + } + tags: tags +} + +resource aspireDashboard 'Microsoft.App/managedEnvironments/dotNetComponents@2024-10-02-preview' = { + name: 'aspire-dashboard' + properties: { + componentType: 'AspireDashboard' + } + parent: cae +} + +resource cae_Contributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid(cae.id, userPrincipalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')) + properties: { + principalId: userPrincipalId + roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c') + } + scope: cae +} + +resource storageVolume 'Microsoft.Storage/storageAccounts@2024-01-01' = { + name: take('storagevolume${uniqueString(resourceGroup().id)}', 24) + kind: 'StorageV2' + location: location + sku: { + name: 'Standard_LRS' + } + properties: { + largeFileSharesState: 'Enabled' + } + tags: tags +} + +resource storageVolumeFileService 'Microsoft.Storage/storageAccounts/fileServices@2024-01-01' = { + name: 'default' + parent: storageVolume +} + +resource shares_volumes_sqlserver_0 'Microsoft.Storage/storageAccounts/fileServices/shares@2024-01-01' = { + name: take('sharesvolumessqlserver0-${uniqueString(resourceGroup().id)}', 63) + properties: { + enabledProtocols: 'SMB' + shareQuota: 1024 + } + parent: storageVolumeFileService +} + +resource managedStorage_volumes_sqlserver_0 'Microsoft.App/managedEnvironments/storages@2024-03-01' = { + name: take('managedstoragevolumessqlserver${uniqueString(resourceGroup().id)}', 24) + properties: { + azureFile: { + accountName: storageVolume.name + accountKey: storageVolume.listKeys().keys[0].value + accessMode: 'ReadWrite' + shareName: shares_volumes_sqlserver_0.name + } + } + parent: cae +} + +output volumes_sqlserver_0 string = managedStorage_volumes_sqlserver_0.name + +output MANAGED_IDENTITY_NAME string = mi.name + +output MANAGED_IDENTITY_PRINCIPAL_ID string = mi.properties.principalId + +output AZURE_LOG_ANALYTICS_WORKSPACE_NAME string = law.name + +output AZURE_LOG_ANALYTICS_WORKSPACE_ID string = law.id + +output AZURE_CONTAINER_REGISTRY_NAME string = acr.name + +output AZURE_CONTAINER_REGISTRY_ENDPOINT string = acr.properties.loginServer + +output AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID string = mi.id + +output AZURE_CONTAINER_APPS_ENVIRONMENT_NAME string = cae.name + +output AZURE_CONTAINER_APPS_ENVIRONMENT_ID string = cae.id + +output AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAIN string = cae.properties.defaultDomain \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/frontend/frontend.bicep b/playground/publishers/Publishers.AppHost/infra3/frontend/frontend.bicep new file mode 100644 index 00000000000..be74c41e775 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/frontend/frontend.bicep @@ -0,0 +1,125 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +param frontend_containerport string + +@secure() +param sqlserver_password_value string + +param param0_value string + +@secure() +param param1_value string + +param param2_value string + +param param3_value string + +param env_outputs_azure_container_apps_environment_default_domain string + +param env_outputs_azure_container_apps_environment_id string + +param env_outputs_azure_container_registry_endpoint string + +param env_outputs_azure_container_registry_managed_identity_id string + +param frontend_containerimage string + +resource frontend 'Microsoft.App/containerApps@2024-03-01' = { + name: 'frontend' + location: location + properties: { + configuration: { + secrets: [ + { + name: 'connectionstrings--sqldb' + value: 'Server=sqlserver,1433;User ID=sa;Password=${sqlserver_password_value};TrustServerCertificate=true;Initial Catalog=sqldb' + } + { + name: 'p1' + value: param1_value + } + ] + activeRevisionsMode: 'Single' + ingress: { + external: false + targetPort: frontend_containerport + transport: 'http' + } + registries: [ + { + server: env_outputs_azure_container_registry_endpoint + identity: env_outputs_azure_container_registry_managed_identity_id + } + ] + } + environmentId: env_outputs_azure_container_apps_environment_id + template: { + containers: [ + { + image: frontend_containerimage + name: 'frontend' + env: [ + { + name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES' + value: 'true' + } + { + name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES' + value: 'true' + } + { + name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY' + value: 'in_memory' + } + { + name: 'ASPNETCORE_FORWARDEDHEADERS_ENABLED' + value: 'true' + } + { + name: 'HTTP_PORTS' + value: frontend_containerport + } + { + name: 'ConnectionStrings__sqldb' + secretRef: 'connectionstrings--sqldb' + } + { + name: 'P0' + value: param0_value + } + { + name: 'P1' + secretRef: 'p1' + } + { + name: 'P2' + value: param2_value + } + { + name: 'P3' + value: param3_value + } + { + name: 'services__api__http__0' + value: 'http://api.${env_outputs_azure_container_apps_environment_default_domain}' + } + { + name: 'services__api__https__0' + value: 'https://api.${env_outputs_azure_container_apps_environment_default_domain}' + } + ] + } + ] + scale: { + minReplicas: 1 + } + } + } + identity: { + type: 'UserAssigned' + userAssignedIdentities: { + '${env_outputs_azure_container_registry_managed_identity_id}': { } + } + } +} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/main.bicep b/playground/publishers/Publishers.AppHost/infra3/main.bicep new file mode 100644 index 00000000000..b92e0068d99 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/main.bicep @@ -0,0 +1,69 @@ +targetScope = 'subscription' + +param environmentName string + +param location string + +param principalId string + +var tags = { + 'aspire-env-name': environmentName +} + +resource rg 'Microsoft.Resources/resourceGroups@2023-07-01' = { + name: 'rg-${environmentName}' + location: location + tags: tags +} + +module env 'env/env.bicep' = { + name: 'env' + scope: rg + params: { + location: location + userPrincipalId: principalId + } +} + +module azpg 'azpg/azpg.bicep' = { + name: 'azpg' + scope: rg + params: { + location: location + } +} + +module api_identity 'api-identity/api-identity.bicep' = { + name: 'api-identity' + scope: rg + params: { + location: location + } +} + +module api_roles_azpg 'api-roles-azpg/api-roles-azpg.bicep' = { + name: 'api-roles-azpg' + scope: rg + params: { + location: location + azpg_outputs_name: azpg.outputs.name + principalId: api_identity.outputs.principalId + principalName: api_identity.outputs.principalName + } +} + +output env_AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAIN string = env.outputs.AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAIN + +output env_AZURE_CONTAINER_APPS_ENVIRONMENT_ID string = env.outputs.AZURE_CONTAINER_APPS_ENVIRONMENT_ID + +output env_AZURE_CONTAINER_REGISTRY_ENDPOINT string = env.outputs.AZURE_CONTAINER_REGISTRY_ENDPOINT + +output env_AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID string = env.outputs.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID + +output api_identity_id string = api_identity.outputs.id + +output api_identity_clientId string = api_identity.outputs.clientId + +output azpg_connectionString string = azpg.outputs.connectionString + +output env_volumes_sqlserver_0 string = env.outputs.volumes_sqlserver_0 \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/mycontainer/mycontainer.bicep b/playground/publishers/Publishers.AppHost/infra3/mycontainer/mycontainer.bicep new file mode 100644 index 00000000000..6ea5829dd4f --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/mycontainer/mycontainer.bicep @@ -0,0 +1,46 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +param env_outputs_azure_container_apps_environment_default_domain string + +param env_outputs_azure_container_apps_environment_id string + +param env_outputs_azure_container_registry_endpoint string + +param env_outputs_azure_container_registry_managed_identity_id string + +param mycontainer_containerimage string + +resource mycontainer 'Microsoft.App/containerApps@2024-03-01' = { + name: 'mycontainer' + location: location + properties: { + configuration: { + activeRevisionsMode: 'Single' + registries: [ + { + server: env_outputs_azure_container_registry_endpoint + identity: env_outputs_azure_container_registry_managed_identity_id + } + ] + } + environmentId: env_outputs_azure_container_apps_environment_id + template: { + containers: [ + { + image: mycontainer_containerimage + name: 'mycontainer' + } + ] + scale: { + minReplicas: 1 + } + } + } + identity: { + type: 'UserAssigned' + userAssignedIdentities: { + '${env_outputs_azure_container_registry_managed_identity_id}': { } + } + } +} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/pg/pg.bicep b/playground/publishers/Publishers.AppHost/infra3/pg/pg.bicep new file mode 100644 index 00000000000..a3f7c55bc68 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/pg/pg.bicep @@ -0,0 +1,60 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +@secure() +param pg_password_value string + +param env_outputs_azure_container_apps_environment_default_domain string + +param env_outputs_azure_container_apps_environment_id string + +resource pg 'Microsoft.App/containerApps@2024-03-01' = { + name: 'pg' + location: location + properties: { + configuration: { + secrets: [ + { + name: 'postgres-password' + value: pg_password_value + } + ] + activeRevisionsMode: 'Single' + ingress: { + external: false + targetPort: 5432 + transport: 'tcp' + } + } + environmentId: env_outputs_azure_container_apps_environment_id + template: { + containers: [ + { + image: 'docker.io/library/postgres:17.2' + name: 'pg' + env: [ + { + name: 'POSTGRES_HOST_AUTH_METHOD' + value: 'scram-sha-256' + } + { + name: 'POSTGRES_INITDB_ARGS' + value: '--auth-host=scram-sha-256 --auth-local=scram-sha-256' + } + { + name: 'POSTGRES_USER' + value: 'postgres' + } + { + name: 'POSTGRES_PASSWORD' + secretRef: 'postgres-password' + } + ] + } + ] + scale: { + minReplicas: 1 + } + } + } +} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/sqlserver/sqlserver.bicep b/playground/publishers/Publishers.AppHost/infra3/sqlserver/sqlserver.bicep new file mode 100644 index 00000000000..c6463c3d229 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/infra3/sqlserver/sqlserver.bicep @@ -0,0 +1,67 @@ +@description('The location for the resource(s) to be deployed.') +param location string = resourceGroup().location + +param env_outputs_volumes_sqlserver_0 string + +@secure() +param sqlserver_password_value string + +param env_outputs_azure_container_apps_environment_default_domain string + +param env_outputs_azure_container_apps_environment_id string + +resource sqlserver 'Microsoft.App/containerApps@2024-03-01' = { + name: 'sqlserver' + location: location + properties: { + configuration: { + secrets: [ + { + name: 'mssql-sa-password' + value: sqlserver_password_value + } + ] + activeRevisionsMode: 'Single' + ingress: { + external: false + targetPort: 1433 + transport: 'tcp' + } + } + environmentId: env_outputs_azure_container_apps_environment_id + template: { + containers: [ + { + image: 'mcr.microsoft.com/mssql/server:2022-latest' + name: 'sqlserver' + env: [ + { + name: 'ACCEPT_EULA' + value: 'Y' + } + { + name: 'MSSQL_SA_PASSWORD' + secretRef: 'mssql-sa-password' + } + ] + volumeMounts: [ + { + volumeName: 'v0' + mountPath: '/var/opt/mssql' + } + ] + } + ] + scale: { + minReplicas: 1 + } + volumes: [ + { + name: 'v0' + storageType: 'AzureFile' + storageName: env_outputs_volumes_sqlserver_0 + } + ] + } + } +} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/templates/api/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/api/configmap.yaml new file mode 100644 index 00000000000..cf785ff9f26 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/api/configmap.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: "v1" +kind: "ConfigMap" +metadata: + name: "api-config" + labels: + app: "aspire" + component: "api" +data: + ASPNETCORE_URLS: "{{ .Values.config.api.ASPNETCORE_URLS }}" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "{{ .Values.config.api.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES }}" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "{{ .Values.config.api.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES }}" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "{{ .Values.config.api.OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY }}" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "{{ .Values.config.api.ASPNETCORE_FORWARDEDHEADERS_ENABLED }}" + HTTP_PORTS: "{{ .Values.config.api.HTTP_PORTS }}" + ConnectionStrings__azdb: "{{ .Values.config.api.ConnectionStrings__azdb }}" diff --git a/playground/publishers/Publishers.AppHost/templates/api/deployment.yaml b/playground/publishers/Publishers.AppHost/templates/api/deployment.yaml new file mode 100644 index 00000000000..383a883eb9d --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/api/deployment.yaml @@ -0,0 +1,39 @@ +--- +apiVersion: "apps/v1" +kind: "Deployment" +metadata: + name: "api-deployment" +spec: + template: + metadata: + labels: + app: "aspire" + component: "api" + spec: + containers: + - image: "{{ .Values.parameters.api.api_image }}" + name: "api" + envFrom: + - configMapRef: + name: "api-config" + - secretRef: + name: "api-secrets" + ports: + - name: "http" + protocol: "TCP" + containerPort: "{{ .Values.parameters.api.port_http }}" + - name: "https" + protocol: "TCP" + containerPort: "{{ .Values.parameters.api.port_https }}" + imagePullPolicy: "IfNotPresent" + selector: + matchLabels: + app: "aspire" + component: "api" + replicas: 2 + revisionHistoryLimit: 3 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/api/secret.yaml b/playground/publishers/Publishers.AppHost/templates/api/secret.yaml new file mode 100644 index 00000000000..3f8cdfcae46 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/api/secret.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: "v1" +kind: "Secret" +metadata: + name: "api-secrets" + labels: + app: "aspire" + component: "api" +stringData: + ConnectionStrings__db: "Host=pg;Port=5432;Username=postgres;Password={{ .Values.secrets.api.pg_password }};Database=db" +type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/api/service.yaml b/playground/publishers/Publishers.AppHost/templates/api/service.yaml new file mode 100644 index 00000000000..31a9369c772 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/api/service.yaml @@ -0,0 +1,19 @@ +--- +apiVersion: "v1" +kind: "Service" +metadata: + name: "api-service" +spec: + type: "ClusterIP" + selector: + app: "aspire" + component: "api" + ports: + - name: "http" + protocol: "TCP" + port: "{{ .Values.parameters.api.port_http }}" + targetPort: "{{ .Values.parameters.api.port_http }}" + - name: "https" + protocol: "TCP" + port: "{{ .Values.parameters.api.port_https }}" + targetPort: "{{ .Values.parameters.api.port_https }}" diff --git a/playground/publishers/Publishers.AppHost/templates/dbsetup/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/dbsetup/configmap.yaml new file mode 100644 index 00000000000..ef9f984cbd3 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/dbsetup/configmap.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: "v1" +kind: "ConfigMap" +metadata: + name: "dbsetup-config" + labels: + app: "aspire" + component: "dbsetup" +data: + ASPNETCORE_URLS: "{{ .Values.config.dbsetup.ASPNETCORE_URLS }}" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "{{ .Values.config.dbsetup.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES }}" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "{{ .Values.config.dbsetup.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES }}" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "{{ .Values.config.dbsetup.OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY }}" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "{{ .Values.config.dbsetup.ASPNETCORE_FORWARDEDHEADERS_ENABLED }}" + HTTP_PORTS: "{{ .Values.config.dbsetup.HTTP_PORTS }}" diff --git a/playground/publishers/Publishers.AppHost/templates/dbsetup/deployment.yaml b/playground/publishers/Publishers.AppHost/templates/dbsetup/deployment.yaml new file mode 100644 index 00000000000..1406e8f9b4e --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/dbsetup/deployment.yaml @@ -0,0 +1,39 @@ +--- +apiVersion: "apps/v1" +kind: "Deployment" +metadata: + name: "dbsetup-deployment" +spec: + template: + metadata: + labels: + app: "aspire" + component: "dbsetup" + spec: + containers: + - image: "{{ .Values.parameters.dbsetup.dbsetup_image }}" + name: "dbsetup" + envFrom: + - configMapRef: + name: "dbsetup-config" + - secretRef: + name: "dbsetup-secrets" + ports: + - name: "http" + protocol: "TCP" + containerPort: "{{ .Values.parameters.dbsetup.port_http }}" + - name: "https" + protocol: "TCP" + containerPort: "{{ .Values.parameters.dbsetup.port_https }}" + imagePullPolicy: "IfNotPresent" + selector: + matchLabels: + app: "aspire" + component: "dbsetup" + replicas: 1 + revisionHistoryLimit: 3 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/dbsetup/secret.yaml b/playground/publishers/Publishers.AppHost/templates/dbsetup/secret.yaml new file mode 100644 index 00000000000..f55c0ad9d2a --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/dbsetup/secret.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: "v1" +kind: "Secret" +metadata: + name: "dbsetup-secrets" + labels: + app: "aspire" + component: "dbsetup" +stringData: + ConnectionStrings__db: "Host=pg;Port=5432;Username=postgres;Password={{ .Values.secrets.dbsetup.pg_password }};Database=db" +type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/dbsetup/service.yaml b/playground/publishers/Publishers.AppHost/templates/dbsetup/service.yaml new file mode 100644 index 00000000000..4e32e2effb4 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/dbsetup/service.yaml @@ -0,0 +1,19 @@ +--- +apiVersion: "v1" +kind: "Service" +metadata: + name: "dbsetup-service" +spec: + type: "ClusterIP" + selector: + app: "aspire" + component: "dbsetup" + ports: + - name: "http" + protocol: "TCP" + port: "{{ .Values.parameters.dbsetup.port_http }}" + targetPort: "{{ .Values.parameters.dbsetup.port_http }}" + - name: "https" + protocol: "TCP" + port: "{{ .Values.parameters.dbsetup.port_https }}" + targetPort: "{{ .Values.parameters.dbsetup.port_https }}" diff --git a/playground/publishers/Publishers.AppHost/templates/frontend/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/frontend/configmap.yaml new file mode 100644 index 00000000000..d5c5730262a --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/frontend/configmap.yaml @@ -0,0 +1,20 @@ +--- +apiVersion: "v1" +kind: "ConfigMap" +metadata: + name: "frontend-config" + labels: + app: "aspire" + component: "frontend" +data: + ASPNETCORE_URLS: "{{ .Values.config.frontend.ASPNETCORE_URLS }}" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "{{ .Values.config.frontend.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES }}" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "{{ .Values.config.frontend.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES }}" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "{{ .Values.config.frontend.OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY }}" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "{{ .Values.config.frontend.ASPNETCORE_FORWARDEDHEADERS_ENABLED }}" + HTTP_PORTS: "{{ .Values.config.frontend.HTTP_PORTS }}" + P0: "{{ .Values.config.frontend.param0 }}" + P2: "{{ .Values.config.frontend.param2 }}" + P3: "{{ .Values.config.frontend.param3 }}" + services__api__http__0: "{{ .Values.config.frontend.services__api__http__0 }}" + services__api__https__0: "{{ .Values.config.frontend.services__api__https__0 }}" diff --git a/playground/publishers/Publishers.AppHost/templates/frontend/deployment.yaml b/playground/publishers/Publishers.AppHost/templates/frontend/deployment.yaml new file mode 100644 index 00000000000..59919fb60d8 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/frontend/deployment.yaml @@ -0,0 +1,39 @@ +--- +apiVersion: "apps/v1" +kind: "Deployment" +metadata: + name: "frontend-deployment" +spec: + template: + metadata: + labels: + app: "aspire" + component: "frontend" + spec: + containers: + - image: "{{ .Values.parameters.frontend.frontend_image }}" + name: "frontend" + envFrom: + - configMapRef: + name: "frontend-config" + - secretRef: + name: "frontend-secrets" + ports: + - name: "http" + protocol: "TCP" + containerPort: "{{ .Values.parameters.frontend.port_http }}" + - name: "https" + protocol: "TCP" + containerPort: "{{ .Values.parameters.frontend.port_https }}" + imagePullPolicy: "IfNotPresent" + selector: + matchLabels: + app: "aspire" + component: "frontend" + replicas: 1 + revisionHistoryLimit: 3 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/frontend/secret.yaml b/playground/publishers/Publishers.AppHost/templates/frontend/secret.yaml new file mode 100644 index 00000000000..ea35ce853d4 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/frontend/secret.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: "v1" +kind: "Secret" +metadata: + name: "frontend-secrets" + labels: + app: "aspire" + component: "frontend" +stringData: + ConnectionStrings__sqldb: "Server=sqlserver,1433;User ID=sa;Password={{ .Values.secrets.frontend.sqlserver_password }};TrustServerCertificate=true;Initial Catalog=sqldb" + P1: "{{ .Values.secrets.frontend.param1 }}" +type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/frontend/service.yaml b/playground/publishers/Publishers.AppHost/templates/frontend/service.yaml new file mode 100644 index 00000000000..62f12befd1a --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/frontend/service.yaml @@ -0,0 +1,19 @@ +--- +apiVersion: "v1" +kind: "Service" +metadata: + name: "frontend-service" +spec: + type: "ClusterIP" + selector: + app: "aspire" + component: "frontend" + ports: + - name: "http" + protocol: "TCP" + port: "{{ .Values.parameters.frontend.port_http }}" + targetPort: "{{ .Values.parameters.frontend.port_http }}" + - name: "https" + protocol: "TCP" + port: "{{ .Values.parameters.frontend.port_https }}" + targetPort: "{{ .Values.parameters.frontend.port_https }}" diff --git a/playground/publishers/Publishers.AppHost/templates/mycontainer/deployment.yaml b/playground/publishers/Publishers.AppHost/templates/mycontainer/deployment.yaml new file mode 100644 index 00000000000..ba71245de8b --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/mycontainer/deployment.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: "apps/v1" +kind: "Deployment" +metadata: + name: "mycontainer-deployment" +spec: + template: + metadata: + labels: + app: "aspire" + component: "mycontainer" + spec: + containers: + - image: "{{ .Values.parameters.mycontainer.mycontainer_image }}" + name: "mycontainer" + imagePullPolicy: "IfNotPresent" + selector: + matchLabels: + app: "aspire" + component: "mycontainer" + replicas: 1 + revisionHistoryLimit: 3 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/pg/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/pg/configmap.yaml new file mode 100644 index 00000000000..6ea40d0e9db --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/pg/configmap.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: "v1" +kind: "ConfigMap" +metadata: + name: "pg-config" + labels: + app: "aspire" + component: "pg" +data: + POSTGRES_HOST_AUTH_METHOD: "{{ .Values.config.pg.POSTGRES_HOST_AUTH_METHOD }}" + POSTGRES_INITDB_ARGS: "{{ .Values.config.pg.POSTGRES_INITDB_ARGS }}" + POSTGRES_USER: "{{ .Values.config.pg.POSTGRES_USER }}" diff --git a/playground/publishers/Publishers.AppHost/templates/pg/secret.yaml b/playground/publishers/Publishers.AppHost/templates/pg/secret.yaml new file mode 100644 index 00000000000..84b47a73466 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/pg/secret.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: "v1" +kind: "Secret" +metadata: + name: "pg-secrets" + labels: + app: "aspire" + component: "pg" +stringData: + POSTGRES_PASSWORD: "{{ .Values.secrets.pg.pg_password }}" +type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/pg/service.yaml b/playground/publishers/Publishers.AppHost/templates/pg/service.yaml new file mode 100644 index 00000000000..cb9ebaebc84 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/pg/service.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: "v1" +kind: "Service" +metadata: + name: "pg-service" +spec: + type: "ClusterIP" + selector: + app: "aspire" + component: "pg" + ports: + - name: "tcp" + protocol: "TCP" + port: "5432" + targetPort: "5432" diff --git a/playground/publishers/Publishers.AppHost/templates/pg/statefulset.yaml b/playground/publishers/Publishers.AppHost/templates/pg/statefulset.yaml new file mode 100644 index 00000000000..8c2d91d28e8 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/pg/statefulset.yaml @@ -0,0 +1,35 @@ +--- +apiVersion: "apps/v1" +kind: "StatefulSet" +metadata: + name: "pg-statefulset" +spec: + template: + metadata: + labels: + app: "aspire" + component: "pg" + spec: + containers: + - image: "docker.io/library/postgres:17.2" + name: "pg" + envFrom: + - configMapRef: + name: "pg-config" + - secretRef: + name: "pg-secrets" + ports: + - name: "tcp" + protocol: "TCP" + containerPort: "5432" + imagePullPolicy: "IfNotPresent" + selector: + matchLabels: + app: "aspire" + component: "pg" + replicas: 1 + persistentVolumeClaimRetentionPolicy: {} + updateStrategy: + rollingUpdate: + maxUnavailable: 0 + type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/sqlserver/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/sqlserver/configmap.yaml new file mode 100644 index 00000000000..90584c45b63 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/sqlserver/configmap.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: "v1" +kind: "ConfigMap" +metadata: + name: "sqlserver-config" + labels: + app: "aspire" + component: "sqlserver" +data: + ACCEPT_EULA: "{{ .Values.config.sqlserver.ACCEPT_EULA }}" diff --git a/playground/publishers/Publishers.AppHost/templates/sqlserver/secret.yaml b/playground/publishers/Publishers.AppHost/templates/sqlserver/secret.yaml new file mode 100644 index 00000000000..5945a5e8857 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/sqlserver/secret.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: "v1" +kind: "Secret" +metadata: + name: "sqlserver-secrets" + labels: + app: "aspire" + component: "sqlserver" +stringData: + MSSQL_SA_PASSWORD: "{{ .Values.secrets.sqlserver.sqlserver_password }}" +type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/sqlserver/service.yaml b/playground/publishers/Publishers.AppHost/templates/sqlserver/service.yaml new file mode 100644 index 00000000000..d27d930c3cb --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/sqlserver/service.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: "v1" +kind: "Service" +metadata: + name: "sqlserver-service" +spec: + type: "ClusterIP" + selector: + app: "aspire" + component: "sqlserver" + ports: + - name: "tcp" + protocol: "TCP" + port: "1433" + targetPort: "1433" diff --git a/playground/publishers/Publishers.AppHost/templates/sqlserver/statefulset.yaml b/playground/publishers/Publishers.AppHost/templates/sqlserver/statefulset.yaml new file mode 100644 index 00000000000..97745895b16 --- /dev/null +++ b/playground/publishers/Publishers.AppHost/templates/sqlserver/statefulset.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: "apps/v1" +kind: "StatefulSet" +metadata: + name: "sqlserver-statefulset" +spec: + template: + metadata: + labels: + app: "aspire" + component: "sqlserver" + spec: + containers: + - image: "mcr.microsoft.com/mssql/server:2022-latest" + name: "sqlserver" + envFrom: + - configMapRef: + name: "sqlserver-config" + - secretRef: + name: "sqlserver-secrets" + ports: + - name: "tcp" + protocol: "TCP" + containerPort: "1433" + volumeMounts: + - name: "sqlserver-data" + mountPath: "/var/opt/mssql" + imagePullPolicy: "IfNotPresent" + volumes: + - name: "sqlserver-data" + emptyDir: {} + selector: + matchLabels: + app: "aspire" + component: "sqlserver" + replicas: 1 + persistentVolumeClaimRetentionPolicy: {} + updateStrategy: + rollingUpdate: + maxUnavailable: 0 + type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/values.yaml b/playground/publishers/Publishers.AppHost/values.yaml new file mode 100644 index 00000000000..38e2b57de5d --- /dev/null +++ b/playground/publishers/Publishers.AppHost/values.yaml @@ -0,0 +1,51 @@ +parameters: + dbsetup: + port_http: "8080" + port_https: "8080" + dbsetup_image: "dbsetup:latest" + api: + port_http: "8080" + port_https: "8080" + api_image: "api:latest" + frontend: + port_http: "8080" + port_https: "8080" + frontend_image: "frontend:latest" + mycontainer: + mycontainer_image: "mycontainer:latest" +secrets: + pg: + POSTGRES_PASSWORD: "" + sqlserver: + MSSQL_SA_PASSWORD: "" + frontend: + P1: "" +config: + pg: + POSTGRES_HOST_AUTH_METHOD: "scram-sha-256" + POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256 --auth-local=scram-sha-256" + POSTGRES_USER: "postgres" + dbsetup: + ASPNETCORE_URLS: "http://+:$8080" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" + api: + ASPNETCORE_URLS: "http://+:$8080" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" + ConnectionStrings__azdb: "{azpg.outputs.connectionString};Database=azdb" + sqlserver: + ACCEPT_EULA: "Y" + frontend: + ASPNETCORE_URLS: "http://+:$8080" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" + OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" + ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" + P0: "" + P2: "default" + P3: "" From 73a3e5afe68e7577a78c84cb837ebc11f450723d Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Mon, 7 Apr 2025 01:07:17 +0000 Subject: [PATCH 4/6] Clean out unnecessary files from PR. --- .../publishers/Publishers.AppHost/Chart.yaml | 11 -- .../infra3/api-identity/api-identity.bicep | 15 -- .../api-roles-azpg/api-roles-azpg.bicep | 21 --- .../Publishers.AppHost/infra3/api/api.bicep | 103 ------------- .../Publishers.AppHost/infra3/azpg/azpg.bicep | 50 ------ .../infra3/dbsetup/dbsetup.bicep | 88 ----------- .../Publishers.AppHost/infra3/env/env.bicep | 142 ------------------ .../infra3/frontend/frontend.bicep | 125 --------------- .../Publishers.AppHost/infra3/main.bicep | 69 --------- .../infra3/mycontainer/mycontainer.bicep | 46 ------ .../Publishers.AppHost/infra3/pg/pg.bicep | 60 -------- .../infra3/sqlserver/sqlserver.bicep | 67 --------- .../templates/api/configmap.yaml | 16 -- .../templates/api/deployment.yaml | 39 ----- .../templates/api/secret.yaml | 11 -- .../templates/api/service.yaml | 19 --- .../templates/dbsetup/configmap.yaml | 15 -- .../templates/dbsetup/deployment.yaml | 39 ----- .../templates/dbsetup/secret.yaml | 11 -- .../templates/dbsetup/service.yaml | 19 --- .../templates/frontend/configmap.yaml | 20 --- .../templates/frontend/deployment.yaml | 39 ----- .../templates/frontend/secret.yaml | 12 -- .../templates/frontend/service.yaml | 19 --- .../templates/mycontainer/deployment.yaml | 27 ---- .../templates/pg/configmap.yaml | 12 -- .../templates/pg/secret.yaml | 11 -- .../templates/pg/service.yaml | 15 -- .../templates/pg/statefulset.yaml | 35 ----- .../templates/sqlserver/configmap.yaml | 10 -- .../templates/sqlserver/secret.yaml | 11 -- .../templates/sqlserver/service.yaml | 15 -- .../templates/sqlserver/statefulset.yaml | 41 ----- 33 files changed, 1233 deletions(-) delete mode 100644 playground/publishers/Publishers.AppHost/Chart.yaml delete mode 100644 playground/publishers/Publishers.AppHost/infra3/api-identity/api-identity.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/api-roles-azpg/api-roles-azpg.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/api/api.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/azpg/azpg.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/dbsetup/dbsetup.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/env/env.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/frontend/frontend.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/main.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/mycontainer/mycontainer.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/pg/pg.bicep delete mode 100644 playground/publishers/Publishers.AppHost/infra3/sqlserver/sqlserver.bicep delete mode 100644 playground/publishers/Publishers.AppHost/templates/api/configmap.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/api/deployment.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/api/secret.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/api/service.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/dbsetup/configmap.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/dbsetup/deployment.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/dbsetup/secret.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/dbsetup/service.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/frontend/configmap.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/frontend/deployment.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/frontend/secret.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/frontend/service.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/mycontainer/deployment.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/pg/configmap.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/pg/secret.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/pg/service.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/pg/statefulset.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/sqlserver/configmap.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/sqlserver/secret.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/sqlserver/service.yaml delete mode 100644 playground/publishers/Publishers.AppHost/templates/sqlserver/statefulset.yaml diff --git a/playground/publishers/Publishers.AppHost/Chart.yaml b/playground/publishers/Publishers.AppHost/Chart.yaml deleted file mode 100644 index 5a1d07a4bbb..00000000000 --- a/playground/publishers/Publishers.AppHost/Chart.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: "v2" -name: "aspire" -version: "0.1.0" -kubeVersion: ">= 1.18.0-0" -description: "Aspire Helm Chart" -type: "application" -keywords: - - "aspire" - - "kubernetes" -appVersion: "0.1.0" -deprecated: false diff --git a/playground/publishers/Publishers.AppHost/infra3/api-identity/api-identity.bicep b/playground/publishers/Publishers.AppHost/infra3/api-identity/api-identity.bicep deleted file mode 100644 index 0ff5902d5b0..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/api-identity/api-identity.bicep +++ /dev/null @@ -1,15 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -resource api_identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { - name: take('api_identity-${uniqueString(resourceGroup().id)}', 128) - location: location -} - -output id string = api_identity.id - -output clientId string = api_identity.properties.clientId - -output principalId string = api_identity.properties.principalId - -output principalName string = api_identity.name \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/api-roles-azpg/api-roles-azpg.bicep b/playground/publishers/Publishers.AppHost/infra3/api-roles-azpg/api-roles-azpg.bicep deleted file mode 100644 index 5595e0de2aa..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/api-roles-azpg/api-roles-azpg.bicep +++ /dev/null @@ -1,21 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -param azpg_outputs_name string - -param principalId string - -param principalName string - -resource azpg 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' existing = { - name: azpg_outputs_name -} - -resource azpg_admin 'Microsoft.DBforPostgreSQL/flexibleServers/administrators@2024-08-01' = { - name: principalId - properties: { - principalName: principalName - principalType: 'ServicePrincipal' - } - parent: azpg -} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/api/api.bicep b/playground/publishers/Publishers.AppHost/infra3/api/api.bicep deleted file mode 100644 index c6d4f85bc2e..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/api/api.bicep +++ /dev/null @@ -1,103 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -param api_identity_outputs_id string - -param api_identity_outputs_clientid string - -param api_containerport string - -@secure() -param pg_password_value string - -param azpg_outputs_connectionstring string - -param env_outputs_azure_container_apps_environment_default_domain string - -param env_outputs_azure_container_apps_environment_id string - -param env_outputs_azure_container_registry_endpoint string - -param env_outputs_azure_container_registry_managed_identity_id string - -param api_containerimage string - -resource api 'Microsoft.App/containerApps@2024-03-01' = { - name: 'api' - location: location - properties: { - configuration: { - secrets: [ - { - name: 'connectionstrings--db' - value: 'Host=pg;Port=5432;Username=postgres;Password=${pg_password_value};Database=db' - } - ] - activeRevisionsMode: 'Single' - ingress: { - external: true - targetPort: api_containerport - transport: 'http' - } - registries: [ - { - server: env_outputs_azure_container_registry_endpoint - identity: env_outputs_azure_container_registry_managed_identity_id - } - ] - } - environmentId: env_outputs_azure_container_apps_environment_id - template: { - containers: [ - { - image: api_containerimage - name: 'api' - env: [ - { - name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES' - value: 'true' - } - { - name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES' - value: 'true' - } - { - name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY' - value: 'in_memory' - } - { - name: 'ASPNETCORE_FORWARDEDHEADERS_ENABLED' - value: 'true' - } - { - name: 'HTTP_PORTS' - value: api_containerport - } - { - name: 'ConnectionStrings__db' - secretRef: 'connectionstrings--db' - } - { - name: 'ConnectionStrings__azdb' - value: '${azpg_outputs_connectionstring};Database=azdb' - } - { - name: 'AZURE_CLIENT_ID' - value: api_identity_outputs_clientid - } - ] - } - ] - scale: { - minReplicas: 2 - } - } - } - identity: { - type: 'UserAssigned' - userAssignedIdentities: { - '${api_identity_outputs_id}': { } - '${env_outputs_azure_container_registry_managed_identity_id}': { } - } - } -} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/azpg/azpg.bicep b/playground/publishers/Publishers.AppHost/infra3/azpg/azpg.bicep deleted file mode 100644 index 426bcd63e72..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/azpg/azpg.bicep +++ /dev/null @@ -1,50 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -resource azpg 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' = { - name: take('azpg-${uniqueString(resourceGroup().id)}', 63) - location: location - properties: { - authConfig: { - activeDirectoryAuth: 'Enabled' - passwordAuth: 'Disabled' - } - availabilityZone: '1' - backup: { - backupRetentionDays: 7 - geoRedundantBackup: 'Disabled' - } - highAvailability: { - mode: 'Disabled' - } - storage: { - storageSizeGB: 32 - } - version: '16' - } - sku: { - name: 'Standard_B1ms' - tier: 'Burstable' - } - tags: { - 'aspire-resource-name': 'azpg' - } -} - -resource postgreSqlFirewallRule_AllowAllAzureIps 'Microsoft.DBforPostgreSQL/flexibleServers/firewallRules@2024-08-01' = { - name: 'AllowAllAzureIps' - properties: { - endIpAddress: '0.0.0.0' - startIpAddress: '0.0.0.0' - } - parent: azpg -} - -resource azdb 'Microsoft.DBforPostgreSQL/flexibleServers/databases@2024-08-01' = { - name: 'azdb' - parent: azpg -} - -output connectionString string = 'Host=${azpg.properties.fullyQualifiedDomainName}' - -output name string = azpg.name \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/dbsetup/dbsetup.bicep b/playground/publishers/Publishers.AppHost/infra3/dbsetup/dbsetup.bicep deleted file mode 100644 index 16787ec94f1..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/dbsetup/dbsetup.bicep +++ /dev/null @@ -1,88 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -param dbsetup_containerport string - -@secure() -param pg_password_value string - -param env_outputs_azure_container_apps_environment_default_domain string - -param env_outputs_azure_container_apps_environment_id string - -param env_outputs_azure_container_registry_endpoint string - -param env_outputs_azure_container_registry_managed_identity_id string - -param dbsetup_containerimage string - -resource dbsetup 'Microsoft.App/containerApps@2024-03-01' = { - name: 'dbsetup' - location: location - properties: { - configuration: { - secrets: [ - { - name: 'connectionstrings--db' - value: 'Host=pg;Port=5432;Username=postgres;Password=${pg_password_value};Database=db' - } - ] - activeRevisionsMode: 'Single' - ingress: { - external: false - targetPort: dbsetup_containerport - transport: 'http' - } - registries: [ - { - server: env_outputs_azure_container_registry_endpoint - identity: env_outputs_azure_container_registry_managed_identity_id - } - ] - } - environmentId: env_outputs_azure_container_apps_environment_id - template: { - containers: [ - { - image: dbsetup_containerimage - name: 'dbsetup' - env: [ - { - name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES' - value: 'true' - } - { - name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES' - value: 'true' - } - { - name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY' - value: 'in_memory' - } - { - name: 'ASPNETCORE_FORWARDEDHEADERS_ENABLED' - value: 'true' - } - { - name: 'HTTP_PORTS' - value: dbsetup_containerport - } - { - name: 'ConnectionStrings__db' - secretRef: 'connectionstrings--db' - } - ] - } - ] - scale: { - minReplicas: 1 - } - } - } - identity: { - type: 'UserAssigned' - userAssignedIdentities: { - '${env_outputs_azure_container_registry_managed_identity_id}': { } - } - } -} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/env/env.bicep b/playground/publishers/Publishers.AppHost/infra3/env/env.bicep deleted file mode 100644 index f3c8886059e..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/env/env.bicep +++ /dev/null @@ -1,142 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -param userPrincipalId string - -param tags object = { } - -resource mi 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = { - name: take('mi-${uniqueString(resourceGroup().id)}', 128) - location: location - tags: tags -} - -resource acr 'Microsoft.ContainerRegistry/registries@2023-07-01' = { - name: take('acr${uniqueString(resourceGroup().id)}', 50) - location: location - sku: { - name: 'Basic' - } - tags: tags -} - -resource acr_mi_AcrPull 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid(acr.id, mi.id, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d')) - properties: { - principalId: mi.properties.principalId - roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d') - principalType: 'ServicePrincipal' - } - scope: acr -} - -resource law 'Microsoft.OperationalInsights/workspaces@2023-09-01' = { - name: take('law-${uniqueString(resourceGroup().id)}', 63) - location: location - properties: { - sku: { - name: 'PerGB2018' - } - } - tags: tags -} - -resource cae 'Microsoft.App/managedEnvironments@2024-03-01' = { - name: take('cae${uniqueString(resourceGroup().id)}', 24) - location: location - properties: { - appLogsConfiguration: { - destination: 'log-analytics' - logAnalyticsConfiguration: { - customerId: law.properties.customerId - sharedKey: law.listKeys().primarySharedKey - } - } - workloadProfiles: [ - { - name: 'consumption' - workloadProfileType: 'Consumption' - } - ] - } - tags: tags -} - -resource aspireDashboard 'Microsoft.App/managedEnvironments/dotNetComponents@2024-10-02-preview' = { - name: 'aspire-dashboard' - properties: { - componentType: 'AspireDashboard' - } - parent: cae -} - -resource cae_Contributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid(cae.id, userPrincipalId, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')) - properties: { - principalId: userPrincipalId - roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c') - } - scope: cae -} - -resource storageVolume 'Microsoft.Storage/storageAccounts@2024-01-01' = { - name: take('storagevolume${uniqueString(resourceGroup().id)}', 24) - kind: 'StorageV2' - location: location - sku: { - name: 'Standard_LRS' - } - properties: { - largeFileSharesState: 'Enabled' - } - tags: tags -} - -resource storageVolumeFileService 'Microsoft.Storage/storageAccounts/fileServices@2024-01-01' = { - name: 'default' - parent: storageVolume -} - -resource shares_volumes_sqlserver_0 'Microsoft.Storage/storageAccounts/fileServices/shares@2024-01-01' = { - name: take('sharesvolumessqlserver0-${uniqueString(resourceGroup().id)}', 63) - properties: { - enabledProtocols: 'SMB' - shareQuota: 1024 - } - parent: storageVolumeFileService -} - -resource managedStorage_volumes_sqlserver_0 'Microsoft.App/managedEnvironments/storages@2024-03-01' = { - name: take('managedstoragevolumessqlserver${uniqueString(resourceGroup().id)}', 24) - properties: { - azureFile: { - accountName: storageVolume.name - accountKey: storageVolume.listKeys().keys[0].value - accessMode: 'ReadWrite' - shareName: shares_volumes_sqlserver_0.name - } - } - parent: cae -} - -output volumes_sqlserver_0 string = managedStorage_volumes_sqlserver_0.name - -output MANAGED_IDENTITY_NAME string = mi.name - -output MANAGED_IDENTITY_PRINCIPAL_ID string = mi.properties.principalId - -output AZURE_LOG_ANALYTICS_WORKSPACE_NAME string = law.name - -output AZURE_LOG_ANALYTICS_WORKSPACE_ID string = law.id - -output AZURE_CONTAINER_REGISTRY_NAME string = acr.name - -output AZURE_CONTAINER_REGISTRY_ENDPOINT string = acr.properties.loginServer - -output AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID string = mi.id - -output AZURE_CONTAINER_APPS_ENVIRONMENT_NAME string = cae.name - -output AZURE_CONTAINER_APPS_ENVIRONMENT_ID string = cae.id - -output AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAIN string = cae.properties.defaultDomain \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/frontend/frontend.bicep b/playground/publishers/Publishers.AppHost/infra3/frontend/frontend.bicep deleted file mode 100644 index be74c41e775..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/frontend/frontend.bicep +++ /dev/null @@ -1,125 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -param frontend_containerport string - -@secure() -param sqlserver_password_value string - -param param0_value string - -@secure() -param param1_value string - -param param2_value string - -param param3_value string - -param env_outputs_azure_container_apps_environment_default_domain string - -param env_outputs_azure_container_apps_environment_id string - -param env_outputs_azure_container_registry_endpoint string - -param env_outputs_azure_container_registry_managed_identity_id string - -param frontend_containerimage string - -resource frontend 'Microsoft.App/containerApps@2024-03-01' = { - name: 'frontend' - location: location - properties: { - configuration: { - secrets: [ - { - name: 'connectionstrings--sqldb' - value: 'Server=sqlserver,1433;User ID=sa;Password=${sqlserver_password_value};TrustServerCertificate=true;Initial Catalog=sqldb' - } - { - name: 'p1' - value: param1_value - } - ] - activeRevisionsMode: 'Single' - ingress: { - external: false - targetPort: frontend_containerport - transport: 'http' - } - registries: [ - { - server: env_outputs_azure_container_registry_endpoint - identity: env_outputs_azure_container_registry_managed_identity_id - } - ] - } - environmentId: env_outputs_azure_container_apps_environment_id - template: { - containers: [ - { - image: frontend_containerimage - name: 'frontend' - env: [ - { - name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES' - value: 'true' - } - { - name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES' - value: 'true' - } - { - name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY' - value: 'in_memory' - } - { - name: 'ASPNETCORE_FORWARDEDHEADERS_ENABLED' - value: 'true' - } - { - name: 'HTTP_PORTS' - value: frontend_containerport - } - { - name: 'ConnectionStrings__sqldb' - secretRef: 'connectionstrings--sqldb' - } - { - name: 'P0' - value: param0_value - } - { - name: 'P1' - secretRef: 'p1' - } - { - name: 'P2' - value: param2_value - } - { - name: 'P3' - value: param3_value - } - { - name: 'services__api__http__0' - value: 'http://api.${env_outputs_azure_container_apps_environment_default_domain}' - } - { - name: 'services__api__https__0' - value: 'https://api.${env_outputs_azure_container_apps_environment_default_domain}' - } - ] - } - ] - scale: { - minReplicas: 1 - } - } - } - identity: { - type: 'UserAssigned' - userAssignedIdentities: { - '${env_outputs_azure_container_registry_managed_identity_id}': { } - } - } -} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/main.bicep b/playground/publishers/Publishers.AppHost/infra3/main.bicep deleted file mode 100644 index b92e0068d99..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/main.bicep +++ /dev/null @@ -1,69 +0,0 @@ -targetScope = 'subscription' - -param environmentName string - -param location string - -param principalId string - -var tags = { - 'aspire-env-name': environmentName -} - -resource rg 'Microsoft.Resources/resourceGroups@2023-07-01' = { - name: 'rg-${environmentName}' - location: location - tags: tags -} - -module env 'env/env.bicep' = { - name: 'env' - scope: rg - params: { - location: location - userPrincipalId: principalId - } -} - -module azpg 'azpg/azpg.bicep' = { - name: 'azpg' - scope: rg - params: { - location: location - } -} - -module api_identity 'api-identity/api-identity.bicep' = { - name: 'api-identity' - scope: rg - params: { - location: location - } -} - -module api_roles_azpg 'api-roles-azpg/api-roles-azpg.bicep' = { - name: 'api-roles-azpg' - scope: rg - params: { - location: location - azpg_outputs_name: azpg.outputs.name - principalId: api_identity.outputs.principalId - principalName: api_identity.outputs.principalName - } -} - -output env_AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAIN string = env.outputs.AZURE_CONTAINER_APPS_ENVIRONMENT_DEFAULT_DOMAIN - -output env_AZURE_CONTAINER_APPS_ENVIRONMENT_ID string = env.outputs.AZURE_CONTAINER_APPS_ENVIRONMENT_ID - -output env_AZURE_CONTAINER_REGISTRY_ENDPOINT string = env.outputs.AZURE_CONTAINER_REGISTRY_ENDPOINT - -output env_AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID string = env.outputs.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID - -output api_identity_id string = api_identity.outputs.id - -output api_identity_clientId string = api_identity.outputs.clientId - -output azpg_connectionString string = azpg.outputs.connectionString - -output env_volumes_sqlserver_0 string = env.outputs.volumes_sqlserver_0 \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/mycontainer/mycontainer.bicep b/playground/publishers/Publishers.AppHost/infra3/mycontainer/mycontainer.bicep deleted file mode 100644 index 6ea5829dd4f..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/mycontainer/mycontainer.bicep +++ /dev/null @@ -1,46 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -param env_outputs_azure_container_apps_environment_default_domain string - -param env_outputs_azure_container_apps_environment_id string - -param env_outputs_azure_container_registry_endpoint string - -param env_outputs_azure_container_registry_managed_identity_id string - -param mycontainer_containerimage string - -resource mycontainer 'Microsoft.App/containerApps@2024-03-01' = { - name: 'mycontainer' - location: location - properties: { - configuration: { - activeRevisionsMode: 'Single' - registries: [ - { - server: env_outputs_azure_container_registry_endpoint - identity: env_outputs_azure_container_registry_managed_identity_id - } - ] - } - environmentId: env_outputs_azure_container_apps_environment_id - template: { - containers: [ - { - image: mycontainer_containerimage - name: 'mycontainer' - } - ] - scale: { - minReplicas: 1 - } - } - } - identity: { - type: 'UserAssigned' - userAssignedIdentities: { - '${env_outputs_azure_container_registry_managed_identity_id}': { } - } - } -} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/pg/pg.bicep b/playground/publishers/Publishers.AppHost/infra3/pg/pg.bicep deleted file mode 100644 index a3f7c55bc68..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/pg/pg.bicep +++ /dev/null @@ -1,60 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -@secure() -param pg_password_value string - -param env_outputs_azure_container_apps_environment_default_domain string - -param env_outputs_azure_container_apps_environment_id string - -resource pg 'Microsoft.App/containerApps@2024-03-01' = { - name: 'pg' - location: location - properties: { - configuration: { - secrets: [ - { - name: 'postgres-password' - value: pg_password_value - } - ] - activeRevisionsMode: 'Single' - ingress: { - external: false - targetPort: 5432 - transport: 'tcp' - } - } - environmentId: env_outputs_azure_container_apps_environment_id - template: { - containers: [ - { - image: 'docker.io/library/postgres:17.2' - name: 'pg' - env: [ - { - name: 'POSTGRES_HOST_AUTH_METHOD' - value: 'scram-sha-256' - } - { - name: 'POSTGRES_INITDB_ARGS' - value: '--auth-host=scram-sha-256 --auth-local=scram-sha-256' - } - { - name: 'POSTGRES_USER' - value: 'postgres' - } - { - name: 'POSTGRES_PASSWORD' - secretRef: 'postgres-password' - } - ] - } - ] - scale: { - minReplicas: 1 - } - } - } -} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/infra3/sqlserver/sqlserver.bicep b/playground/publishers/Publishers.AppHost/infra3/sqlserver/sqlserver.bicep deleted file mode 100644 index c6463c3d229..00000000000 --- a/playground/publishers/Publishers.AppHost/infra3/sqlserver/sqlserver.bicep +++ /dev/null @@ -1,67 +0,0 @@ -@description('The location for the resource(s) to be deployed.') -param location string = resourceGroup().location - -param env_outputs_volumes_sqlserver_0 string - -@secure() -param sqlserver_password_value string - -param env_outputs_azure_container_apps_environment_default_domain string - -param env_outputs_azure_container_apps_environment_id string - -resource sqlserver 'Microsoft.App/containerApps@2024-03-01' = { - name: 'sqlserver' - location: location - properties: { - configuration: { - secrets: [ - { - name: 'mssql-sa-password' - value: sqlserver_password_value - } - ] - activeRevisionsMode: 'Single' - ingress: { - external: false - targetPort: 1433 - transport: 'tcp' - } - } - environmentId: env_outputs_azure_container_apps_environment_id - template: { - containers: [ - { - image: 'mcr.microsoft.com/mssql/server:2022-latest' - name: 'sqlserver' - env: [ - { - name: 'ACCEPT_EULA' - value: 'Y' - } - { - name: 'MSSQL_SA_PASSWORD' - secretRef: 'mssql-sa-password' - } - ] - volumeMounts: [ - { - volumeName: 'v0' - mountPath: '/var/opt/mssql' - } - ] - } - ] - scale: { - minReplicas: 1 - } - volumes: [ - { - name: 'v0' - storageType: 'AzureFile' - storageName: env_outputs_volumes_sqlserver_0 - } - ] - } - } -} \ No newline at end of file diff --git a/playground/publishers/Publishers.AppHost/templates/api/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/api/configmap.yaml deleted file mode 100644 index cf785ff9f26..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/api/configmap.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -apiVersion: "v1" -kind: "ConfigMap" -metadata: - name: "api-config" - labels: - app: "aspire" - component: "api" -data: - ASPNETCORE_URLS: "{{ .Values.config.api.ASPNETCORE_URLS }}" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "{{ .Values.config.api.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES }}" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "{{ .Values.config.api.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES }}" - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "{{ .Values.config.api.OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY }}" - ASPNETCORE_FORWARDEDHEADERS_ENABLED: "{{ .Values.config.api.ASPNETCORE_FORWARDEDHEADERS_ENABLED }}" - HTTP_PORTS: "{{ .Values.config.api.HTTP_PORTS }}" - ConnectionStrings__azdb: "{{ .Values.config.api.ConnectionStrings__azdb }}" diff --git a/playground/publishers/Publishers.AppHost/templates/api/deployment.yaml b/playground/publishers/Publishers.AppHost/templates/api/deployment.yaml deleted file mode 100644 index 383a883eb9d..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/api/deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -apiVersion: "apps/v1" -kind: "Deployment" -metadata: - name: "api-deployment" -spec: - template: - metadata: - labels: - app: "aspire" - component: "api" - spec: - containers: - - image: "{{ .Values.parameters.api.api_image }}" - name: "api" - envFrom: - - configMapRef: - name: "api-config" - - secretRef: - name: "api-secrets" - ports: - - name: "http" - protocol: "TCP" - containerPort: "{{ .Values.parameters.api.port_http }}" - - name: "https" - protocol: "TCP" - containerPort: "{{ .Values.parameters.api.port_https }}" - imagePullPolicy: "IfNotPresent" - selector: - matchLabels: - app: "aspire" - component: "api" - replicas: 2 - revisionHistoryLimit: 3 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/api/secret.yaml b/playground/publishers/Publishers.AppHost/templates/api/secret.yaml deleted file mode 100644 index 3f8cdfcae46..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/api/secret.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: "v1" -kind: "Secret" -metadata: - name: "api-secrets" - labels: - app: "aspire" - component: "api" -stringData: - ConnectionStrings__db: "Host=pg;Port=5432;Username=postgres;Password={{ .Values.secrets.api.pg_password }};Database=db" -type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/api/service.yaml b/playground/publishers/Publishers.AppHost/templates/api/service.yaml deleted file mode 100644 index 31a9369c772..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/api/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -apiVersion: "v1" -kind: "Service" -metadata: - name: "api-service" -spec: - type: "ClusterIP" - selector: - app: "aspire" - component: "api" - ports: - - name: "http" - protocol: "TCP" - port: "{{ .Values.parameters.api.port_http }}" - targetPort: "{{ .Values.parameters.api.port_http }}" - - name: "https" - protocol: "TCP" - port: "{{ .Values.parameters.api.port_https }}" - targetPort: "{{ .Values.parameters.api.port_https }}" diff --git a/playground/publishers/Publishers.AppHost/templates/dbsetup/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/dbsetup/configmap.yaml deleted file mode 100644 index ef9f984cbd3..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/dbsetup/configmap.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: "v1" -kind: "ConfigMap" -metadata: - name: "dbsetup-config" - labels: - app: "aspire" - component: "dbsetup" -data: - ASPNETCORE_URLS: "{{ .Values.config.dbsetup.ASPNETCORE_URLS }}" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "{{ .Values.config.dbsetup.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES }}" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "{{ .Values.config.dbsetup.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES }}" - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "{{ .Values.config.dbsetup.OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY }}" - ASPNETCORE_FORWARDEDHEADERS_ENABLED: "{{ .Values.config.dbsetup.ASPNETCORE_FORWARDEDHEADERS_ENABLED }}" - HTTP_PORTS: "{{ .Values.config.dbsetup.HTTP_PORTS }}" diff --git a/playground/publishers/Publishers.AppHost/templates/dbsetup/deployment.yaml b/playground/publishers/Publishers.AppHost/templates/dbsetup/deployment.yaml deleted file mode 100644 index 1406e8f9b4e..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/dbsetup/deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -apiVersion: "apps/v1" -kind: "Deployment" -metadata: - name: "dbsetup-deployment" -spec: - template: - metadata: - labels: - app: "aspire" - component: "dbsetup" - spec: - containers: - - image: "{{ .Values.parameters.dbsetup.dbsetup_image }}" - name: "dbsetup" - envFrom: - - configMapRef: - name: "dbsetup-config" - - secretRef: - name: "dbsetup-secrets" - ports: - - name: "http" - protocol: "TCP" - containerPort: "{{ .Values.parameters.dbsetup.port_http }}" - - name: "https" - protocol: "TCP" - containerPort: "{{ .Values.parameters.dbsetup.port_https }}" - imagePullPolicy: "IfNotPresent" - selector: - matchLabels: - app: "aspire" - component: "dbsetup" - replicas: 1 - revisionHistoryLimit: 3 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/dbsetup/secret.yaml b/playground/publishers/Publishers.AppHost/templates/dbsetup/secret.yaml deleted file mode 100644 index f55c0ad9d2a..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/dbsetup/secret.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: "v1" -kind: "Secret" -metadata: - name: "dbsetup-secrets" - labels: - app: "aspire" - component: "dbsetup" -stringData: - ConnectionStrings__db: "Host=pg;Port=5432;Username=postgres;Password={{ .Values.secrets.dbsetup.pg_password }};Database=db" -type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/dbsetup/service.yaml b/playground/publishers/Publishers.AppHost/templates/dbsetup/service.yaml deleted file mode 100644 index 4e32e2effb4..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/dbsetup/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -apiVersion: "v1" -kind: "Service" -metadata: - name: "dbsetup-service" -spec: - type: "ClusterIP" - selector: - app: "aspire" - component: "dbsetup" - ports: - - name: "http" - protocol: "TCP" - port: "{{ .Values.parameters.dbsetup.port_http }}" - targetPort: "{{ .Values.parameters.dbsetup.port_http }}" - - name: "https" - protocol: "TCP" - port: "{{ .Values.parameters.dbsetup.port_https }}" - targetPort: "{{ .Values.parameters.dbsetup.port_https }}" diff --git a/playground/publishers/Publishers.AppHost/templates/frontend/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/frontend/configmap.yaml deleted file mode 100644 index d5c5730262a..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/frontend/configmap.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -apiVersion: "v1" -kind: "ConfigMap" -metadata: - name: "frontend-config" - labels: - app: "aspire" - component: "frontend" -data: - ASPNETCORE_URLS: "{{ .Values.config.frontend.ASPNETCORE_URLS }}" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "{{ .Values.config.frontend.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES }}" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "{{ .Values.config.frontend.OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES }}" - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "{{ .Values.config.frontend.OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY }}" - ASPNETCORE_FORWARDEDHEADERS_ENABLED: "{{ .Values.config.frontend.ASPNETCORE_FORWARDEDHEADERS_ENABLED }}" - HTTP_PORTS: "{{ .Values.config.frontend.HTTP_PORTS }}" - P0: "{{ .Values.config.frontend.param0 }}" - P2: "{{ .Values.config.frontend.param2 }}" - P3: "{{ .Values.config.frontend.param3 }}" - services__api__http__0: "{{ .Values.config.frontend.services__api__http__0 }}" - services__api__https__0: "{{ .Values.config.frontend.services__api__https__0 }}" diff --git a/playground/publishers/Publishers.AppHost/templates/frontend/deployment.yaml b/playground/publishers/Publishers.AppHost/templates/frontend/deployment.yaml deleted file mode 100644 index 59919fb60d8..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/frontend/deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ ---- -apiVersion: "apps/v1" -kind: "Deployment" -metadata: - name: "frontend-deployment" -spec: - template: - metadata: - labels: - app: "aspire" - component: "frontend" - spec: - containers: - - image: "{{ .Values.parameters.frontend.frontend_image }}" - name: "frontend" - envFrom: - - configMapRef: - name: "frontend-config" - - secretRef: - name: "frontend-secrets" - ports: - - name: "http" - protocol: "TCP" - containerPort: "{{ .Values.parameters.frontend.port_http }}" - - name: "https" - protocol: "TCP" - containerPort: "{{ .Values.parameters.frontend.port_https }}" - imagePullPolicy: "IfNotPresent" - selector: - matchLabels: - app: "aspire" - component: "frontend" - replicas: 1 - revisionHistoryLimit: 3 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/frontend/secret.yaml b/playground/publishers/Publishers.AppHost/templates/frontend/secret.yaml deleted file mode 100644 index ea35ce853d4..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/frontend/secret.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -apiVersion: "v1" -kind: "Secret" -metadata: - name: "frontend-secrets" - labels: - app: "aspire" - component: "frontend" -stringData: - ConnectionStrings__sqldb: "Server=sqlserver,1433;User ID=sa;Password={{ .Values.secrets.frontend.sqlserver_password }};TrustServerCertificate=true;Initial Catalog=sqldb" - P1: "{{ .Values.secrets.frontend.param1 }}" -type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/frontend/service.yaml b/playground/publishers/Publishers.AppHost/templates/frontend/service.yaml deleted file mode 100644 index 62f12befd1a..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/frontend/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -apiVersion: "v1" -kind: "Service" -metadata: - name: "frontend-service" -spec: - type: "ClusterIP" - selector: - app: "aspire" - component: "frontend" - ports: - - name: "http" - protocol: "TCP" - port: "{{ .Values.parameters.frontend.port_http }}" - targetPort: "{{ .Values.parameters.frontend.port_http }}" - - name: "https" - protocol: "TCP" - port: "{{ .Values.parameters.frontend.port_https }}" - targetPort: "{{ .Values.parameters.frontend.port_https }}" diff --git a/playground/publishers/Publishers.AppHost/templates/mycontainer/deployment.yaml b/playground/publishers/Publishers.AppHost/templates/mycontainer/deployment.yaml deleted file mode 100644 index ba71245de8b..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/mycontainer/deployment.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- -apiVersion: "apps/v1" -kind: "Deployment" -metadata: - name: "mycontainer-deployment" -spec: - template: - metadata: - labels: - app: "aspire" - component: "mycontainer" - spec: - containers: - - image: "{{ .Values.parameters.mycontainer.mycontainer_image }}" - name: "mycontainer" - imagePullPolicy: "IfNotPresent" - selector: - matchLabels: - app: "aspire" - component: "mycontainer" - replicas: 1 - revisionHistoryLimit: 3 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/pg/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/pg/configmap.yaml deleted file mode 100644 index 6ea40d0e9db..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/pg/configmap.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -apiVersion: "v1" -kind: "ConfigMap" -metadata: - name: "pg-config" - labels: - app: "aspire" - component: "pg" -data: - POSTGRES_HOST_AUTH_METHOD: "{{ .Values.config.pg.POSTGRES_HOST_AUTH_METHOD }}" - POSTGRES_INITDB_ARGS: "{{ .Values.config.pg.POSTGRES_INITDB_ARGS }}" - POSTGRES_USER: "{{ .Values.config.pg.POSTGRES_USER }}" diff --git a/playground/publishers/Publishers.AppHost/templates/pg/secret.yaml b/playground/publishers/Publishers.AppHost/templates/pg/secret.yaml deleted file mode 100644 index 84b47a73466..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/pg/secret.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: "v1" -kind: "Secret" -metadata: - name: "pg-secrets" - labels: - app: "aspire" - component: "pg" -stringData: - POSTGRES_PASSWORD: "{{ .Values.secrets.pg.pg_password }}" -type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/pg/service.yaml b/playground/publishers/Publishers.AppHost/templates/pg/service.yaml deleted file mode 100644 index cb9ebaebc84..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/pg/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: "v1" -kind: "Service" -metadata: - name: "pg-service" -spec: - type: "ClusterIP" - selector: - app: "aspire" - component: "pg" - ports: - - name: "tcp" - protocol: "TCP" - port: "5432" - targetPort: "5432" diff --git a/playground/publishers/Publishers.AppHost/templates/pg/statefulset.yaml b/playground/publishers/Publishers.AppHost/templates/pg/statefulset.yaml deleted file mode 100644 index 8c2d91d28e8..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/pg/statefulset.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -apiVersion: "apps/v1" -kind: "StatefulSet" -metadata: - name: "pg-statefulset" -spec: - template: - metadata: - labels: - app: "aspire" - component: "pg" - spec: - containers: - - image: "docker.io/library/postgres:17.2" - name: "pg" - envFrom: - - configMapRef: - name: "pg-config" - - secretRef: - name: "pg-secrets" - ports: - - name: "tcp" - protocol: "TCP" - containerPort: "5432" - imagePullPolicy: "IfNotPresent" - selector: - matchLabels: - app: "aspire" - component: "pg" - replicas: 1 - persistentVolumeClaimRetentionPolicy: {} - updateStrategy: - rollingUpdate: - maxUnavailable: 0 - type: "RollingUpdate" diff --git a/playground/publishers/Publishers.AppHost/templates/sqlserver/configmap.yaml b/playground/publishers/Publishers.AppHost/templates/sqlserver/configmap.yaml deleted file mode 100644 index 90584c45b63..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/sqlserver/configmap.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -apiVersion: "v1" -kind: "ConfigMap" -metadata: - name: "sqlserver-config" - labels: - app: "aspire" - component: "sqlserver" -data: - ACCEPT_EULA: "{{ .Values.config.sqlserver.ACCEPT_EULA }}" diff --git a/playground/publishers/Publishers.AppHost/templates/sqlserver/secret.yaml b/playground/publishers/Publishers.AppHost/templates/sqlserver/secret.yaml deleted file mode 100644 index 5945a5e8857..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/sqlserver/secret.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: "v1" -kind: "Secret" -metadata: - name: "sqlserver-secrets" - labels: - app: "aspire" - component: "sqlserver" -stringData: - MSSQL_SA_PASSWORD: "{{ .Values.secrets.sqlserver.sqlserver_password }}" -type: "Opaque" diff --git a/playground/publishers/Publishers.AppHost/templates/sqlserver/service.yaml b/playground/publishers/Publishers.AppHost/templates/sqlserver/service.yaml deleted file mode 100644 index d27d930c3cb..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/sqlserver/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: "v1" -kind: "Service" -metadata: - name: "sqlserver-service" -spec: - type: "ClusterIP" - selector: - app: "aspire" - component: "sqlserver" - ports: - - name: "tcp" - protocol: "TCP" - port: "1433" - targetPort: "1433" diff --git a/playground/publishers/Publishers.AppHost/templates/sqlserver/statefulset.yaml b/playground/publishers/Publishers.AppHost/templates/sqlserver/statefulset.yaml deleted file mode 100644 index 97745895b16..00000000000 --- a/playground/publishers/Publishers.AppHost/templates/sqlserver/statefulset.yaml +++ /dev/null @@ -1,41 +0,0 @@ ---- -apiVersion: "apps/v1" -kind: "StatefulSet" -metadata: - name: "sqlserver-statefulset" -spec: - template: - metadata: - labels: - app: "aspire" - component: "sqlserver" - spec: - containers: - - image: "mcr.microsoft.com/mssql/server:2022-latest" - name: "sqlserver" - envFrom: - - configMapRef: - name: "sqlserver-config" - - secretRef: - name: "sqlserver-secrets" - ports: - - name: "tcp" - protocol: "TCP" - containerPort: "1433" - volumeMounts: - - name: "sqlserver-data" - mountPath: "/var/opt/mssql" - imagePullPolicy: "IfNotPresent" - volumes: - - name: "sqlserver-data" - emptyDir: {} - selector: - matchLabels: - app: "aspire" - component: "sqlserver" - replicas: 1 - persistentVolumeClaimRetentionPolicy: {} - updateStrategy: - rollingUpdate: - maxUnavailable: 0 - type: "RollingUpdate" From 4e4132bead597221eb198ad3f59e3a0bccde2286 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Mon, 7 Apr 2025 01:08:12 +0000 Subject: [PATCH 5/6] Extra file to remove. --- .../publishers/Publishers.AppHost/values.yaml | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 playground/publishers/Publishers.AppHost/values.yaml diff --git a/playground/publishers/Publishers.AppHost/values.yaml b/playground/publishers/Publishers.AppHost/values.yaml deleted file mode 100644 index 38e2b57de5d..00000000000 --- a/playground/publishers/Publishers.AppHost/values.yaml +++ /dev/null @@ -1,51 +0,0 @@ -parameters: - dbsetup: - port_http: "8080" - port_https: "8080" - dbsetup_image: "dbsetup:latest" - api: - port_http: "8080" - port_https: "8080" - api_image: "api:latest" - frontend: - port_http: "8080" - port_https: "8080" - frontend_image: "frontend:latest" - mycontainer: - mycontainer_image: "mycontainer:latest" -secrets: - pg: - POSTGRES_PASSWORD: "" - sqlserver: - MSSQL_SA_PASSWORD: "" - frontend: - P1: "" -config: - pg: - POSTGRES_HOST_AUTH_METHOD: "scram-sha-256" - POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256 --auth-local=scram-sha-256" - POSTGRES_USER: "postgres" - dbsetup: - ASPNETCORE_URLS: "http://+:$8080" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" - ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" - api: - ASPNETCORE_URLS: "http://+:$8080" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" - ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" - ConnectionStrings__azdb: "{azpg.outputs.connectionString};Database=azdb" - sqlserver: - ACCEPT_EULA: "Y" - frontend: - ASPNETCORE_URLS: "http://+:$8080" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true" - OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true" - OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory" - ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" - P0: "" - P2: "default" - P3: "" From c2665f3ad141a17f237f72d33c9b2df92da1cad0 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Mon, 7 Apr 2025 01:21:49 +0000 Subject: [PATCH 6/6] Remove debugging code. --- src/Aspire.Cli/Commands/PublishCommand.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Aspire.Cli/Commands/PublishCommand.cs b/src/Aspire.Cli/Commands/PublishCommand.cs index a7dc712d5c2..cce35f56d32 100644 --- a/src/Aspire.Cli/Commands/PublishCommand.cs +++ b/src/Aspire.Cli/Commands/PublishCommand.cs @@ -175,12 +175,8 @@ protected override async Task ExecuteAsync(ParseResult parseResult, Cancell var progressTasks = new Dictionary(); - (string Id, string StatusText, bool IsComplete, bool IsError)? lastPublishingActivity = null; - await foreach (var publishingActivity in publishingActivities) { - lastPublishingActivity = publishingActivity; - if (!progressTasks.TryGetValue(publishingActivity.Id, out var progressTask)) { progressTask = context.AddTask(publishingActivity.Id);