From 309617aa3d82e1d7706f64a53eb240439b7e0932 Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Tue, 26 Jul 2022 11:11:48 -0400 Subject: [PATCH 01/14] infra.bicep changes --- reference-apps/eshop/iac/infra.bicep | 376 +++++++++++++++++++++++---- 1 file changed, 328 insertions(+), 48 deletions(-) diff --git a/reference-apps/eshop/iac/infra.bicep b/reference-apps/eshop/iac/infra.bicep index 62c0a1e9..0d1e98bb 100644 --- a/reference-apps/eshop/iac/infra.bicep +++ b/reference-apps/eshop/iac/infra.bicep @@ -1,92 +1,372 @@ +import radius as radius + // Parameters -------------------------------------------- +param environmentId string + +param location string = resourceGroup().location + @secure() param adminPassword string -resource eshop 'radius.dev/Application@v1alpha3' = { - name: 'eshop' +param mongoUsername string = 'admin' - // Gateway -------------------------------------------- +param mongoPassword string = newGuid() - resource gateway 'Gateway' = { +resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'eshop' + location: location + properties: { + environment: environmentId + } +} +// Gateway -------------------------------------------- + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { name: 'gateway' + location: location properties: { - listeners: { + application: eshop.id + routes: [ http: { protocol: 'HTTP' port: 80 } + ] + } + } + +resource rabbitmqContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'rabbitmq-container-eshop-event-bus' + location: location + properties: { + application: eshop.id + container: { + image: 'rabbitmq:3.9' + env: { + //RABBITMQ_DEFAULT_USER: username + //RABBITMQ_DEFAULT_PASS: password + } + ports: { + rabbitmq: { + containerPort: 5672 + provides: rabbitmqRoute.id + } + } + } + } +} + +resource rabbitmqRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'rabbitmq-route-eshop-event-bus' + location: location + properties: { + application: eshop.id + port: 5672 + } +} + +resource rabbitmq 'Applications.Connector/rabbitmqMessageQueues@2022-03-15-privatepreview' = { + name: 'eshop-event-bus' + location: location + properties: { + application: eshop.id + environment: environmentId + queue: 'eshop-event-bus' + secrets: { + connectionString: 'amqp://${rabbitmqRoute.properties.hostname}:${rabbitmqRoute.properties.port}' + } + } +} + +resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-identitydb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlIdentityRoute.id + } + } + } + } +} + +resource sqlIdentityRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-identitydb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'identitydb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlIdentityRoute.properties.hostname + database: 'IdentityDb' + } +} + +resource sqlCatalogContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-catalogdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlCatalogRoute.id + } + } + } + } +} + +resource sqlCatalogRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-catalogdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'catalogdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlCatalogRoute.properties.hostname + database: 'CatalogDb' + } +} + +resource sqlOrderingContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-orderingdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlOrderingRoute.id + } } } } +} +resource sqlOrderingRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-orderingdb' + location: location + properties: { + application: eshop.id + port: 1433 + } } -// Starters --------------------------------------------------------- +resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'orderingdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlOrderingRoute.properties.hostname + database: 'OrderingDb' + } +} -module rabbitMQ 'br:radius.azurecr.io/starters/rabbitmq:latest' = { - name: 'rabbitmq' - params: { - queueName: 'eshop_event_bus' - radiusApplication: eshop +resource sqlWebhooksContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-webhooksdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlWebhooksRoute.id + } + } + } } } -module sqlIdentity 'br:radius.azurecr.io/starters/sql:latest' = { - name: 'sql-identity' - params: { - adminPassword: adminPassword - databaseName: 'IdentityDb' - radiusApplication: eshop +resource sqlWebhooksRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-webhooksdb' + location: location + properties: { + application: eshop.id + port: 1433 } } -module sqlCatalog 'br:radius.azurecr.io/starters/sql:latest' = { - name: 'sql-catalog' - params: { - adminPassword: adminPassword - databaseName: 'CatalogDb' - radiusApplication: eshop +resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'webhooksdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlWebhooksRoute.properties.hostname + database: 'WebhooksDb' } } -module sqlOrdering 'br:radius.azurecr.io/starters/sql:latest' = { - name: 'sql-ordering' - params: { - adminPassword: adminPassword - databaseName: 'OrderingDb' - radiusApplication: eshop +resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-basket-data' + location: location + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + ports: { + redis: { + containerPort: 6379 + provides: redisBasketRoute.id + } + } + } } } -module sqlWebhooks 'br:radius.azurecr.io/starters/sql:latest' = { - name: 'sql-webhooks' - params: { - adminPassword: adminPassword - databaseName: 'WebhooksDb' - radiusApplication: eshop +resource redisBasketRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-basket-data' + location: location + properties: { + application: eshop.id + port: 6379 } } -module redisBasket 'br:radius.azurecr.io/starters/redis:latest' = { +resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { name: 'basket-data' - params: { - cacheName: 'basket-data' - radiusApplication: eshop + location: location + properties: { + application: eshop.id + environment: environmentId + host: redisBasketRoute.properties.hostname + port: redisBasketRoute.properties.port + secrets: { + connectionString: '${redisBasketRoute.properties.hostname}:${redisBasketRoute.properties.port},password=},ssl=True,abortConnect=False' + password: '' + } } } -module redisKeystore 'br:radius.azurecr.io/starters/redis:latest' = { +resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-keystore-data' + location: location + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + ports: { + redis: { + containerPort: 6379 + provides: redisKeystoreRoute.id + } + } + } + } +} + +resource redisKeystoreRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-keystore-data' + location: location + properties: { + application: eshop.id + port: 6379 + } +} + +resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { name: 'keystore-data' - params: { - cacheName: 'keystore-data' - radiusApplication: eshop + location: location + properties: { + application: eshop.id + environment: environmentId + host: redisKeystoreRoute.properties.hostname + port: redisKeystoreRoute.properties.port + secrets: { + connectionString: '${redisKeystoreRoute.properties.hostname}:${redisKeystoreRoute.properties.port},password=},ssl=True,abortConnect=False' + password: '' + } + } +} +resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'mongo-container' + location: location + properties: { + application: eshop.id + container: { + image: 'mongo:4.2' + env: { + MONGO_INITDB_ROOT_USERNAME: mongoUsername + MONGO_INITDB_ROOT_PASSWORD: mongoPassword + } + ports: { + mongo: { + containerPort: 27017 + provides: mongoRoute.id + } + } + } } } -module mongo 'br:radius.azurecr.io/starters/mongo:latest' = { - name: 'mongo' - params: { - dbName: 'mongo' - radiusApplication: eshop +resource mongoRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'mongo-route' + location: location + properties: { + application: eshop.id + port: 27017 } } + +resource mongo 'Applications.Connector/mongoDatabases@2022-03-15-privatepreview' = { + name: 'mongo' + location: location + properties: { + application: eshop.id + environment: environmentId + secrets: { + connectionString: 'mongodb://${mongoUsername}:${mongoPassword}@${mongoRoute.properties.hostname}:${mongoRoute.properties.port}' + username: mongoUsername + password: mongoPassword + } + } +} \ No newline at end of file From dc91ba7ed1cbbf2feb972e727177c47c08161cc1 Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Tue, 26 Jul 2022 14:56:36 -0400 Subject: [PATCH 02/14] combine infra.bicep and app.bicep and update resource types in app.bicep --- reference-apps/eshop/iac/app.bicep | 1970 ++++++++++++-------- reference-apps/eshop/iac/infra.azure.bicep | 348 +++- 2 files changed, 1473 insertions(+), 845 deletions(-) diff --git a/reference-apps/eshop/iac/app.bicep b/reference-apps/eshop/iac/app.bicep index 158c0a5d..fe4f9df7 100644 --- a/reference-apps/eshop/iac/app.bicep +++ b/reference-apps/eshop/iac/app.bicep @@ -1,3 +1,13 @@ +import radius as radius + +// Parameters -------------------------------------------- +param environmentId string + +param location string = resourceGroup().location + +param mongoUsername string = 'admin' + +param mongoPassword string = newGuid() param ESHOP_EXTERNAL_DNS_NAME_OR_IP string = '*' param CLUSTER_IP string param OCHESTRATOR_TYPE string = 'K8S' @@ -16,980 +26,1364 @@ param adminLogin string = 'SA' @secure() param adminPassword string -resource eshop 'radius.dev/Application@v1alpha3' existing = { +resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { name: 'eshop' + location: location + properties: { + environment: environmentId + } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/catalog-api - resource catalog 'Container' = { - name: 'catalog-api' - properties: { - container: { - image: 'eshop/catalog.api:${TAG}' - env: { - UseCustomizationData: 'False' - PATH_BASE: '/catalog-api' - ASPNETCORE_ENVIRONMENT: 'Development' - OrchestratorType: OCHESTRATOR_TYPE - PORT: '80' - GRPC_PORT: '81' - PicBaseUrl: PICBASEURL - AzureStorageEnabled: AZURESTORAGEENABLED - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: 'Server=tcp:${sqlCatalog.properties.server},1433;Initial Catalog=${sqlCatalog.properties.database};User Id=${adminLogin};Password=${adminPassword};' - EventBusConnection: tempRabbitmqConnectionString - } - ports: { - http: { - containerPort: 80 - provides: catalogHttp.id - } - grpc: { - containerPort: 81 - provides: catalogGrpc.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/catalog-api +resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'catalog-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/catalog.api:${TAG}' + env: { + UseCustomizationData: 'False' + PATH_BASE: '/catalog-api' + ASPNETCORE_ENVIRONMENT: 'Development' + OrchestratorType: OCHESTRATOR_TYPE + PORT: '80' + GRPC_PORT: '81' + PicBaseUrl: PICBASEURL + AzureStorageEnabled: AZURESTORAGEENABLED + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: 'Server=tcp:${sqlCatalogDb.properties.server},1433;Initial Catalog=${sqlCatalogDb.properties.database};User Id=${adminLogin};Password=${adminPassword};' + EventBusConnection: tempRabbitmqConnectionString } - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlCatalog.id + ports: { + http: { + containerPort: 80 + provides: catalogHttp.id } - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id + grpc: { + containerPort: 81 + provides: catalogGrpc.id } } } + connections: { + sql: { + kind: 'microsoft.com/SQL' + source: sqlCatalogDb.id + } + rabbitmq: { + kind: 'rabbitmq.com/MessageQueue' + source: rabbitmq.id + } + } } +} - resource catalogHttp 'HttpRoute' = { - name: 'catalog-http' - properties: { - port: 5101 - } +resource catalogHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'catalog-http' + location: location + properties: { + application: eshop.id + port: 5101 } +} - resource catalogGrpc 'HttpRoute' = { - name: 'catalog-grpc' - properties: { - port: 9101 - } +resource catalogGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'catalog-grpc' + location: location + properties: { + application: eshop.id + port: 9101 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/identity-api - resource identity 'Container' = { - name: 'identity-api' - properties: { - container: { - image: 'eshop/identity.api:${TAG}' - env: { - PATH_BASE: '/identity-api' - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - OrchestratorType: 'K8S' - IsClusterEnv: 'True' - DPConnectionString: '${redisKeystore.properties.host}' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - XamarinCallback: '' - EnableDevspaces: ENABLEDEVSPACES - ConnectionString: 'Server=tcp:${sqlIdentity.properties.server},1433;Initial Catalog=${sqlIdentity.properties.database};User Id=${adminLogin};Password=${adminPassword}' - MvcClient: '${CLUSTERDNS}${webmvcHttp.properties.gateway.rules.webmvc.path.value}' - SpaClient: CLUSTERDNS - BasketApiClient: '${CLUSTERDNS}${basketHttp.properties.gateway.rules.basket.path.value}' - OrderingApiClient: '${CLUSTERDNS}${orderingHttp.properties.gateway.rules.ordering.path.value}' - WebShoppingAggClient: '${CLUSTERDNS}${webshoppingaggHttp.properties.gateway.rules.webshoppingagg.path.value}' - WebhooksApiClient: '${CLUSTERDNS}${webhooksHttp.properties.gateway.rules.webhooks.path.value}' - WebhooksWebClient: '${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: identityHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/identity-api +resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'identity-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/identity.api:${TAG}' + env: { + PATH_BASE: '/identity-api' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + OrchestratorType: 'K8S' + IsClusterEnv: 'True' + DPConnectionString: '${redisKeystore.properties.host}' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + XamarinCallback: '' + EnableDevspaces: ENABLEDEVSPACES + ConnectionString: 'Server=tcp:${sqlIdentityDb.properties.server},1433;Initial Catalog=${sqlIdentityDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' + MvcClient: '${CLUSTERDNS}${webmvcHttp.properties.gateway.rules.webmvc.path.value}' + SpaClient: CLUSTERDNS + BasketApiClient: '${CLUSTERDNS}${basketHttp.properties.gateway.rules.basket.path.value}' + OrderingApiClient: '${CLUSTERDNS}${orderingHttp.properties.gateway.rules.ordering.path.value}' + WebShoppingAggClient: '${CLUSTERDNS}${webshoppingaggHttp.properties.gateway.rules.webshoppingagg.path.value}' + WebhooksApiClient: '${CLUSTERDNS}${webhooksHttp.properties.gateway.rules.webhooks.path.value}' + WebhooksWebClient: '${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisKeystore.id - } - sql: { - kind: 'microsoft.com/SQL' - source: sqlIdentity.id - } - webmvc: { - kind: 'Http' - source: webmvcHttp.id - } - webspa: { - kind: 'Http' - source: webspaHttp.id - } - basket: { - kind: 'Http' - source: basketHttp.id - } - ordering: { - kind: 'Http' - source: orderingHttp.id - } - webshoppingagg: { - kind: 'Http' - source: webshoppingaggHttp.id - } - webhooks: { - kind: 'Http' - source: webhooksHttp.id - } - webhoolsclient: { - kind: 'Http' - source: webhooksclientHttp.id + ports: { + http: { + containerPort: 80 + provides: identityHttp.id } } } + traits: [] + connections: { + redis: { + kind: 'redislabs.com/Redis' + source: redisKeystore.id + } + sql: { + kind: 'microsoft.com/SQL' + source: sqlIdentityDb.id + } + webmvc: { + kind: 'Http' + source: webmvcHttp.id + } + webspa: { + kind: 'Http' + source: webspaHttp.id + } + basket: { + kind: 'Http' + source: basketHttp.id + } + ordering: { + kind: 'Http' + source: orderingHttp.id + } + webshoppingagg: { + kind: 'Http' + source: webshoppingaggHttp.id + } + webhooks: { + kind: 'Http' + source: webhooksHttp.id + } + webhoolsclient: { + kind: 'Http' + source: webhooksclientHttp.id + } + } } +} - resource identityHttp 'HttpRoute' = { - name: 'identity-http' - properties: { - port: 5105 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - identity: { - path: { - value: '/identity-api' - } +resource identityHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'identity-http' + location: location + properties: { + application: eshop.id + port: 5105 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + identity: { + path: { + value: '/identity-api' } } } } } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-api - resource ordering 'Container' = { - name: 'ordering-api' - properties: { - container: { - image: 'eshop/ordering.api:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - UseCustomizationData: 'False' - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - CheckUpdateTime: '30000' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - OrchestratorType: OCHESTRATOR_TYPE - UseLoadTest: 'False' - 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' - 'Serilog__MinimumLevel__Override__ordering-api': 'Verbose' - PATH_BASE: '/ordering-api' - GRPC_PORT: '81' - PORT: '80' - ConnectionString: 'Server=tcp:${sqlOrdering.properties.server},1433;Initial Catalog=${sqlOrdering.properties.database};User Id=${adminLogin};Password=${adminPassword}' - EventBusConnection: tempRabbitmqConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: orderingHttp.id - } - grpc: { - containerPort: 81 - provides: orderingGrpc.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-api +resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'ordering-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/ordering.api:${TAG}' + env: { + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + UseCustomizationData: 'False' + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + CheckUpdateTime: '30000' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + OrchestratorType: OCHESTRATOR_TYPE + UseLoadTest: 'False' + 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' + 'Serilog__MinimumLevel__Override__ordering-api': 'Verbose' + PATH_BASE: '/ordering-api' + GRPC_PORT: '81' + PORT: '80' + ConnectionString: 'Server=tcp:${sqlOrderingDb.properties.server},1433;Initial Catalog=${sqlOrderingDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' + EventBusConnection: tempRabbitmqConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' } - traits: [] - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlOrdering.id - } - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id + ports: { + http: { + containerPort: 80 + provides: orderingHttp.id } - identity: { - kind: 'Http' - source: identityHttp.id + grpc: { + containerPort: 81 + provides: orderingGrpc.id } } } + traits: [] + connections: { + sql: { + kind: 'microsoft.com/SQL' + source: sqlOrderingDb.id + } + rabbitmq: { + kind: 'rabbitmq.com/MessageQueue' + source: rabbitmq.id + } + identity: { + kind: 'Http' + source: identityHttp.id + } + } } +} - resource orderingHttp 'HttpRoute' = { - name: 'ordering-http' - properties: { - port: 5102 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - ordering: { - path: { - value: '/ordering-api' - } +resource orderingHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'ordering-http' + location: location + properties: { + application: eshop.id + port: 5102 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + ordering: { + path: { + value: '/ordering-api' } } } } } +} - resource orderingGrpc 'HttpRoute' = { - name: 'ordering-grpc' - properties: { - port: 9102 - } +resource orderingGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'ordering-grpc' + location: location + properties: { + application: eshop.id + port: 9102 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/basket-api - resource basket 'Container' = { - name: 'basket-api' - properties: { - container: { - image: 'eshop/basket.api:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - UseLoadTest: 'False' - PATH_BASE: '/basket-api' - OrchestratorType: 'K8S' - PORT: '80' - GRPC_PORT: '81' - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port}' - EventBusConnection: tempRabbitmqConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: basketHttp.id - } - grpc: { - containerPort: 81 - provides: basketGrpc.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/basket-api +resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'basket-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/basket.api:${TAG}' + env: { + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + PATH_BASE: '/basket-api' + OrchestratorType: 'K8S' + PORT: '80' + GRPC_PORT: '81' + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port}' + EventBusConnection: tempRabbitmqConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisBasket.id + ports: { + http: { + containerPort: 80 + provides: basketHttp.id } - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id - } - identity: { - kind: 'Http' - source: identityHttp.id + grpc: { + containerPort: 81 + provides: basketGrpc.id } } } + traits: [] + connections: { + redis: { + kind: 'redislabs.com/Redis' + source: redisBasket.id + } + rabbitmq: { + kind: 'rabbitmq.com/MessageQueue' + source: rabbitmq.id + } + identity: { + kind: 'Http' + source: identityHttp.id + } + } } +} - resource basketHttp 'HttpRoute' = { - name: 'basket-http' - properties: { - port: 5103 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - basket: { - path: { - value: '/basket-api' - } +resource basketHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'basket-http' + location: location + properties: { + application: eshop.id + port: 5103 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + basket: { + path: { + value: '/basket-api' } } } } } +} - resource basketGrpc 'HttpRoute' = { - name: 'basket-grpc' - properties: { - port: 9103 - } +resource basketGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'basket-grpc' + location: location + properties: { + application: eshop.id + port: 9103 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-api - resource webhooks 'Container' = { - name: 'webhooks-api' - properties: { - container: { - image: 'eshop/webhooks.api:linux-dev' - env: { - PATH_BASE: '/webhooks-api' - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - OrchestratorType: OCHESTRATOR_TYPE - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: 'Server=tcp:${sqlWebhooks.properties.server},1433;Initial Catalog=${sqlWebhooks.properties.database};User Id=${adminLogin};Password=${adminPassword}' - EventBusConnection: tempRabbitmqConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: webhooksHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-api +resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webhooks-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webhooks.api:linux-dev' + env: { + PATH_BASE: '/webhooks-api' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + OrchestratorType: OCHESTRATOR_TYPE + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: 'Server=tcp:${sqlWebhooksDb.properties.server},1433;Initial Catalog=${sqlWebhooksDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' + EventBusConnection: tempRabbitmqConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' } - traits: [] - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlWebhooks.id - } - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id - } - identity: { - kind: 'Http' - source: identityHttp.id + ports: { + http: { + containerPort: 80 + provides: webhooksHttp.id } } } + traits: [] + connections: { + sql: { + kind: 'microsoft.com/SQL' + source: sqlWebhooksDb.id + } + rabbitmq: { + kind: 'rabbitmq.com/MessageQueue' + source: rabbitmq.id + } + identity: { + kind: 'Http' + source: identityHttp.id + } + } } +} - resource webhooksHttp 'HttpRoute' = { - name: 'webhooks-http' - properties: { - port: 5113 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webhooks: { - path: { - value: '/webhooks-api' - } +resource webhooksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooks-http' + location: location + properties: { + application: eshop.id + port: 5113 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webhooks: { + path: { + value: '/webhooks-api' } } } } } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/payment-api - resource payment 'Container' = { - name: 'payment-api' - properties: { - container: { - image: 'eshop/payment.api:linux-dev' - env: { - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - 'Serilog__MinimumLevel__Override__payment-api.IntegrationEvents.EventHandling': 'Verbose' - 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' - OrchestratorType: OCHESTRATOR_TYPE - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - EventBusConnection: tempRabbitmqConnectionString - } - ports: { - http: { - containerPort: 80 - provides: paymentHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/payment-api +resource payment 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'payment-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/payment.api:linux-dev' + env: { + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + 'Serilog__MinimumLevel__Override__payment-api.IntegrationEvents.EventHandling': 'Verbose' + 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' + OrchestratorType: OCHESTRATOR_TYPE + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + EventBusConnection: tempRabbitmqConnectionString } - traits: [] - connections: { - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id + ports: { + http: { + containerPort: 80 + provides: paymentHttp.id } } } + traits: [] + connections: { + rabbitmq: { + kind: 'rabbitmq.com/MessageQueue' + source: rabbitmq.id + } + } } +} - resource paymentHttp 'HttpRoute' = { - name: 'payment-http' - properties: { - port: 5108 - } +resource paymentHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'payment-http' + location: location + properties: { + application: eshop.id + port: 5108 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-backgroundtasks - resource orderbgtasks 'Container' = { - name: 'ordering-backgroundtasks' - properties: { - container: { - image: 'eshop/ordering.backgroundtasks:linux-dev' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - UseCustomizationData: 'False' - CheckUpdateTime: '30000' - GracePeriodTime: '1' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - UseLoadTest: 'False' - 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' - OrchestratorType: OCHESTRATOR_TYPE - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: 'Server=tcp:${sqlOrdering.properties.server},1433;Initial Catalog=${sqlOrdering.properties.database};User Id=${adminLogin};Password=${adminPassword}' - EventBusConnection: tempRabbitmqConnectionString - } - ports: { - http: { - containerPort: 80 - provides: orderbgtasksHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-backgroundtasks +resource orderbgtasks 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'ordering-backgroundtasks' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/ordering.backgroundtasks:linux-dev' + env: { + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + UseCustomizationData: 'False' + CheckUpdateTime: '30000' + GracePeriodTime: '1' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' + OrchestratorType: OCHESTRATOR_TYPE + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: 'Server=tcp:${sqlOrderingDb.properties.server},1433;Initial Catalog=${sqlOrderingDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' + EventBusConnection: tempRabbitmqConnectionString } - traits: [] - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlOrdering.id - } - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id - } - } - } - } - - resource orderbgtasksHttp 'HttpRoute' = { - name: 'orderbgtasks-http' - properties: { - port: 5111 - } - } - - // Other --------------------------------------------- - - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webshoppingagg - resource webshoppingagg 'Container' = { - name: 'webshoppingagg' - properties: { - container: { - image: 'eshop/webshoppingagg:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - PATH_BASE: '/webshoppingagg' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - OrchestratorType: OCHESTRATOR_TYPE - IsClusterEnv: 'True' - urls__basket: basketHttp.properties.url - urls__catalog: catalogHttp.properties.url - urls__orders: orderingHttp.properties.url - urls__identity: identityHttp.properties.url - urls__grpcBasket: basketGrpc.properties.url - urls__grpcCatalog: catalogGrpc.properties.url - urls__grpcOrdering: orderingGrpc.properties.url - CatalogUrlHC: '${catalogHttp.properties.url}/hc' - OrderingUrlHC: '${orderingHttp.properties.url}/hc' - IdentityUrlHC: '${identityHttp.properties.url}/hc' - BasketUrlHC: '${basketHttp.properties.url}/hc' - PaymentUrlHC: '${paymentHttp.properties.url}/hc' - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: webshoppingaggHttp.id - } + ports: { + http: { + containerPort: 80 + provides: orderbgtasksHttp.id } } - traits: [] - connections: { - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id - } - identity: { - kind: 'Http' - source: identityHttp.id - } - ordering: { - kind: 'Http' - source: orderingHttp.id - } - catalog: { - kind: 'Http' - source: catalogHttp.id - } - basket: { - kind: 'Http' - source: basketHttp.id + } + traits: [] + connections: { + sql: { + kind: 'microsoft.com/SQL' + source: sqlOrderingDb.id + } + rabbitmq: { + kind: 'rabbitmq.com/MessageQueue' + source: rabbitmq.id + } + } + } +} + +resource orderbgtasksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'orderbgtasks-http' + location: location + properties: { + application: eshop.id + port: 5111 + } +} + +// Other --------------------------------------------- + +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webshoppingagg +resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webshoppingagg' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webshoppingagg:${TAG}' + env: { + ASPNETCORE_ENVIRONMENT: 'Development' + PATH_BASE: '/webshoppingagg' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + urls__basket: basketHttp.properties.url + urls__catalog: catalogHttp.properties.url + urls__orders: orderingHttp.properties.url + urls__identity: identityHttp.properties.url + urls__grpcBasket: basketGrpc.properties.url + urls__grpcCatalog: catalogGrpc.properties.url + urls__grpcOrdering: orderingGrpc.properties.url + CatalogUrlHC: '${catalogHttp.properties.url}/hc' + OrderingUrlHC: '${orderingHttp.properties.url}/hc' + IdentityUrlHC: '${identityHttp.properties.url}/hc' + BasketUrlHC: '${basketHttp.properties.url}/hc' + PaymentUrlHC: '${paymentHttp.properties.url}/hc' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + } + ports: { + http: { + containerPort: 80 + provides: webshoppingaggHttp.id } } } + traits: [] + connections: { + rabbitmq: { + kind: 'rabbitmq.com/MessageQueue' + source: rabbitmq.id + } + identity: { + kind: 'Http' + source: identityHttp.id + } + ordering: { + kind: 'Http' + source: orderingHttp.id + } + catalog: { + kind: 'Http' + source: catalogHttp.id + } + basket: { + kind: 'Http' + source: basketHttp.id + } + } } +} - resource webshoppingaggHttp 'HttpRoute' = { - name: 'webshoppingagg-http' - properties: { - port: 5121 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webshoppingagg: { - path: { - value: '/webshoppingagg' - } +resource webshoppingaggHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingagg-http' + location: location + properties: { + application: eshop.id + port: 5121 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webshoppingagg: { + path: { + value: '/webshoppingagg' } } } } } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/apigwws - resource webshoppingapigw 'Container' = { - name: 'webshoppingapigw' - properties: { - container: { - image: 'radius.azurecr.io/eshop-envoy:0.1.3' - env: {} - ports: { - http: { - containerPort: 80 - provides: webshoppingapigwHttp.id - } - http2: { - containerPort: 8001 - provides: webshoppingapigwHttp2.id - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/apigwws +resource webshoppingapigw 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webshoppingapigw' + location: location + properties: { + application: eshop.id + container: { + image: 'radius.azurecr.io/eshop-envoy:0.1.3' + env: {} + ports: { + http: { + containerPort: 80 + provides: webshoppingapigwHttp.id + } + http2: { + containerPort: 8001 + provides: webshoppingapigwHttp2.id } } - traits: [] - connections: {} } + traits: [] + connections: {} } +} - resource webshoppingapigwHttp 'HttpRoute' = { - name: 'webshoppingapigw-http' - properties: { - port: 5202 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webshoppingapigw: { - path: { - value: '/webshoppingapigw' - } +resource webshoppingapigwHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingapigw-http' + location: location + properties: { + application: eshop.id + port: 5202 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webshoppingapigw: { + path: { + value: '/webshoppingapigw' } } } } } +} - resource webshoppingapigwHttp2 'HttpRoute' = { - name: 'webshoppingapigw-http-2' - properties: { - port: 15202 - } +resource webshoppingapigwHttp2 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingapigw-http-2' + location: location + properties: { + application: eshop.id + port: 15202 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-signalrhub - resource orderingsignalrhub 'Container' = { - name: 'ordering-signalrhub' - properties: { - container: { - image: 'eshop/ordering.signalrhub:${TAG}' - env: { - PATH_BASE: '/payment-api' - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - OrchestratorType: OCHESTRATOR_TYPE - IsClusterEnv: 'True' - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - EventBusConnection: tempRabbitmqConnectionString - SignalrStoreConnectionString: '${redisKeystore.properties.host}' - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: orderingsignalrhubHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-signalrhub +resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'ordering-signalrhub' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/ordering.signalrhub:${TAG}' + env: { + PATH_BASE: '/payment-api' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + EventBusConnection: tempRabbitmqConnectionString + SignalrStoreConnectionString: '${redisKeystore.properties.host}' + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisKeystore.id - } - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id - } - identity: { - kind: 'Http' - source: identityHttp.id - } - ordering: { - kind: 'Http' - source: orderingHttp.id - } - catalog: { - kind: 'Http' - source: catalogHttp.id - } - basket: { - kind: 'Http' - source: basketHttp.id + ports: { + http: { + containerPort: 80 + provides: orderingsignalrhubHttp.id } } } + traits: [] + connections: { + redis: { + kind: 'redislabs.com/Redis' + source: redisKeystore.id + } + rabbitmq: { + kind: 'rabbitmq.com/MessageQueue' + source: rabbitmq.id + } + identity: { + kind: 'Http' + source: identityHttp.id + } + ordering: { + kind: 'Http' + source: orderingHttp.id + } + catalog: { + kind: 'Http' + source: catalogHttp.id + } + basket: { + kind: 'Http' + source: basketHttp.id + } + } } +} - resource orderingsignalrhubHttp 'HttpRoute' = { - name: 'orderingsignalrhub-http' - properties: { - port: 5112 - } +resource orderingsignalrhubHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'orderingsignalrhub-http' + location: location + properties: { + application: eshop.id + port: 5112 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-web - resource webhooksclient 'Container' = { - name: 'webhooks-client' - properties: { - container: { - image: 'eshop/webhooks.client:linux-dev' - env: { - ASPNETCORE_ENVIRONMENT: 'Production' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - PATH_BASE: '/webhooks-web' - Token: 'WebHooks-Demo-Web' - CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' - SelfUrl: webhooksclientHttp.properties.url - WebhooksUrl: webhooksHttp.properties.url - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: webhooksclientHttp.id - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-web +resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webhooks-client' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webhooks.client:linux-dev' + env: { + ASPNETCORE_ENVIRONMENT: 'Production' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + PATH_BASE: '/webhooks-web' + Token: 'WebHooks-Demo-Web' + CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' + SelfUrl: webhooksclientHttp.properties.url + WebhooksUrl: webhooksHttp.properties.url + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + } + ports: { + http: { + containerPort: 80 + provides: webhooksclientHttp.id } } - traits: [] - connections: { + } + traits: [] + connections: { + webhooks: { + kind: 'Http' + source: webhooksHttp.id + } + identity: { + kind: 'Http' + source: identityHttp.id + } + } + } +} + +resource webhooksclientHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooksclient-http' + location: location + properties: { + application: eshop.id + port: 5114 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { webhooks: { - kind: 'Http' - source: webhooksHttp.id - } - identity: { - kind: 'Http' - source: identityHttp.id + path: { + value: '/webhooks-web' + } } } } } +} - resource webhooksclientHttp 'HttpRoute' = { - name: 'webhooksclient-http' - properties: { - port: 5114 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webhooks: { - path: { - value: '/webhooks-web' - } - } +// Sites ---------------------------------------------- + +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webstatus +resource webstatus 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webstatus' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webstatus:${TAG}' + env: { + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + HealthChecksUI__HealthChecks__0__Name: 'WebMVC HTTP Check' + HealthChecksUI__HealthChecks__0__Uri: '${webmvcHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__1__Name: 'WebSPA HTTP Check' + HealthChecksUI__HealthChecks__1__Uri: '${webspaHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__2__Name: 'Web Shopping Aggregator GW HTTP Check' + HealthChecksUI__HealthChecks__2__Uri: '${webshoppingaggHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__4__Name: 'Ordering HTTP Check' + HealthChecksUI__HealthChecks__4__Uri: '${orderingHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__5__Name: 'Basket HTTP Check' + HealthChecksUI__HealthChecks__5__Uri: '${basketHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__6__Name: 'Catalog HTTP Check' + HealthChecksUI__HealthChecks__6__Uri: '${catalogHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__7__Name: 'Identity HTTP Check' + HealthChecksUI__HealthChecks__7__Uri: '${identityHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__8__Name: 'Payments HTTP Check' + HealthChecksUI__HealthChecks__8__Uri: '${paymentHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__9__Name: 'Ordering SignalRHub HTTP Check' + HealthChecksUI__HealthChecks__9__Uri: '${orderingsignalrhubHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__10__Name: 'Ordering HTTP Background Check' + HealthChecksUI__HealthChecks__10__Uri: '${orderbgtasksHttp.properties.url}/hc' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + OrchestratorType: OCHESTRATOR_TYPE + } + ports: { + http: { + containerPort: 80 + provides: webstatusHttp.id } } } + traits: [] + connections: {} } +} - // Sites ---------------------------------------------- - - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webstatus - resource webstatus 'Container' = { - name: 'webstatus' - properties: { - container: { - image: 'eshop/webstatus:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - HealthChecksUI__HealthChecks__0__Name: 'WebMVC HTTP Check' - HealthChecksUI__HealthChecks__0__Uri: '${webmvcHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__1__Name: 'WebSPA HTTP Check' - HealthChecksUI__HealthChecks__1__Uri: '${webspaHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__2__Name: 'Web Shopping Aggregator GW HTTP Check' - HealthChecksUI__HealthChecks__2__Uri: '${webshoppingaggHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__4__Name: 'Ordering HTTP Check' - HealthChecksUI__HealthChecks__4__Uri: '${orderingHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__5__Name: 'Basket HTTP Check' - HealthChecksUI__HealthChecks__5__Uri: '${basketHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__6__Name: 'Catalog HTTP Check' - HealthChecksUI__HealthChecks__6__Uri: '${catalogHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__7__Name: 'Identity HTTP Check' - HealthChecksUI__HealthChecks__7__Uri: '${identityHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__8__Name: 'Payments HTTP Check' - HealthChecksUI__HealthChecks__8__Uri: '${paymentHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__9__Name: 'Ordering SignalRHub HTTP Check' - HealthChecksUI__HealthChecks__9__Uri: '${orderingsignalrhubHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__10__Name: 'Ordering HTTP Background Check' - HealthChecksUI__HealthChecks__10__Uri: '${orderbgtasksHttp.properties.url}/hc' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - OrchestratorType: OCHESTRATOR_TYPE - } - ports: { - http: { - containerPort: 80 - provides: webstatusHttp.id +resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webstatus-http' + location: location + properties: { + application: eshop.id + port: 8107 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webstatus: { + path: { + value: '/webstatus' } } } - traits: [] - connections: {} } } +} - resource webstatusHttp 'HttpRoute' = { - name: 'webstatus-http' - properties: { - port: 8107 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webstatus: { - path: { - value: '/webstatus' - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webspa +resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'web-spa' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webspa:${TAG}' + env: { + PATH_BASE: '/' + ASPNETCORE_ENVIRONMENT: 'Production' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + UseCustomizationData: 'False' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + CallBackUrl: '${CLUSTERDNS}/' + DPConnectionString: '${redisKeystore.properties.host}' + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlHC: '${identityHttp.properties.url}/hc' + PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' + SignalrHubUrl: orderingsignalrhubHttp.properties.url + } + ports: { + http: { + containerPort: 80 + provides: webspaHttp.id } } } + traits: [] + connections: { + redis: { + kind: 'redislabs.com/Redis' + source: redisKeystore.id + } + webshoppingagg: { + kind: 'Http' + source: webshoppingaggHttp.id + } + identity: { + kind: 'Http' + source: identityHttp.id + } + webshoppingapigw: { + kind: 'Http' + source: webshoppingapigwHttp.id + } + orderingsignalrhub: { + kind: 'Http' + source: orderingsignalrhubHttp.id + } + } } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webspa - resource webspa 'Container' = { - name: 'web-spa' - properties: { - container: { - image: 'eshop/webspa:${TAG}' - env: { - PATH_BASE: '/' - ASPNETCORE_ENVIRONMENT: 'Production' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - UseCustomizationData: 'False' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - OrchestratorType: OCHESTRATOR_TYPE - IsClusterEnv: 'True' - CallBackUrl: '${CLUSTERDNS}/' - DPConnectionString: '${redisKeystore.properties.host}' - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' - SignalrHubUrl: orderingsignalrhubHttp.properties.url - } - ports: { - http: { - containerPort: 80 - provides: webspaHttp.id +resource webspaHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webspa-http' + location: location + properties: { + application: eshop.id + port: 5104 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webspa: { + path: { + value: '/' } } } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisKeystore.id - } - webshoppingagg: { - kind: 'Http' - source: webshoppingaggHttp.id - } - identity: { - kind: 'Http' - source: identityHttp.id - } - webshoppingapigw: { - kind: 'Http' - source: webshoppingapigwHttp.id - } - orderingsignalrhub: { - kind: 'Http' - source: orderingsignalrhubHttp.id + } + } +} + +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webmvc +resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webmvc' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webmvc:${TAG}' + env: { + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + PATH_BASE: '/webmvc' + UseCustomizationData: 'False' + DPConnectionString: '${redisKeystore.properties.host}' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' + CallBackUrl: 'http://${CLUSTER_IP}.nip.io/webmvc' + IdentityUrl: 'http://${CLUSTER_IP}.nip.io/identity-api' + IdentityUrlHC: '${identityHttp.properties.url}/hc' + PurchaseUrl: webshoppingapigwHttp.properties.url + SignalrHubUrl: orderingsignalrhubHttp.properties.url + } + ports: { + http: { + containerPort: 80 + provides: webmvcHttp.id } } } + traits: [] + connections: { + redis: { + kind: 'redislabs.com/Redis' + source: redisKeystore.id + } + webshoppingagg: { + kind: 'Http' + source: webshoppingaggHttp.id + } + identity: { + kind: 'Http' + source: identityHttp.id + } + webshoppingapigw: { + kind: 'Http' + source: webshoppingapigwHttp.id + } + orderingsignalrhub: { + kind: 'Http' + source: orderingsignalrhubHttp.id + } + } } +} - resource webspaHttp 'HttpRoute' = { - name: 'webspa-http' - properties: { - port: 5104 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webspa: { - path: { - value: '/' - } +resource webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webmvc-http' + location: location + properties: { + application: eshop.id + port: 5100 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webmvc: { + path: { + value: '/webmvc' } } } } } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webmvc - resource webmvc 'Container' = { - name: 'webmvc' - properties: { - container: { - image: 'eshop/webmvc:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - PATH_BASE: '/webmvc' - UseCustomizationData: 'False' - DPConnectionString: '${redisKeystore.properties.host}' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - UseLoadTest: 'False' - OrchestratorType: OCHESTRATOR_TYPE - IsClusterEnv: 'True' - ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' - CallBackUrl: 'http://${CLUSTER_IP}.nip.io/webmvc' - IdentityUrl: 'http://${CLUSTER_IP}.nip.io/identity-api' - IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: webshoppingapigwHttp.properties.url - SignalrHubUrl: orderingsignalrhubHttp.properties.url - } - ports: { - http: { - containerPort: 80 - provides: webmvcHttp.id - } - } +// Logging -------------------------------------------- + +resource seq 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'seq' + location: location + properties: { + application: eshop.id + container: { + image: 'datalust/seq:latest' + env: { + ACCEPT_EULA: 'Y' } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisKeystore.id - } - webshoppingagg: { - kind: 'Http' - source: webshoppingaggHttp.id - } - identity: { - kind: 'Http' - source: identityHttp.id - } - webshoppingapigw: { - kind: 'Http' - source: webshoppingapigwHttp.id - } - orderingsignalrhub: { - kind: 'Http' - source: orderingsignalrhubHttp.id + ports: { + web: { + containerPort: 80 + provides: seqHttp.id } } } + traits: [] + connections: {} } +} - resource webmvcHttp 'HttpRoute' = { - name: 'webmvc-http' - properties: { - port: 5100 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webmvc: { - path: { - value: '/webmvc' - } - } +resource seqHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'seq-http' + location: location + properties: { + application: eshop.id + port: 5340 + } +} + +// Gateway -------------------------------------------- + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { + name: 'gateway' + location: location + properties: { + application: eshop.id + routes: [ + http: { + protocol: 'HTTP' + port: 80 + } + ] + } +} + +resource rabbitmqContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'rabbitmq-container-eshop-event-bus' + location: location + properties: { + application: eshop.id + container: { + image: 'rabbitmq:3.9' + env: { + //RABBITMQ_DEFAULT_USER: username + //RABBITMQ_DEFAULT_PASS: password + } + ports: { + rabbitmq: { + containerPort: 5672 + provides: rabbitmqRoute.id } } } } +} - // Logging -------------------------------------------- +resource rabbitmqRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'rabbitmq-route-eshop-event-bus' + location: location + properties: { + application: eshop.id + port: 5672 + } +} + +resource rabbitmq 'Applications.Connector/rabbitmqMessageQueues@2022-03-15-privatepreview' = { + name: 'eshop-event-bus' + location: location + properties: { + application: eshop.id + environment: environmentId + queue: 'eshop-event-bus' + secrets: { + connectionString: 'amqp://${rabbitmqRoute.properties.hostname}:${rabbitmqRoute.properties.port}' + } + } +} - resource seq 'Container' = { - name: 'seq' - properties: { - container: { - image: 'datalust/seq:latest' - env: { - ACCEPT_EULA: 'Y' +resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-identitydb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlIdentityRoute.id } - ports: { - web: { - containerPort: 80 - provides: seqHttp.id - } + } + } + } +} + +resource sqlIdentityRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-identitydb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'identitydb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlIdentityRoute.properties.hostname + database: 'IdentityDb' + } +} + +resource sqlCatalogContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-catalogdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlCatalogRoute.id } } - traits: [] - connections: {} } } +} + +resource sqlCatalogRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-catalogdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'catalogdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlCatalogRoute.properties.hostname + database: 'CatalogDb' + } +} - resource seqHttp 'HttpRoute' = { - name: 'seq-http' - properties: { - port: 5340 +resource sqlOrderingContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-orderingdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlOrderingRoute.id + } + } } } +} + +resource sqlOrderingRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-orderingdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'orderingdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlOrderingRoute.properties.hostname + database: 'OrderingDb' + } +} - // Gateway -------------------------------------------- +resource sqlWebhooksContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-webhooksdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlWebhooksRoute.id + } + } + } + } +} - resource gateway 'Gateway' existing = { - name: 'gateway' +resource sqlWebhooksRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-webhooksdb' + location: location + properties: { + application: eshop.id + port: 1433 } +} - // Infrastructure -------------------------------------------- +resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'webhooksdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlWebhooksRoute.properties.hostname + database: 'WebhooksDb' + } +} - resource sqlIdentity 'microsoft.com.SQLDatabase' existing = { - name: 'identitydb' +resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-basket-data' + location: location + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + ports: { + redis: { + containerPort: 6379 + provides: redisBasketRoute.id + } + } + } } +} - resource sqlCatalog 'microsoft.com.SQLDatabase' existing = { - name: 'catalogdb' +resource redisBasketRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-basket-data' + location: location + properties: { + application: eshop.id + port: 6379 } +} - resource sqlOrdering 'microsoft.com.SQLDatabase' existing = { - name: 'orderingdb' +resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { + name: 'basket-data' + location: location + properties: { + application: eshop.id + environment: environmentId + host: redisBasketRoute.properties.hostname + port: redisBasketRoute.properties.port + secrets: { + connectionString: '${redisBasketRoute.properties.hostname}:${redisBasketRoute.properties.port},password=},ssl=True,abortConnect=False' + password: '' + } } +} - resource sqlWebhooks 'microsoft.com.SQLDatabase' existing = { - name: 'webhooksdb' +resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-keystore-data' + location: location + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + ports: { + redis: { + containerPort: 6379 + provides: redisKeystoreRoute.id + } + } + } } +} - resource redisKeystore 'redislabs.com.RedisCache' existing = { - name: 'keystore-data' +resource redisKeystoreRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-keystore-data' + location: location + properties: { + application: eshop.id + port: 6379 } +} - resource redisBasket 'redislabs.com.RedisCache' existing = { - name: 'basket-data' +resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { + name: 'keystore-data' + location: location + properties: { + application: eshop.id + environment: environmentId + host: redisKeystoreRoute.properties.hostname + port: redisKeystoreRoute.properties.port + secrets: { + connectionString: '${redisKeystoreRoute.properties.hostname}:${redisKeystoreRoute.properties.port},password=},ssl=True,abortConnect=False' + password: '' + } + } +} +resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'mongo-container' + location: location + properties: { + application: eshop.id + container: { + image: 'mongo:4.2' + env: { + MONGO_INITDB_ROOT_USERNAME: mongoUsername + MONGO_INITDB_ROOT_PASSWORD: mongoPassword + } + ports: { + mongo: { + containerPort: 27017 + provides: mongoRoute.id + } + } + } } +} - resource mongo 'mongo.com.MongoDatabase' existing = { - name: 'mongo' +resource mongoRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'mongo-route' + location: location + properties: { + application: eshop.id + port: 27017 } +} - resource rabbitmq 'rabbitmq.com.MessageQueue' existing = { - name: 'eshop_event_bus' +resource mongo 'Applications.Connector/mongoDatabases@2022-03-15-privatepreview' = { + name: 'mongo' + location: location + properties: { + application: eshop.id + environment: environmentId + secrets: { + connectionString: 'mongodb://${mongoUsername}:${mongoPassword}@${mongoRoute.properties.hostname}:${mongoRoute.properties.port}' + username: mongoUsername + password: mongoPassword + } } } diff --git a/reference-apps/eshop/iac/infra.azure.bicep b/reference-apps/eshop/iac/infra.azure.bicep index 1906b5df..8c12d332 100644 --- a/reference-apps/eshop/iac/infra.azure.bicep +++ b/reference-apps/eshop/iac/infra.azure.bicep @@ -1,28 +1,42 @@ +import radius as radius + // Parameters -------------------------------------------- +param environmentId string + param location string = resourceGroup().location + param adminLogin string = 'sqladmin' + @secure() param adminPassword string -resource eshop 'radius.dev/Application@v1alpha3' = { - name: 'eshop' +param mongoUsername string = 'admin' + +param mongoPassword string = newGuid() - // Gateway -------------------------------------------- +resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'eshop' + location: location + properties: { + environment: environmentId + } +} +// Gateway -------------------------------------------- - resource gateway 'Gateway' = { +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { name: 'gateway' + location: location properties: { - listeners: { + application: eshop.id + routes: [ http: { protocol: 'HTTP' port: 80 } - } + ] } } -} - // Infrastructure resource servicebus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' = { @@ -156,75 +170,295 @@ resource servicebus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' = { } -// Starters --------------------------------------------------------- +resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-identitydb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlIdentityRoute.id + } + } + } + } +} -module sqlIdentity 'br:radius.azurecr.io/starters/sql-azure:latest' = { - name: 'sql-identity' - params: { - adminUsername: adminLogin - adminPassword: adminPassword - databaseName: 'IdentityDb' - location: location - radiusApplication: eshop +resource sqlIdentityRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-identitydb' + location: location + properties: { + application: eshop.id + port: 1433 } } -module sqlCatalog 'br:radius.azurecr.io/starters/sql-azure:latest' = { - name: 'sql-catalog' - params: { - adminUsername: adminLogin - adminPassword: adminPassword - databaseName: 'CatalogDb' - location: location - radiusApplication: eshop +resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'identitydb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlIdentityRoute.properties.hostname + database: 'IdentityDb' } } -module sqlOrdering 'br:radius.azurecr.io/starters/sql-azure:latest' = { - name: 'sql-ordering' - params: { - adminUsername: adminLogin - adminPassword: adminPassword - databaseName: 'OrderingDb' - location: location - radiusApplication: eshop +resource sqlCatalogContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-catalogdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlCatalogRoute.id + } + } + } } } -module sqlWebhooks 'br:radius.azurecr.io/starters/sql-azure:latest' = { - name: 'sql-webhooks' - params: { - adminUsername: adminLogin - adminPassword: adminPassword - databaseName: 'WebhooksDb' - location: location - radiusApplication: eshop +resource sqlCatalogRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-catalogdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'catalogdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlCatalogRoute.properties.hostname + database: 'CatalogDb' + } +} + +resource sqlOrderingContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-orderingdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlOrderingRoute.id + } + } + } + } +} + +resource sqlOrderingRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-orderingdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'orderingdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlOrderingRoute.properties.hostname + database: 'OrderingDb' + } +} + +resource sqlWebhooksContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-webhooksdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlWebhooksRoute.id + } + } + } + } +} + +resource sqlWebhooksRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-webhooksdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'webhooksdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlWebhooksRoute.properties.hostname + database: 'WebhooksDb' } } -module redisBasket 'br:radius.azurecr.io/starters/redis-azure:latest' = { +resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-basket-data' + location: location + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + ports: { + redis: { + containerPort: 6379 + provides: redisBasketRoute.id + } + } + } + } +} + +resource redisBasketRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-basket-data' + location: location + properties: { + application: eshop.id + port: 6379 + } +} + +resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { name: 'basket-data' - params: { - cacheName: 'basket-data' - location: location - radiusApplication: eshop + location: location + properties: { + application: eshop.id + environment: environmentId + host: redisBasketRoute.properties.hostname + port: redisBasketRoute.properties.port + secrets: { + connectionString: '${redisBasketRoute.properties.hostname}:${redisBasketRoute.properties.port},password=},ssl=True,abortConnect=False' + password: '' + } } } -module redisKeystore 'br:radius.azurecr.io/starters/redis-azure:latest' = { +resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-keystore-data' + location: location + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + ports: { + redis: { + containerPort: 6379 + provides: redisKeystoreRoute.id + } + } + } + } +} + +resource redisKeystoreRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-keystore-data' + location: location + properties: { + application: eshop.id + port: 6379 + } +} + +resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { name: 'keystore-data' - params: { - cacheName: 'keystore-data' - location: location - radiusApplication: eshop + location: location + properties: { + application: eshop.id + environment: environmentId + host: redisKeystoreRoute.properties.hostname + port: redisKeystoreRoute.properties.port + secrets: { + connectionString: '${redisKeystoreRoute.properties.hostname}:${redisKeystoreRoute.properties.port},password=},ssl=True,abortConnect=False' + password: '' + } + } +} +resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'mongo-container' + location: location + properties: { + application: eshop.id + container: { + image: 'mongo:4.2' + env: { + MONGO_INITDB_ROOT_USERNAME: mongoUsername + MONGO_INITDB_ROOT_PASSWORD: mongoPassword + } + ports: { + mongo: { + containerPort: 27017 + provides: mongoRoute.id + } + } + } } } -module mongo 'br:radius.azurecr.io/starters/mongo-azure:latest' = { - name: 'mongo' - params: { - dbName: 'mongo' - location: location - radiusApplication: eshop +resource mongoRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'mongo-route' + location: location + properties: { + application: eshop.id + port: 27017 } } + +resource mongo 'Applications.Connector/mongoDatabases@2022-03-15-privatepreview' = { + name: 'mongo' + location: location + properties: { + application: eshop.id + environment: environmentId + secrets: { + connectionString: 'mongodb://${mongoUsername}:${mongoPassword}@${mongoRoute.properties.hostname}:${mongoRoute.properties.port}' + username: mongoUsername + password: mongoPassword + } + } +} \ No newline at end of file From f6a178c9a9ee9fa09badafcd6b0405feb2c09000 Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Tue, 26 Jul 2022 15:10:14 -0400 Subject: [PATCH 03/14] remove traits from app.bicep --- reference-apps/eshop/iac/app.bicep | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/reference-apps/eshop/iac/app.bicep b/reference-apps/eshop/iac/app.bicep index fe4f9df7..ebcdee16 100644 --- a/reference-apps/eshop/iac/app.bicep +++ b/reference-apps/eshop/iac/app.bicep @@ -112,7 +112,7 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' OrchestratorType: 'K8S' IsClusterEnv: 'True' - DPConnectionString: '${redisKeystore.properties.host}' + DPConnectionString: redisKeystore.properties.host ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY XamarinCallback: '' EnableDevspaces: ENABLEDEVSPACES @@ -132,7 +132,7 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - traits: [] + connections: { redis: { kind: 'redislabs.com/Redis' @@ -232,7 +232,6 @@ resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - traits: [] connections: { sql: { kind: 'microsoft.com/SQL' @@ -313,7 +312,6 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - traits: [] connections: { redis: { kind: 'redislabs.com/Redis' @@ -386,7 +384,7 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - traits: [] + connections: { sql: { kind: 'microsoft.com/SQL' @@ -447,7 +445,6 @@ resource payment 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - traits: [] connections: { rabbitmq: { kind: 'rabbitmq.com/MessageQueue' @@ -495,7 +492,6 @@ resource orderbgtasks 'Applications.Core/containers@2022-03-15-privatepreview' = } } } - traits: [] connections: { sql: { kind: 'microsoft.com/SQL' @@ -555,7 +551,6 @@ resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' } } } - traits: [] connections: { rabbitmq: { kind: 'rabbitmq.com/MessageQueue' @@ -621,7 +616,6 @@ resource webshoppingapigw 'Applications.Core/containers@2022-03-15-privateprevie } } } - traits: [] connections: {} } } @@ -683,7 +677,6 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev } } } - traits: [] connections: { redis: { kind: 'redislabs.com/Redis' @@ -747,7 +740,6 @@ resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' } } } - traits: [] connections: { webhooks: { kind: 'Http' @@ -824,7 +816,6 @@ resource webstatus 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - traits: [] connections: {} } } @@ -879,7 +870,6 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - traits: [] connections: { redis: { kind: 'redislabs.com/Redis' @@ -938,7 +928,7 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webmvc' UseCustomizationData: 'False' - DPConnectionString: '${redisKeystore.properties.host}' + DPConnectionString: redisKeystore.properties.host ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY UseLoadTest: 'False' OrchestratorType: OCHESTRATOR_TYPE @@ -957,7 +947,6 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - traits: [] connections: { redis: { kind: 'redislabs.com/Redis' @@ -1022,7 +1011,6 @@ resource seq 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - traits: [] connections: {} } } From 8283fc2cf17841bdcd4c84c72baaf06deb5c450e Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Tue, 26 Jul 2022 15:14:52 -0400 Subject: [PATCH 04/14] remove kind property app.bicep --- reference-apps/eshop/iac/app.bicep | 46 ------------------------------ 1 file changed, 46 deletions(-) diff --git a/reference-apps/eshop/iac/app.bicep b/reference-apps/eshop/iac/app.bicep index ebcdee16..750d173b 100644 --- a/reference-apps/eshop/iac/app.bicep +++ b/reference-apps/eshop/iac/app.bicep @@ -69,11 +69,9 @@ resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { } connections: { sql: { - kind: 'microsoft.com/SQL' source: sqlCatalogDb.id } rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' source: rabbitmq.id } } @@ -135,39 +133,30 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { connections: { redis: { - kind: 'redislabs.com/Redis' source: redisKeystore.id } sql: { - kind: 'microsoft.com/SQL' source: sqlIdentityDb.id } webmvc: { - kind: 'Http' source: webmvcHttp.id } webspa: { - kind: 'Http' source: webspaHttp.id } basket: { - kind: 'Http' source: basketHttp.id } ordering: { - kind: 'Http' source: orderingHttp.id } webshoppingagg: { - kind: 'Http' source: webshoppingaggHttp.id } webhooks: { - kind: 'Http' source: webhooksHttp.id } webhoolsclient: { - kind: 'Http' source: webhooksclientHttp.id } } @@ -234,15 +223,12 @@ resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { } connections: { sql: { - kind: 'microsoft.com/SQL' source: sqlOrderingDb.id } rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' source: rabbitmq.id } identity: { - kind: 'Http' source: identityHttp.id } } @@ -314,15 +300,12 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { } connections: { redis: { - kind: 'redislabs.com/Redis' source: redisBasket.id } rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' source: rabbitmq.id } identity: { - kind: 'Http' source: identityHttp.id } } @@ -387,15 +370,12 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { connections: { sql: { - kind: 'microsoft.com/SQL' source: sqlWebhooksDb.id } rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' source: rabbitmq.id } identity: { - kind: 'Http' source: identityHttp.id } } @@ -447,7 +427,6 @@ resource payment 'Applications.Core/containers@2022-03-15-privatepreview' = { } connections: { rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' source: rabbitmq.id } } @@ -494,11 +473,9 @@ resource orderbgtasks 'Applications.Core/containers@2022-03-15-privatepreview' = } connections: { sql: { - kind: 'microsoft.com/SQL' source: sqlOrderingDb.id } rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' source: rabbitmq.id } } @@ -553,23 +530,18 @@ resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' } connections: { rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' source: rabbitmq.id } identity: { - kind: 'Http' source: identityHttp.id } ordering: { - kind: 'Http' source: orderingHttp.id } catalog: { - kind: 'Http' source: catalogHttp.id } basket: { - kind: 'Http' source: basketHttp.id } } @@ -679,27 +651,21 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev } connections: { redis: { - kind: 'redislabs.com/Redis' source: redisKeystore.id } rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' source: rabbitmq.id } identity: { - kind: 'Http' source: identityHttp.id } ordering: { - kind: 'Http' source: orderingHttp.id } catalog: { - kind: 'Http' source: catalogHttp.id } basket: { - kind: 'Http' source: basketHttp.id } } @@ -742,11 +708,9 @@ resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' } connections: { webhooks: { - kind: 'Http' source: webhooksHttp.id } identity: { - kind: 'Http' source: identityHttp.id } } @@ -872,23 +836,18 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { } connections: { redis: { - kind: 'redislabs.com/Redis' source: redisKeystore.id } webshoppingagg: { - kind: 'Http' source: webshoppingaggHttp.id } identity: { - kind: 'Http' source: identityHttp.id } webshoppingapigw: { - kind: 'Http' source: webshoppingapigwHttp.id } orderingsignalrhub: { - kind: 'Http' source: orderingsignalrhubHttp.id } } @@ -949,23 +908,18 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { } connections: { redis: { - kind: 'redislabs.com/Redis' source: redisKeystore.id } webshoppingagg: { - kind: 'Http' source: webshoppingaggHttp.id } identity: { - kind: 'Http' source: identityHttp.id } webshoppingapigw: { - kind: 'Http' source: webshoppingapigwHttp.id } orderingsignalrhub: { - kind: 'Http' source: orderingsignalrhubHttp.id } } From d3c2148430faed08db83daef826d7e60b2bd2fa2 Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Wed, 27 Jul 2022 12:10:32 -0400 Subject: [PATCH 05/14] update types app.azure.bicep and ignore default container env variables --- reference-apps/eshop/iac/app.azure.bicep | 1871 +++++++++++++--------- reference-apps/eshop/iac/app.bicep | 36 +- 2 files changed, 1127 insertions(+), 780 deletions(-) diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index d0ae5147..01a26405 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -1,3 +1,14 @@ +import radius as radius + +// Parameters -------------------------------------------- +param environmentId string + +param location string = resourceGroup().location + +param mongoUsername string = 'admin' + +param mongoPassword string = newGuid() + param ESHOP_EXTERNAL_DNS_NAME_OR_IP string = '*' param CLUSTER_IP string param OCHESTRATOR_TYPE string = 'K8S' @@ -27,973 +38,1283 @@ resource servicebus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' existin } -resource eshop 'radius.dev/Application@v1alpha3' existing = { +resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { name: 'eshop' - - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/catalog-api - resource catalog 'Container' = { - name: 'catalog-api' - properties: { - container: { - image: 'eshop/catalog.api:${TAG}' - env: { - UseCustomizationData: 'False' - PATH_BASE: '/catalog-api' - ASPNETCORE_ENVIRONMENT: 'Development' - OrchestratorType: OCHESTRATOR_TYPE - PORT: '80' - GRPC_PORT: '81' - PicBaseUrl: PICBASEURL - AzureStorageEnabled: AZURESTORAGEENABLED - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: 'Server=tcp:${sqlCatalog.properties.server},1433;Initial Catalog=${sqlCatalog.properties.database};User Id=${adminLogin};Password=${adminPassword};' - EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - } - ports: { - http: { - containerPort: 80 - provides: catalogHttp.id - } - grpc: { - containerPort: 81 - } - } + location: location + properties: { + environment: environmentId + } +} +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/catalog-api +resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'catalog-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/catalog.api:${TAG}' + env: { + disableDefaultEnvVars: 'True' + UseCustomizationData: 'False' + PATH_BASE: '/catalog-api' + ASPNETCORE_ENVIRONMENT: 'Development' + OrchestratorType: OCHESTRATOR_TYPE + PORT: '80' + GRPC_PORT: '81' + PicBaseUrl: PICBASEURL + AzureStorageEnabled: AZURESTORAGEENABLED + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: 'Server=tcp:${sqlCatalogDb.properties.server},1433;Initial Catalog=${sqlCatalogDb.properties.database};User Id=${adminLogin};Password=${adminPassword};' + EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString } - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlCatalog.id + ports: { + http: { + containerPort: 80 + provides: catalogHttp.id } - servicebus: { - kind: 'azure' - source: servicebus.id + grpc: { + containerPort: 81 } } } + connections: { + sql: { + source: sqlCatalogDb.id + } + servicebus: { + source: servicebus.id + } + } } +} - resource catalogHttp 'HttpRoute' = { - name: 'catalog-http' - properties: { - port: 5101 - } +resource catalogHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'catalog-http' + location: location + properties: { + application: eshop.id + port: 5101 } +} - resource catalogGrpc 'HttpRoute' = { - name: 'catalog-grpc' - properties: { - port: 9101 - } +resource catalogGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'catalog-grpc' + location: location + properties: { + application: eshop.id + port: 9101 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/identity-api - resource identity 'Container' = { - name: 'identity-api' - properties: { - container: { - image: 'eshop/identity.api:${TAG}' - env: { - PATH_BASE: '/identity-api' - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - OrchestratorType: OCHESTRATOR_TYPE - IsClusterEnv: 'True' - DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - XamarinCallback: '' - EnableDevspaces: ENABLEDEVSPACES - ConnectionString: 'Server=tcp:${sqlIdentity.properties.server},1433;Initial Catalog=${sqlIdentity.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' - MvcClient: 'http://${CLUSTERDNS}${webmvcHttp.properties.gateway.rules.webmvc.path.value}' - SpaClient: CLUSTERDNS - BasketApiClient: 'http://${CLUSTERDNS}${basketHttp.properties.gateway.rules.basket.path.value}' - OrderingApiClient: 'http://${CLUSTERDNS}${orderingHttp.properties.gateway.rules.ordering.path.value}' - WebShoppingAggClient: 'http://${CLUSTERDNS}${webshoppingaggHttp.properties.gateway.rules.webshoppingagg.path.value}' - WebhooksApiClient: 'http://${CLUSTERDNS}${webhooksHttp.properties.gateway.rules.webhooks.path.value}' - WebhooksWebClient: 'http://${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: identityHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/identity-api +resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'identity-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/identity.api:${TAG}' + env: { + disableDefaultEnvVars: 'True' + PATH_BASE: '/identity-api' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + XamarinCallback: '' + EnableDevspaces: ENABLEDEVSPACES + ConnectionString: 'Server=tcp:${sqlIdentityDb.properties.server},1433;Initial Catalog=${sqlIdentityDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' + MvcClient: 'http://${CLUSTERDNS}${webmvcHttp.properties.gateway.rules.webmvc.path.value}' + SpaClient: CLUSTERDNS + BasketApiClient: 'http://${CLUSTERDNS}${basketHttp.properties.gateway.rules.basket.path.value}' + OrderingApiClient: 'http://${CLUSTERDNS}${orderingHttp.properties.gateway.rules.ordering.path.value}' + WebShoppingAggClient: 'http://${CLUSTERDNS}${webshoppingaggHttp.properties.gateway.rules.webshoppingagg.path.value}' + WebhooksApiClient: 'http://${CLUSTERDNS}${webhooksHttp.properties.gateway.rules.webhooks.path.value}' + WebhooksWebClient: 'http://${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisKeystore.id - } - sql: { - kind: 'microsoft.com/SQL' - source: sqlIdentity.id - } - webmvc: { - kind: 'Http' - source: webmvcHttp.id - } - webspa: { - kind: 'Http' - source: webspaHttp.id - } - basket: { - kind: 'Http' - source: basketHttp.id - } - ordering: { - kind: 'Http' - source: orderingHttp.id - } - webshoppingagg: { - kind: 'Http' - source: webshoppingaggHttp.id - } - webhooks: { - kind: 'Http' - source: webhooksHttp.id - } - webhooksclient: { - kind: 'Http' - source: webhooksclientHttp.id + ports: { + http: { + containerPort: 80 + provides: identityHttp.id } } } + connections: { + redis: { + source: redisKeystore.id + } + sql: { + source: sqlIdentityDb.id + } + webmvc: { + source: webmvcHttp.id + } + webspa: { + source: webspaHttp.id + } + basket: { + source: basketHttp.id + } + ordering: { + source: orderingHttp.id + } + webshoppingagg: { + source: webshoppingaggHttp.id + } + webhooks: { + source: webhooksHttp.id + } + webhoolsclient: { + source: webhooksclientHttp.id + } + } } +} - resource identityHttp 'HttpRoute' = { - name: 'identity-http' - properties: { - port: 5105 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - identity: { - path: { - value: '/identity-api' - } +resource identityHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'identity-http' + location: location + properties: { + application: eshop.id + port: 5105 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + identity: { + path: { + value: '/identity-api' } } } } } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-api - resource ordering 'Container' = { - name: 'ordering-api' - properties: { - container: { - image: 'eshop/ordering.api:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - UseCustomizationData: 'False' - AzureServiceBusEnabled: 'True' - CheckUpdateTime: '30000' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - OrchestratorType: OCHESTRATOR_TYPE - UseLoadTest: 'False' - 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' - 'Serilog__MinimumLevel__Override__ordering-api': 'Verbose' - PATH_BASE: '/ordering-api' - GRPC_PORT: '81' - PORT: '80' - ConnectionString: 'Server=tcp:${sqlOrdering.properties.server},1433;Initial Catalog=${sqlOrdering.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' - EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: orderingHttp.id - } - grpc: { - containerPort: 81 - provides: orderingGrpc.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-api +resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'ordering-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/ordering.api:${TAG}' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + UseCustomizationData: 'False' + AzureServiceBusEnabled: 'True' + CheckUpdateTime: '30000' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + OrchestratorType: OCHESTRATOR_TYPE + UseLoadTest: 'False' + 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' + 'Serilog__MinimumLevel__Override__ordering-api': 'Verbose' + PATH_BASE: '/ordering-api' + GRPC_PORT: '81' + PORT: '80' + ConnectionString: 'Server=tcp:${sqlOrderingDb.properties.server},1433;Initial Catalog=${sqlOrderingDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' + EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' } - traits: [] - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlOrdering.id - } - identity: { - kind: 'Http' - source: identityHttp.id + ports: { + http: { + containerPort: 80 + provides: orderingHttp.id } - servicebus: { - kind: 'azure' - source: servicebus.id + grpc: { + containerPort: 81 + provides: orderingGrpc.id } } } + connections: { + sql: { + source: sqlOrderingDb.id + } + identity: { + source: identityHttp.id + } + servicebus: { + source: servicebus.id + } + } } +} - resource orderingHttp 'HttpRoute' = { - name: 'ordering-http' - properties: { - port: 5102 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - ordering: { - path: { - value: '/ordering-api' - } +resource orderingHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'ordering-http' + location: location + properties: { + application: eshop.id + port: 5102 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + ordering: { + path: { + value: '/ordering-api' } } } } } +} - resource orderingGrpc 'HttpRoute' = { - name: 'ordering-grpc' - properties: { - port: 9102 - } +resource orderingGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'ordering-grpc' + location: location + properties: { + application: eshop.id + port: 9102 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/basket-api - resource basket 'Container' = { - name: 'basket-api' - properties: { - container: { - image: 'radius.azurecr.io/eshop-basket:linux-latest' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - UseLoadTest: 'False' - PATH_BASE: '/basket-api' - OrchestratorType: OCHESTRATOR_TYPE - PORT: '80' - GRPC_PORT: '81' - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port},password=${redisBasket.password()},ssl=True,abortConnect=False,sslprotocols=tls12' - EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: basketHttp.id - } - grpc: { - containerPort: 81 - provides: basketGrpc.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/basket-api +resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'basket-api' + location: location + properties: { + application: eshop.id + container: { + image: 'radius.azurecr.io/eshop-basket:linux-latest' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + PATH_BASE: '/basket-api' + OrchestratorType: OCHESTRATOR_TYPE + PORT: '80' + GRPC_PORT: '81' + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port},password=${redisBasket.password()},ssl=True,abortConnect=False,sslprotocols=tls12' + EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + } + ports: { + http: { + containerPort: 80 + provides: basketHttp.id } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisBasket.id - } - identity: { - kind: 'Http' - source: identityHttp.id - } - servicebus: { - kind: 'azure' - source: servicebus.id - } + grpc: { + containerPort: 81 + provides: basketGrpc.id + } + } + } + connections: { + redis: { + source: redisBasket.id + } + identity: { + source: identityHttp.id + } + servicebus: { + source: servicebus.id } } } +} - resource basketHttp 'HttpRoute' = { - name: 'basket-http' - properties: { - port: 5103 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - basket: { - path: { - value: '/basket-api' - } +resource basketHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'basket-http' + location: location + properties: { + application: eshop.id + port: 5103 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + basket: { + path: { + value: '/basket-api' } } } } } +} - resource basketGrpc 'HttpRoute' = { - name: 'basket-grpc' - properties: { - port: 9103 - } +resource basketGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'basket-grpc' + location: location + properties: { + application: eshop.id + port: 9103 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-api - resource webhooks 'Container' = { - name: 'webhooks-api' - properties: { - container: { - image: 'eshop/webhooks.api:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - OrchestratorType: OCHESTRATOR_TYPE - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: 'Server=tcp:${sqlWebhooks.properties.server},1433;Initial Catalog=${sqlWebhooks.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' - EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: webhooksHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-api +resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webhooks-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webhooks.api:${TAG}' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + OrchestratorType: OCHESTRATOR_TYPE + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: 'Server=tcp:${sqlWebhooksDb.properties.server},1433;Initial Catalog=${sqlWebhooksDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' + EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' } - traits: [] - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlWebhooks.id - } - identity: { - kind: 'Http' - source: identityHttp.id - } - servicebus: { - kind: 'azure' - source: servicebus.id + ports: { + http: { + containerPort: 80 + provides: webhooksHttp.id } } } + connections: { + sql: { + source: sqlWebhooksDb.id + } + identity: { + source: identityHttp.id + } + servicebus: { + source: servicebus.id + } + } } +} - resource webhooksHttp 'HttpRoute' = { - name: 'webhooks-http' - properties: { - port: 5113 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webhooks: { - path: { - value: '/webhooks-api' - } +resource webhooksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooks-http' + location: location + properties: { + application: eshop.id + port: 5113 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webhooks: { + path: { + value: '/webhooks-api' } } } } } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/payment-api - resource payment 'Container' = { - name: 'payment-api' - properties: { - container: { - image: 'eshop/payment.api:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - 'Serilog__MinimumLevel__Override__payment-api.IntegrationEvents.EventHandling': 'Verbose' - 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' - OrchestratorType: OCHESTRATOR_TYPE - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - } - ports: { - http: { - containerPort: 80 - provides: paymentHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/payment-api +resource payment 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'payment-api' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/payment.api:${TAG}' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + 'Serilog__MinimumLevel__Override__payment-api.IntegrationEvents.EventHandling': 'Verbose' + 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' + OrchestratorType: OCHESTRATOR_TYPE + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString } - traits: [] - connections: { - servicebus: { - kind: 'azure' - source: servicebus.id + ports: { + http: { + containerPort: 80 + provides: paymentHttp.id } } } + connections: { + servicebus: { + source: servicebus.id + } + } } +} - resource paymentHttp 'HttpRoute' = { - name: 'payment-http' - properties: { - port: 5108 - } +resource paymentHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'payment-http' + location: location + properties: { + application: eshop.id + port: 5108 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-backgroundtasks - resource orderbgtasks 'Container' = { - name: 'ordering-backgroundtasks' - properties: { - container: { - image: 'eshop/ordering.backgroundtasks:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - PATH_BASE: '/ordering-backgroundtasks' - UseCustomizationData: 'False' - CheckUpdateTime: '30000' - GracePeriodTime: '1' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - UseLoadTest: 'False' - 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' - OrchestratorType: OCHESTRATOR_TYPE - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: 'Server=tcp:${sqlOrdering.properties.server},1433;Initial Catalog=${sqlOrdering.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' - EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - } - ports: { - http: { - containerPort: 80 - provides: orderbgtasksHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-backgroundtasks +resource orderbgtasks 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'ordering-backgroundtasks' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/ordering.backgroundtasks:${TAG}' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + PATH_BASE: '/ordering-backgroundtasks' + UseCustomizationData: 'False' + CheckUpdateTime: '30000' + GracePeriodTime: '1' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' + OrchestratorType: OCHESTRATOR_TYPE + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: 'Server=tcp:${sqlOrderingDb.properties.server},1433;Initial Catalog=${sqlOrderingDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' + EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString } - traits: [] - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlOrdering.id - } - servicebus: { - kind: 'azure' - source: servicebus.id + ports: { + http: { + containerPort: 80 + provides: orderbgtasksHttp.id } } } + connections: { + sql: { + source: sqlOrderingDb.id + } + servicebus: { + source: servicebus.id + } + } } +} - resource orderbgtasksHttp 'HttpRoute' = { - name: 'orderbgtasks-http' - properties: { - port: 5111 - } +resource orderbgtasksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'orderbgtasks-http' + location: location + properties: { + application: eshop.id + port: 5111 } +} - // Other --------------------------------------------- +// Other --------------------------------------------- - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webshoppingagg - resource webshoppingagg 'Container' = { - name: 'webshoppingagg' - properties: { - container: { - image: 'eshop/webshoppingagg:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - PATH_BASE: '/webshoppingagg' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - OrchestratorType: OCHESTRATOR_TYPE - urls__basket: basketHttp.properties.url - urls__catalog: catalogHttp.properties.url - urls__orders: orderingHttp.properties.url - urls__identity: identityHttp.properties.url - urls__grpcBasket: basketGrpc.properties.url - urls__grpcCatalog: catalogGrpc.properties.url - urls__grpcOrdering: orderingGrpc.properties.url - CatalogUrlHC: '${catalogHttp.properties.url}/hc' - OrderingUrlHC: '${orderingHttp.properties.url}/hc' - IdentityUrlHC: '${identityHttp.properties.url}/hc' - BasketUrlHC: '${basketHttp.properties.url}/hc' - PaymentUrlHC: '${paymentHttp.properties.url}/hc' - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: webshoppingaggHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webshoppingagg +resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webshoppingagg' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webshoppingagg:${TAG}' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + PATH_BASE: '/webshoppingagg' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + OrchestratorType: OCHESTRATOR_TYPE + urls__basket: basketHttp.properties.url + urls__catalog: catalogHttp.properties.url + urls__orders: orderingHttp.properties.url + urls__identity: identityHttp.properties.url + urls__grpcBasket: basketGrpc.properties.url + urls__grpcCatalog: catalogGrpc.properties.url + urls__grpcOrdering: orderingGrpc.properties.url + CatalogUrlHC: '${catalogHttp.properties.url}/hc' + OrderingUrlHC: '${orderingHttp.properties.url}/hc' + IdentityUrlHC: '${identityHttp.properties.url}/hc' + BasketUrlHC: '${basketHttp.properties.url}/hc' + PaymentUrlHC: '${paymentHttp.properties.url}/hc' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' } - traits: [] - connections: { - identity: { - kind: 'Http' - source: identityHttp.id - } - ordering: { - kind: 'Http' - source: orderingHttp.id - } - catalog: { - kind: 'Http' - source: catalogHttp.id - } - basket: { - kind: 'Http' - source: basketHttp.id + ports: { + http: { + containerPort: 80 + provides: webshoppingaggHttp.id } } } + connections: { + identity: { + source: identityHttp.id + } + ordering: { + source: orderingHttp.id + } + catalog: { + source: catalogHttp.id + } + basket: { + source: basketHttp.id + } + } } +} - resource webshoppingaggHttp 'HttpRoute' = { - name: 'webshoppingagg-http' - properties: { - port: 5121 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webshoppingagg: { - path: { - value: '/webshoppingagg' - } +resource webshoppingaggHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingagg-http' + location: location + properties: { + application: eshop.id + port: 5121 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webshoppingagg: { + path: { + value: '/webshoppingagg' } } } } } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/apigwws - resource webshoppingapigw 'Container' = { - name: 'webshoppingapigw' - properties: { - container: { - image: 'radius.azurecr.io/eshop-envoy:0.1.3' - env: {} - ports: { - http: { - containerPort: 80 - provides: webshoppingapigwHttp.id - } - http2: { - containerPort: 8001 - provides: webshoppingapigwHttp2.id - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/apigwws +resource webshoppingapigw 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webshoppingapigw' + location: location + properties: { + application: eshop.id + container: { + image: 'radius.azurecr.io/eshop-envoy:0.1.3' + env: { + disableDefaultEnvVars: 'True' + } + ports: { + http: { + containerPort: 80 + provides: webshoppingapigwHttp.id + } + http2: { + containerPort: 8001 + provides: webshoppingapigwHttp2.id } } - traits: [] - connections: {} } + connections: {} } +} - resource webshoppingapigwHttp 'HttpRoute' = { - name: 'webshoppingapigw-http' - properties: { - port: 5202 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webshoppingapigw: { - path: { - value: '/webshoppingapigw' - } +resource webshoppingapigwHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingapigw-http' + location: location + properties: { + application: eshop.id + port: 5202 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webshoppingapigw: { + path: { + value: '/webshoppingapigw' } } } } } +} - resource webshoppingapigwHttp2 'HttpRoute' = { - name: 'webshoppingapigw-http-2' - properties: { - port: 15202 - } +resource webshoppingapigwHttp2 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingapigw-http-2' + location: location + properties: { + application: eshop.id + port: 15202 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-signalrhub - resource orderingsignalrhub 'Container' = { - name: 'ordering-signalrhub' - properties: { - container: { - image: 'eshop/ordering.signalrhub:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - PATH_BASE: '/ordering-signalrhub' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - OrchestratorType: OCHESTRATOR_TYPE - IsClusterEnv: 'True' - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' - IdentityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: orderingsignalrhubHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-signalrhub +resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'ordering-signalrhub' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/ordering.signalrhub:${TAG}' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + PATH_BASE: '/ordering-signalrhub' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString + SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + IdentityUrl: identityHttp.properties.url + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisKeystore.id - } - identity: { - kind: 'Http' - source: identityHttp.id - } - ordering: { - kind: 'Http' - source: orderingHttp.id - } - catalog: { - kind: 'Http' - source: catalogHttp.id - } - basket: { - kind: 'Http' - source: basketHttp.id - } - servicebus: { - kind: 'azure' - source: servicebus.id + ports: { + http: { + containerPort: 80 + provides: orderingsignalrhubHttp.id } } } + connections: { + redis: { + source: redisKeystore.id + } + identity: { + source: identityHttp.id + } + ordering: { + source: orderingHttp.id + } + catalog: { + source: catalogHttp.id + } + basket: { + source: basketHttp.id + } + servicebus: { + source: servicebus.id + } + } } +} - resource orderingsignalrhubHttp 'HttpRoute' = { - name: 'orderingsignalrhub-http' - properties: { - port: 5112 - } +resource orderingsignalrhubHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'orderingsignalrhub-http' + location: location + properties: { + application: eshop.id + port: 5112 } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-web - resource webhooksclient 'Container' = { - name: 'webhooks-client' - properties: { - container: { - image: 'eshop/webhooks.client:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Production' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - PATH_BASE: '/webhooks-web' - Token: 'WebHooks-Demo-Web' - CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' - SelfUrl: webhooksclientHttp.properties.url - WebhooksUrl: webhooksHttp.properties.url - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: webhooksclientHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-web +resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webhooks-client' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webhooks.client:${TAG}' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Production' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + PATH_BASE: '/webhooks-web' + Token: 'WebHooks-Demo-Web' + CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' + SelfUrl: webhooksclientHttp.properties.url + WebhooksUrl: webhooksHttp.properties.url + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' } - traits: [] - connections: { - webhooks: { - kind: 'Http' - source: webhooksHttp.id - } - identity: { - kind: 'Http' - source: identityHttp.id + ports: { + http: { + containerPort: 80 + provides: webhooksclientHttp.id } } } + connections: { + webhooks: { + source: webhooksHttp.id + } + identity: { + source: identityHttp.id + } + } } +} - resource webhooksclientHttp 'HttpRoute' = { - name: 'webhooksclient-http' - properties: { - port: 5114 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webhooks: { - path: { - value: '/webhooks-web' - } +resource webhooksclientHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooksclient-http' + location: location + properties: { + application: eshop.id + port: 5114 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webhooks: { + path: { + value: '/webhooks-web' } } } } } +} - // Sites ---------------------------------------------- +// Sites ---------------------------------------------- - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webstatus - resource webstatus 'Container' = { - name: 'webstatus' - properties: { - container: { - image: 'eshop/webstatus:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - PATH_BASE: '/webstatus' - HealthChecksUI__HealthChecks__0__Name: 'WebMVC HTTP Check' - HealthChecksUI__HealthChecks__0__Uri: '${webmvcHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__1__Name: 'WebSPA HTTP Check' - HealthChecksUI__HealthChecks__1__Uri: '${webspaHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__2__Name: 'Web Shopping Aggregator GW HTTP Check' - HealthChecksUI__HealthChecks__2__Uri: '${webshoppingaggHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__4__Name: 'Ordering HTTP Check' - HealthChecksUI__HealthChecks__4__Uri: '${orderingHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__5__Name: 'Basket HTTP Check' - HealthChecksUI__HealthChecks__5__Uri: '${basketHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__6__Name: 'Catalog HTTP Check' - HealthChecksUI__HealthChecks__6__Uri: '${catalogHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__7__Name: 'Identity HTTP Check' - HealthChecksUI__HealthChecks__7__Uri: '${identityHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__8__Name: 'Payments HTTP Check' - HealthChecksUI__HealthChecks__8__Uri: '${paymentHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__9__Name: 'Ordering SignalRHub HTTP Check' - HealthChecksUI__HealthChecks__9__Uri: '${orderingsignalrhubHttp.properties.url}/hc' - HealthChecksUI__HealthChecks__10__Name: 'Ordering HTTP Background Check' - HealthChecksUI__HealthChecks__10__Uri: '${orderbgtasksHttp.properties.url}/hc' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - OrchestratorType: OCHESTRATOR_TYPE - } - ports: { - http: { - containerPort: 80 - provides: webstatusHttp.id - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webstatus +resource webstatus 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webstatus' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webstatus:${TAG}' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + PATH_BASE: '/webstatus' + HealthChecksUI__HealthChecks__0__Name: 'WebMVC HTTP Check' + HealthChecksUI__HealthChecks__0__Uri: '${webmvcHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__1__Name: 'WebSPA HTTP Check' + HealthChecksUI__HealthChecks__1__Uri: '${webspaHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__2__Name: 'Web Shopping Aggregator GW HTTP Check' + HealthChecksUI__HealthChecks__2__Uri: '${webshoppingaggHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__4__Name: 'Ordering HTTP Check' + HealthChecksUI__HealthChecks__4__Uri: '${orderingHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__5__Name: 'Basket HTTP Check' + HealthChecksUI__HealthChecks__5__Uri: '${basketHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__6__Name: 'Catalog HTTP Check' + HealthChecksUI__HealthChecks__6__Uri: '${catalogHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__7__Name: 'Identity HTTP Check' + HealthChecksUI__HealthChecks__7__Uri: '${identityHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__8__Name: 'Payments HTTP Check' + HealthChecksUI__HealthChecks__8__Uri: '${paymentHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__9__Name: 'Ordering SignalRHub HTTP Check' + HealthChecksUI__HealthChecks__9__Uri: '${orderingsignalrhubHttp.properties.url}/hc' + HealthChecksUI__HealthChecks__10__Name: 'Ordering HTTP Background Check' + HealthChecksUI__HealthChecks__10__Uri: '${orderbgtasksHttp.properties.url}/hc' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + OrchestratorType: OCHESTRATOR_TYPE + } + ports: { + http: { + containerPort: 80 + provides: webstatusHttp.id } } - traits: [] - connections: {} } + connections: {} } +} - resource webstatusHttp 'HttpRoute' = { - name: 'webstatus-http' - properties: { - port: 8107 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webstatus: { - path: { - value: '/webstatus' - } +resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webstatus-http' + location: location + properties: { + application: eshop.id + port: 8107 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webstatus: { + path: { + value: '/webstatus' } } } } } +} // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webspa - resource webspa 'Container' = { + resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'web-spa' + location: location properties: { - container: { - image: 'eshop/webspa:${TAG}' - env: { - PATH_BASE: '/' - ASPNETCORE_ENVIRONMENT: 'Production' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - UseCustomizationData: 'False' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - OrchestratorType: OCHESTRATOR_TYPE - IsClusterEnv: 'True' - CallBackUrl: '${CLUSTERDNS}/' - DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' - SignalrHubUrl: orderingsignalrhubHttp.properties.url - } - ports: { - http: { - containerPort: 80 - provides: webspaHttp.id - } - } + application: eshop.id + container: { + image: 'eshop/webspa:${TAG}' + env: { + disableDefaultEnvVars: 'True' + PATH_BASE: '/' + ASPNETCORE_ENVIRONMENT: 'Production' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + UseCustomizationData: 'False' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + CallBackUrl: '${CLUSTERDNS}/' + DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlHC: '${identityHttp.properties.url}/hc' + PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' + SignalrHubUrl: orderingsignalrhubHttp.properties.url } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisKeystore.id - } - webshoppingagg: { - kind: 'Http' - source: webshoppingaggHttp.id - } - identity: { - kind: 'Http' - source: identityHttp.id - } - webshoppingapigw: { - kind: 'Http' - source: webshoppingapigwHttp.id - } - orderingsignalrhub: { - kind: 'Http' - source: orderingsignalrhubHttp.id + ports: { + http: { + containerPort: 80 + provides: webspaHttp.id } } } + connections: { + redis: { + source: redisKeystore.id + } + webshoppingagg: { + source: webshoppingaggHttp.id + } + identity: { + source: identityHttp.id + } + webshoppingapigw: { + source: webshoppingapigwHttp.id + } + orderingsignalrhub: { + source: orderingsignalrhubHttp.id + } + } } +} - resource webspaHttp 'HttpRoute' = { - name: 'webspa-http' - properties: { - port: 5104 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webspa: { - path: { - value: '/' - } +resource webspaHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webspa-http' + location: location + properties: { + application: eshop.id + port: 5104 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webspa: { + path: { + value: '/' } } } } } +} - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webmvc - resource webmvc 'Container' = { - name: 'webmvc' - properties: { - container: { - image: 'eshop/webmvc:${TAG}' - env: { - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - PATH_BASE: '/webmvc' - UseCustomizationData: 'False' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - UseLoadTest: 'False' - DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' - OrchestratorType: OCHESTRATOR_TYPE - IsClusterEnv: 'True' - CallBackUrl: '${CLUSTERDNS}${webmvcHttp.properties.gateway.rules.webmvc.path.value}' - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: webshoppingapigwHttp.properties.url - ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' - SignalrHubUrl: orderingsignalrhubHttp.properties.url - } - ports: { - http: { - containerPort: 80 - provides: webmvcHttp.id - } - } +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webmvc +resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webmvc' + location: location + properties: { + application: eshop.id + container: { + image: 'eshop/webmvc:${TAG}' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + PATH_BASE: '/webmvc' + UseCustomizationData: 'False' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + CallBackUrl: '${CLUSTERDNS}${webmvcHttp.properties.gateway.rules.webmvc.path.value}' + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlHC: '${identityHttp.properties.url}/hc' + PurchaseUrl: webshoppingapigwHttp.properties.url + ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' + SignalrHubUrl: orderingsignalrhubHttp.properties.url } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisKeystore.id + ports: { + http: { + containerPort: 80 + provides: webmvcHttp.id } - webshoppingagg: { - kind: 'Http' - source: webshoppingaggHttp.id + } + } + connections: { + redis: { + source: redisKeystore.id + } + webshoppingagg: { + source: webshoppingaggHttp.id + } + identity: { + source: identityHttp.id + } + webshoppingapigw: { + source: webshoppingapigwHttp.id + } + orderingsignalrhub: { + source: orderingsignalrhubHttp.id + } + } + } +} + +resource webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webmvc-http' + location: location + properties: { + application: eshop.id + port: 5100 + gateway: { + source: gateway.id + hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + rules: { + webmvc: { + path: { + value: '/webmvc' + } } - identity: { - kind: 'Http' - source: identityHttp.id + } + } + } +} + +// Logging -------------------------------------------- + +resource seq 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'seq' + location: location + properties: { + application: eshop.id + container: { + image: 'datalust/seq:latest' + env: { + disableDefaultEnvVars: 'True' + ACCEPT_EULA: 'Y' + } + ports: { + web: { + containerPort: 80 + provides: seqHttp.id } - webshoppingapigw: { - kind: 'Http' - source: webshoppingapigwHttp.id + } + } + connections: {} + } +} + +resource seqHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'seq-http' + location: location + properties: { + application: eshop.id + port: 5340 + } +} + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { + name: 'gateway' + location: location + properties: { + application: eshop.id + routes: [ + http: { + protocol: 'HTTP' + port: 80 } - orderingsignalrhub: { - kind: 'Http' - source: orderingsignalrhubHttp.id + ] + } + } + +resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-identitydb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + disableDefaultEnvVars: 'True' + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlIdentityRoute.id } } } } +} - resource webmvcHttp 'HttpRoute' = { - name: 'webmvc-http' - properties: { - port: 5100 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webmvc: { - path: { - value: '/webmvc' - } - } +resource sqlIdentityRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-identitydb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'identitydb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlIdentityRoute.properties.hostname + database: 'IdentityDb' + } +} + +resource sqlCatalogContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-catalogdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + disableDefaultEnvVars: 'True' + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlCatalogRoute.id } } } } +} + +resource sqlCatalogRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-catalogdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} - // Logging -------------------------------------------- +resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'catalogdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlCatalogRoute.properties.hostname + database: 'CatalogDb' + } +} - resource seq 'Container' = { - name: 'seq' - properties: { - container: { - image: 'datalust/seq:latest' - env: { - ACCEPT_EULA: 'Y' - } - ports: { - web: { - containerPort: 80 - provides: seqHttp.id - } +resource sqlOrderingContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-orderingdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + disableDefaultEnvVars: 'True' + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlOrderingRoute.id } } - traits: [] - connections: {} } } +} - resource seqHttp 'HttpRoute' = { - name: 'seq-http' - properties: { - port: 5340 +resource sqlOrderingRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-orderingdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} + +resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'orderingdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlOrderingRoute.properties.hostname + database: 'OrderingDb' + } +} + +resource sqlWebhooksContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'sql-server-webhooksdb' + location: location + properties: { + application: eshop.id + container: { + image: 'mcr.microsoft.com/mssql/server:2019-latest' + env: { + disableDefaultEnvVars: 'True' + ACCEPT_EULA: 'Y' + MSSQL_PID: 'Developer' + MSSQL_SA_PASSWORD: adminPassword + } + ports: { + sql: { + containerPort: 1433 + provides: sqlWebhooksRoute.id + } + } } } +} - // Gateway -------------------------------------------- +resource sqlWebhooksRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-webhooksdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} - resource gateway 'Gateway' existing = { - name: 'gateway' +resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'webhooksdb' + location: location + properties: { + application: eshop.id + environment: environmentId + server: sqlWebhooksRoute.properties.hostname + database: 'WebhooksDb' } +} - // Infrastructure -------------------------------------------- +resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-basket-data' + location: location + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + env: { + disableDefaultEnvVars: 'True' + } + ports: { + redis: { + containerPort: 6379 + provides: redisBasketRoute.id + } + } + } + } +} - resource sqlIdentity 'microsoft.com.SQLDatabase' existing = { - name: 'IdentityDb' +resource redisBasketRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-basket-data' + location: location + properties: { + application: eshop.id + port: 6379 } +} - resource sqlCatalog 'microsoft.com.SQLDatabase' existing = { - name: 'CatalogDb' +resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { + name: 'basket-data' + location: location + properties: { + application: eshop.id + environment: environmentId + host: redisBasketRoute.properties.hostname + port: redisBasketRoute.properties.port + secrets: { + connectionString: '${redisBasketRoute.properties.hostname}:${redisBasketRoute.properties.port},password=},ssl=True,abortConnect=False' + password: '' + } } +} - resource sqlOrdering 'microsoft.com.SQLDatabase' existing = { - name: 'OrderingDb' +resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-keystore-data' + location: location + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + env: { + disableDefaultEnvVars: 'True' + } + ports: { + redis: { + containerPort: 6379 + provides: redisKeystoreRoute.id + } + } + } } +} - resource sqlWebhooks 'microsoft.com.SQLDatabase' existing = { - name: 'WebhooksDb' +resource redisKeystoreRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-keystore-data' + location: location + properties: { + application: eshop.id + port: 6379 } +} - resource redisBasket 'redislabs.com.RedisCache' existing = { - name: 'basket-data' +resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { + name: 'keystore-data' + location: location + properties: { + application: eshop.id + environment: environmentId + host: redisKeystoreRoute.properties.hostname + port: redisKeystoreRoute.properties.port + secrets: { + connectionString: '${redisKeystoreRoute.properties.hostname}:${redisKeystoreRoute.properties.port},password=},ssl=True,abortConnect=False' + password: '' + } + } +} +resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'mongo-container' + location: location + properties: { + application: eshop.id + container: { + image: 'mongo:4.2' + env: { + disableDefaultEnvVars: 'True' + MONGO_INITDB_ROOT_USERNAME: mongoUsername + MONGO_INITDB_ROOT_PASSWORD: mongoPassword + } + ports: { + mongo: { + containerPort: 27017 + provides: mongoRoute.id + } + } + } } +} - resource redisKeystore 'redislabs.com.RedisCache' existing = { - name: 'keystore-data' +resource mongoRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'mongo-route' + location: location + properties: { + application: eshop.id + port: 27017 } +} - resource mongo 'mongo.com.MongoDatabase' existing = { - name: 'mongo' +resource mongo 'Applications.Connector/mongoDatabases@2022-03-15-privatepreview' = { + name: 'mongo' + location: location + properties: { + application: eshop.id + environment: environmentId + secrets: { + connectionString: 'mongodb://${mongoUsername}:${mongoPassword}@${mongoRoute.properties.hostname}:${mongoRoute.properties.port}' + username: mongoUsername + password: mongoPassword + } } } diff --git a/reference-apps/eshop/iac/app.bicep b/reference-apps/eshop/iac/app.bicep index 750d173b..1d320f43 100644 --- a/reference-apps/eshop/iac/app.bicep +++ b/reference-apps/eshop/iac/app.bicep @@ -43,6 +43,7 @@ resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/catalog.api:${TAG}' env: { + disableDefaultEnvVars: 'True' UseCustomizationData: 'False' PATH_BASE: '/catalog-api' ASPNETCORE_ENVIRONMENT: 'Development' @@ -105,6 +106,7 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/identity.api:${TAG}' env: { + disableDefaultEnvVars: 'True' PATH_BASE: '/identity-api' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -130,7 +132,7 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - + connections: { redis: { source: redisKeystore.id @@ -192,6 +194,7 @@ resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/ordering.api:${TAG}' env: { + disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' UseCustomizationData: 'False' @@ -273,6 +276,7 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/basket.api:${TAG}' env: { + disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY @@ -350,6 +354,7 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/webhooks.api:linux-dev' env: { + disableDefaultEnvVars: 'True' PATH_BASE: '/webhooks-api' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -367,7 +372,7 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - + connections: { sql: { source: sqlWebhooksDb.id @@ -411,6 +416,7 @@ resource payment 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/payment.api:linux-dev' env: { + disableDefaultEnvVars: 'True' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY 'Serilog__MinimumLevel__Override__payment-api.IntegrationEvents.EventHandling': 'Verbose' 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' @@ -451,6 +457,7 @@ resource orderbgtasks 'Applications.Core/containers@2022-03-15-privatepreview' = container: { image: 'eshop/ordering.backgroundtasks:linux-dev' env: { + disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' UseCustomizationData: 'False' @@ -502,6 +509,7 @@ resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' container: { image: 'eshop/webshoppingagg:${TAG}' env: { + disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' PATH_BASE: '/webshoppingagg' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -576,7 +584,9 @@ resource webshoppingapigw 'Applications.Core/containers@2022-03-15-privateprevie application: eshop.id container: { image: 'radius.azurecr.io/eshop-envoy:0.1.3' - env: {} + env: { + disableDefaultEnvVars: 'True' + } ports: { http: { containerPort: 80 @@ -630,6 +640,7 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev container: { image: 'eshop/ordering.signalrhub:${TAG}' env: { + disableDefaultEnvVars: 'True' PATH_BASE: '/payment-api' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -690,6 +701,7 @@ resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' container: { image: 'eshop/webhooks.client:linux-dev' env: { + disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Production' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webhooks-web' @@ -748,6 +760,7 @@ resource webstatus 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/webstatus:${TAG}' env: { + disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' HealthChecksUI__HealthChecks__0__Name: 'WebMVC HTTP Check' @@ -813,6 +826,7 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/webspa:${TAG}' env: { + disableDefaultEnvVars: 'True' PATH_BASE: '/' ASPNETCORE_ENVIRONMENT: 'Production' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -883,6 +897,7 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/webmvc:${TAG}' env: { + disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webmvc' @@ -956,6 +971,7 @@ resource seq 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'datalust/seq:latest' env: { + disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' } ports: { @@ -978,8 +994,6 @@ resource seqHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { } } -// Gateway -------------------------------------------- - resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { name: 'gateway' location: location @@ -1002,6 +1016,7 @@ resource rabbitmqContainer 'Applications.Core/containers@2022-03-15-privateprevi container: { image: 'rabbitmq:3.9' env: { + disableDefaultEnvVars: 'True' //RABBITMQ_DEFAULT_USER: username //RABBITMQ_DEFAULT_PASS: password } @@ -1045,6 +1060,7 @@ resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepr container: { image: 'mcr.microsoft.com/mssql/server:2019-latest' env: { + disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' MSSQL_PID: 'Developer' MSSQL_SA_PASSWORD: adminPassword @@ -1087,6 +1103,7 @@ resource sqlCatalogContainer 'Applications.Core/containers@2022-03-15-privatepre container: { image: 'mcr.microsoft.com/mssql/server:2019-latest' env: { + disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' MSSQL_PID: 'Developer' MSSQL_SA_PASSWORD: adminPassword @@ -1129,6 +1146,7 @@ resource sqlOrderingContainer 'Applications.Core/containers@2022-03-15-privatepr container: { image: 'mcr.microsoft.com/mssql/server:2019-latest' env: { + disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' MSSQL_PID: 'Developer' MSSQL_SA_PASSWORD: adminPassword @@ -1171,6 +1189,7 @@ resource sqlWebhooksContainer 'Applications.Core/containers@2022-03-15-privatepr container: { image: 'mcr.microsoft.com/mssql/server:2019-latest' env: { + disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' MSSQL_PID: 'Developer' MSSQL_SA_PASSWORD: adminPassword @@ -1212,6 +1231,9 @@ resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepr application: eshop.id container: { image: 'redis:6.2' + env: { + disableDefaultEnvVars: 'True' + } ports: { redis: { containerPort: 6379 @@ -1253,6 +1275,9 @@ resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-private application: eshop.id container: { image: 'redis:6.2' + env: { + disableDefaultEnvVars: 'True' + } ports: { redis: { containerPort: 6379 @@ -1294,6 +1319,7 @@ resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' container: { image: 'mongo:4.2' env: { + disableDefaultEnvVars: 'True' MONGO_INITDB_ROOT_USERNAME: mongoUsername MONGO_INITDB_ROOT_PASSWORD: mongoPassword } From e58904db656abcbc35711f8bd5e19b1bcd84f913 Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Wed, 27 Jul 2022 15:27:09 -0400 Subject: [PATCH 06/14] refactor gateway routes --- reference-apps/eshop/iac/app.azure.bicep | 288 +++++-------- reference-apps/eshop/iac/app.bicep | 223 ++++------ reference-apps/eshop/iac/infra.azure.bicep | 464 --------------------- reference-apps/eshop/iac/infra.bicep | 372 ----------------- 4 files changed, 195 insertions(+), 1152 deletions(-) delete mode 100644 reference-apps/eshop/iac/infra.azure.bicep delete mode 100644 reference-apps/eshop/iac/infra.bicep diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index 01a26405..ccd9a6cd 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -45,6 +45,60 @@ resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { environment: environmentId } } + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { + name: 'gateway' + location: location + properties: { + application: eshop.id + hostname: { + fullyQualifiedHostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + } + routes: [ + { + path: '/identity-api' + destination: identityHttp.id + } + { + path: '/ordering-api' + destination: orderingHttp.id + } + { + path: '/basket-api' + destination: basketHttp.id + } + { + path: '/webhooks-api' + destination: webhooksHttp.id + } + { + path: '/webshoppingagg' + destination: webshoppingaggHttp.id + } + { + path: '/webshoppingapigw' + destination: webshoppingapigwHttp.id + } + { + path: '/webhooks-web' + destination: webhooksclientHttp.id + } + { + path: '/webstatus' + destination: webstatusHttp.id + } + { + path: '/' + destination: webspaHttp.id + } + { + path: '/webmvc' + destination: webmvcHttp.id + } + ] + } +} + // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/catalog-api resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'catalog-api' @@ -127,13 +181,13 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { XamarinCallback: '' EnableDevspaces: ENABLEDEVSPACES ConnectionString: 'Server=tcp:${sqlIdentityDb.properties.server},1433;Initial Catalog=${sqlIdentityDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' - MvcClient: 'http://${CLUSTERDNS}${webmvcHttp.properties.gateway.rules.webmvc.path.value}' + MvcClient: 'http://${CLUSTERDNS}${webmvcHttp.properties.hostname}' SpaClient: CLUSTERDNS - BasketApiClient: 'http://${CLUSTERDNS}${basketHttp.properties.gateway.rules.basket.path.value}' - OrderingApiClient: 'http://${CLUSTERDNS}${orderingHttp.properties.gateway.rules.ordering.path.value}' - WebShoppingAggClient: 'http://${CLUSTERDNS}${webshoppingaggHttp.properties.gateway.rules.webshoppingagg.path.value}' - WebhooksApiClient: 'http://${CLUSTERDNS}${webhooksHttp.properties.gateway.rules.webhooks.path.value}' - WebhooksWebClient: 'http://${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' + BasketApiClient: 'http://${CLUSTERDNS}${basketHttp.properties.hostname}' + OrderingApiClient: 'http://${CLUSTERDNS}${orderingHttp.properties.hostname}' + WebShoppingAggClient: 'http://${CLUSTERDNS}${webshoppingaggHttp.properties.hostname}' + WebhooksApiClient: 'http://${CLUSTERDNS}${webhooksHttp.properties.hostname}' + WebhooksWebClient: 'http://${CLUSTERDNS}${webhooksclientHttp.properties.hostname}' } ports: { http: { @@ -180,17 +234,7 @@ resource identityHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = properties: { application: eshop.id port: 5105 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - identity: { - path: { - value: '/identity-api' - } - } - } - } + hostname: '/identity-api' } } @@ -220,7 +264,7 @@ resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { ConnectionString: 'Server=tcp:${sqlOrderingDb.properties.server},1433;Initial Catalog=${sqlOrderingDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -253,17 +297,7 @@ resource orderingHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = properties: { application: eshop.id port: 5102 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - ordering: { - path: { - value: '/ordering-api' - } - } - } - } + hostname: '/ordering-api' } } @@ -283,34 +317,34 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { properties: { application: eshop.id container: { - image: 'radius.azurecr.io/eshop-basket:linux-latest' - env: { - disableDefaultEnvVars: 'True' - ASPNETCORE_ENVIRONMENT: 'Development' - ASPNETCORE_URLS: 'http://0.0.0.0:80' - ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY - UseLoadTest: 'False' - PATH_BASE: '/basket-api' - OrchestratorType: OCHESTRATOR_TYPE - PORT: '80' - GRPC_PORT: '81' - AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port},password=${redisBasket.password()},ssl=True,abortConnect=False,sslprotocols=tls12' - EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' - } - ports: { - http: { - containerPort: 80 - provides: basketHttp.id + image: 'radius.azurecr.io/eshop-basket:linux-latest' + env: { + disableDefaultEnvVars: 'True' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + PATH_BASE: '/basket-api' + OrchestratorType: OCHESTRATOR_TYPE + PORT: '80' + GRPC_PORT: '81' + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port},password=${redisBasket.password()},ssl=True,abortConnect=False,sslprotocols=tls12' + EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } - grpc: { - containerPort: 81 - provides: basketGrpc.id + ports: { + http: { + containerPort: 80 + provides: basketHttp.id + } + grpc: { + containerPort: 81 + provides: basketGrpc.id + } } } - } connections: { redis: { source: redisBasket.id @@ -331,17 +365,7 @@ resource basketHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5103 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - basket: { - path: { - value: '/basket-api' - } - } - } - } + hostname: '/basket-api' } } @@ -371,7 +395,7 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { ConnectionString: 'Server=tcp:${sqlWebhooksDb.properties.server},1433;Initial Catalog=${sqlWebhooksDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -400,17 +424,7 @@ resource webhooksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = properties: { application: eshop.id port: 5113 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webhooks: { - path: { - value: '/webhooks-api' - } - } - } - } + hostname: '/webhooks-api' } } @@ -536,7 +550,7 @@ resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' IdentityUrlHC: '${identityHttp.properties.url}/hc' BasketUrlHC: '${basketHttp.properties.url}/hc' PaymentUrlHC: '${paymentHttp.properties.url}/hc' - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -568,17 +582,7 @@ resource webshoppingaggHttp 'Applications.Core/httproutes@2022-03-15-privateprev properties: { application: eshop.id port: 5121 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webshoppingagg: { - path: { - value: '/webshoppingagg' - } - } - } - } + hostname: '/webshoppingagg' } } @@ -614,17 +618,7 @@ resource webshoppingapigwHttp 'Applications.Core/httproutes@2022-03-15-privatepr properties: { application: eshop.id port: 5202 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webshoppingapigw: { - path: { - value: '/webshoppingapigw' - } - } - } - } + hostname: '/webshoppingapigw' } } @@ -657,7 +651,7 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' IdentityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -712,10 +706,10 @@ resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webhooks-web' Token: 'WebHooks-Demo-Web' - CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' + CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.hostname}' SelfUrl: webhooksclientHttp.properties.url WebhooksUrl: webhooksHttp.properties.url - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -741,17 +735,7 @@ resource webhooksclientHttp 'Applications.Core/httproutes@2022-03-15-privateprev properties: { application: eshop.id port: 5114 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webhooks: { - path: { - value: '/webhooks-web' - } - } - } - } + hostname: '/webhooks-web' } } @@ -810,26 +794,16 @@ resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' properties: { application: eshop.id port: 8107 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webstatus: { - path: { - value: '/webstatus' - } - } - } - } + hostname: '/webstatus' } -} - - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webspa - resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'web-spa' - location: location - properties: { - application: eshop.id +} + +// Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webspa +resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'web-spa' + location: location + properties: { + application: eshop.id container: { image: 'eshop/webspa:${TAG}' env: { @@ -843,9 +817,9 @@ resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' IsClusterEnv: 'True' CallBackUrl: '${CLUSTERDNS}/' DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' + PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.hostname}' SignalrHubUrl: orderingsignalrhubHttp.properties.url } ports: { @@ -881,17 +855,7 @@ resource webspaHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5104 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webspa: { - path: { - value: '/' - } - } - } - } + hostname: '/' } } @@ -914,11 +878,11 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' - CallBackUrl: '${CLUSTERDNS}${webmvcHttp.properties.gateway.rules.webmvc.path.value}' - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + CallBackUrl: '${CLUSTERDNS}${webmvcHttp.properties.hostname}' + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' IdentityUrlHC: '${identityHttp.properties.url}/hc' PurchaseUrl: webshoppingapigwHttp.properties.url - ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' + ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.hostname}' SignalrHubUrl: orderingsignalrhubHttp.properties.url } ports: { @@ -954,17 +918,7 @@ resource webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5100 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webmvc: { - path: { - value: '/webmvc' - } - } - } - } + hostname: '/webmvc' } } @@ -1001,20 +955,6 @@ resource seqHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { } } -resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { - name: 'gateway' - location: location - properties: { - application: eshop.id - routes: [ - http: { - protocol: 'HTTP' - port: 80 - } - ] - } - } - resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'sql-server-identitydb' location: location diff --git a/reference-apps/eshop/iac/app.bicep b/reference-apps/eshop/iac/app.bicep index 1d320f43..e15118c1 100644 --- a/reference-apps/eshop/iac/app.bicep +++ b/reference-apps/eshop/iac/app.bicep @@ -34,6 +34,59 @@ resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { } } +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { + name: 'gateway' + location: location + properties: { + application: eshop.id + hostname: { + fullyQualifiedHostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP + } + routes: [ + { + path: '/identity-api' + destination: identityHttp.id + } + { + path: '/ordering-api' + destination: orderingHttp.id + } + { + path: '/basket-api' + destination: basketHttp.id + } + { + path: '/webhooks-api' + destination: webhooksHttp.id + } + { + path: '/webshoppingagg' + destination: webshoppingaggHttp.id + } + { + path: '/webshoppingapigw' + destination: webshoppingapigwHttp.id + } + { + path: '/webhooks-web' + destination: webhooksclientHttp.id + } + { + path: '/webstatus' + destination: webstatusHttp.id + } + { + path: '/' + destination: webspaHttp.id + } + { + path: '/webmvc' + destination: webmvcHttp.id + } + ] + } +} + // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/catalog-api resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'catalog-api' @@ -117,13 +170,13 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { XamarinCallback: '' EnableDevspaces: ENABLEDEVSPACES ConnectionString: 'Server=tcp:${sqlIdentityDb.properties.server},1433;Initial Catalog=${sqlIdentityDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' - MvcClient: '${CLUSTERDNS}${webmvcHttp.properties.gateway.rules.webmvc.path.value}' + MvcClient: '${CLUSTERDNS}${webmvcHttp.properties.hostname}' SpaClient: CLUSTERDNS - BasketApiClient: '${CLUSTERDNS}${basketHttp.properties.gateway.rules.basket.path.value}' - OrderingApiClient: '${CLUSTERDNS}${orderingHttp.properties.gateway.rules.ordering.path.value}' - WebShoppingAggClient: '${CLUSTERDNS}${webshoppingaggHttp.properties.gateway.rules.webshoppingagg.path.value}' - WebhooksApiClient: '${CLUSTERDNS}${webhooksHttp.properties.gateway.rules.webhooks.path.value}' - WebhooksWebClient: '${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' + BasketApiClient: '${CLUSTERDNS}${basketHttp.properties.hostname}' + OrderingApiClient: '${CLUSTERDNS}${orderingHttp.properties.hostname}' + WebShoppingAggClient: '${CLUSTERDNS}${webshoppingaggHttp.properties.hostname}' + WebhooksApiClient: '${CLUSTERDNS}${webhooksHttp.properties.hostname}' + WebhooksWebClient: '${CLUSTERDNS}${webhooksclientHttp.properties.hostname}' } ports: { http: { @@ -171,17 +224,7 @@ resource identityHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = properties: { application: eshop.id port: 5105 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - identity: { - path: { - value: '/identity-api' - } - } - } - } + hostname: '/identity-api' } } @@ -211,7 +254,7 @@ resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { ConnectionString: 'Server=tcp:${sqlOrderingDb.properties.server},1433;Initial Catalog=${sqlOrderingDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' EventBusConnection: tempRabbitmqConnectionString identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -244,17 +287,7 @@ resource orderingHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = properties: { application: eshop.id port: 5102 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - ordering: { - path: { - value: '/ordering-api' - } - } - } - } + hostname: '/ordering-api' } } @@ -289,7 +322,7 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port}' EventBusConnection: tempRabbitmqConnectionString identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -322,17 +355,7 @@ resource basketHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5103 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - basket: { - path: { - value: '/basket-api' - } - } - } - } + hostname: '/basket-api' } } @@ -363,7 +386,7 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { ConnectionString: 'Server=tcp:${sqlWebhooksDb.properties.server},1433;Initial Catalog=${sqlWebhooksDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' EventBusConnection: tempRabbitmqConnectionString identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -393,17 +416,7 @@ resource webhooksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = properties: { application: eshop.id port: 5113 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webhooks: { - path: { - value: '/webhooks-api' - } - } - } - } + hostname: '/webhooks-api' } } @@ -527,7 +540,7 @@ resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' IdentityUrlHC: '${identityHttp.properties.url}/hc' BasketUrlHC: '${basketHttp.properties.url}/hc' PaymentUrlHC: '${paymentHttp.properties.url}/hc' - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -562,17 +575,7 @@ resource webshoppingaggHttp 'Applications.Core/httproutes@2022-03-15-privateprev properties: { application: eshop.id port: 5121 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webshoppingagg: { - path: { - value: '/webshoppingagg' - } - } - } - } + hostname: '/webshoppingagg' } } @@ -608,17 +611,7 @@ resource webshoppingapigwHttp 'Applications.Core/httproutes@2022-03-15-privatepr properties: { application: eshop.id port: 5202 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webshoppingapigw: { - path: { - value: '/webshoppingapigw' - } - } - } - } + hostname: '/webshoppingapigw' } } @@ -649,9 +642,9 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev IsClusterEnv: 'True' AzureServiceBusEnabled: AZURESERVICEBUSENABLED EventBusConnection: tempRabbitmqConnectionString - SignalrStoreConnectionString: '${redisKeystore.properties.host}' + SignalrStoreConnectionString: redisKeystore.properties.host identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -706,10 +699,10 @@ resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webhooks-web' Token: 'WebHooks-Demo-Web' - CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.gateway.rules.webhooks.path.value}' + CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.hostname}' SelfUrl: webhooksclientHttp.properties.url WebhooksUrl: webhooksHttp.properties.url - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' } ports: { http: { @@ -735,17 +728,7 @@ resource webhooksclientHttp 'Applications.Core/httproutes@2022-03-15-privateprev properties: { application: eshop.id port: 5114 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webhooks: { - path: { - value: '/webhooks-web' - } - } - } - } + hostname: '/webhooks-web' } } @@ -803,17 +786,7 @@ resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' properties: { application: eshop.id port: 8107 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webstatus: { - path: { - value: '/webstatus' - } - } - } - } + hostname: '/webstatus' } } @@ -835,10 +808,10 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' CallBackUrl: '${CLUSTERDNS}/' - DPConnectionString: '${redisKeystore.properties.host}' - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.gateway.rules.identity.path.value}' + DPConnectionString: redisKeystore.properties.host + IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' + PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.hostname}' SignalrHubUrl: orderingsignalrhubHttp.properties.url } ports: { @@ -874,17 +847,7 @@ resource webspaHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5104 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webspa: { - path: { - value: '/' - } - } - } - } + hostname: '/' } } @@ -907,7 +870,7 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { UseLoadTest: 'False' OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' - ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.gateway.rules.webshoppingapigw.path.value}' + ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.hostname}' CallBackUrl: 'http://${CLUSTER_IP}.nip.io/webmvc' IdentityUrl: 'http://${CLUSTER_IP}.nip.io/identity-api' IdentityUrlHC: '${identityHttp.properties.url}/hc' @@ -947,17 +910,7 @@ resource webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5100 - gateway: { - source: gateway.id - hostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - rules: { - webmvc: { - path: { - value: '/webmvc' - } - } - } - } + hostname: '/webmvc' } } @@ -994,20 +947,6 @@ resource seqHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { } } -resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { - name: 'gateway' - location: location - properties: { - application: eshop.id - routes: [ - http: { - protocol: 'HTTP' - port: 80 - } - ] - } -} - resource rabbitmqContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'rabbitmq-container-eshop-event-bus' location: location diff --git a/reference-apps/eshop/iac/infra.azure.bicep b/reference-apps/eshop/iac/infra.azure.bicep deleted file mode 100644 index 8c12d332..00000000 --- a/reference-apps/eshop/iac/infra.azure.bicep +++ /dev/null @@ -1,464 +0,0 @@ -import radius as radius - -// Parameters -------------------------------------------- -param environmentId string - -param location string = resourceGroup().location - -param adminLogin string = 'sqladmin' - -@secure() -param adminPassword string - -param mongoUsername string = 'admin' - -param mongoPassword string = newGuid() - -resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'eshop' - location: location - properties: { - environment: environmentId - } -} -// Gateway -------------------------------------------- - -resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { - name: 'gateway' - location: location - properties: { - application: eshop.id - routes: [ - http: { - protocol: 'HTTP' - port: 80 - } - ] - } - } - -// Infrastructure - -resource servicebus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' = { - name: 'eshop${uniqueString(resourceGroup().id)}' - location: resourceGroup().location - sku: { - name: 'Standard' - tier: 'Standard' - } - - resource topic 'topics' = { - name: 'eshop_event_bus' - properties: { - defaultMessageTimeToLive: 'P14D' - maxSizeInMegabytes: 1024 - requiresDuplicateDetection: false - enableBatchedOperations: true - supportOrdering: false - enablePartitioning: true - enableExpress: false - } - - resource rootRule 'authorizationRules' = { - name: 'Root' - properties: { - rights: [ - 'Manage' - 'Send' - 'Listen' - ] - } - } - - resource basket 'subscriptions' = { - name: 'Basket' - properties: { - requiresSession: false - defaultMessageTimeToLive: 'P14D' - deadLetteringOnMessageExpiration: true - deadLetteringOnFilterEvaluationExceptions: true - maxDeliveryCount: 10 - enableBatchedOperations: true - } - } - - resource catalog 'subscriptions' = { - name: 'Catalog' - properties: { - requiresSession: false - defaultMessageTimeToLive: 'P14D' - deadLetteringOnMessageExpiration: true - deadLetteringOnFilterEvaluationExceptions: true - maxDeliveryCount: 10 - enableBatchedOperations: true - } - } - - resource ordering 'subscriptions' = { - name: 'Ordering' - properties: { - requiresSession: false - defaultMessageTimeToLive: 'P14D' - deadLetteringOnMessageExpiration: true - deadLetteringOnFilterEvaluationExceptions: true - maxDeliveryCount: 10 - enableBatchedOperations: true - } - } - - resource graceperiod 'subscriptions' = { - name: 'GracePeriod' - properties: { - requiresSession: false - defaultMessageTimeToLive: 'P14D' - deadLetteringOnMessageExpiration: true - deadLetteringOnFilterEvaluationExceptions: true - maxDeliveryCount: 10 - enableBatchedOperations: true - } - } - - resource payment 'subscriptions' = { - name: 'Payment' - properties: { - requiresSession: false - defaultMessageTimeToLive: 'P14D' - deadLetteringOnMessageExpiration: true - deadLetteringOnFilterEvaluationExceptions: true - maxDeliveryCount: 10 - enableBatchedOperations: true - } - } - - resource backgroundTasks 'subscriptions' = { - name: 'backgroundtasks' - properties: { - requiresSession: false - defaultMessageTimeToLive: 'P14D' - deadLetteringOnMessageExpiration: true - deadLetteringOnFilterEvaluationExceptions: true - maxDeliveryCount: 10 - enableBatchedOperations: true - } - } - - resource OrderingSignalrHub 'subscriptions' = { - name: 'Ordering.signalrhub' - properties: { - requiresSession: false - defaultMessageTimeToLive: 'P14D' - deadLetteringOnMessageExpiration: true - deadLetteringOnFilterEvaluationExceptions: true - maxDeliveryCount: 10 - enableBatchedOperations: true - } - } - - resource webhooks 'subscriptions' = { - name: 'Webhooks' - properties: { - requiresSession: false - defaultMessageTimeToLive: 'P14D' - deadLetteringOnMessageExpiration: true - deadLetteringOnFilterEvaluationExceptions: true - maxDeliveryCount: 10 - enableBatchedOperations: true - } - } - - } - -} - -resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-identitydb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlIdentityRoute.id - } - } - } - } -} - -resource sqlIdentityRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-identitydb' - location: location - properties: { - application: eshop.id - port: 1433 - } -} - -resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'identitydb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlIdentityRoute.properties.hostname - database: 'IdentityDb' - } -} - -resource sqlCatalogContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-catalogdb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlCatalogRoute.id - } - } - } - } -} - -resource sqlCatalogRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-catalogdb' - location: location - properties: { - application: eshop.id - port: 1433 - } -} - -resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'catalogdb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlCatalogRoute.properties.hostname - database: 'CatalogDb' - } -} - -resource sqlOrderingContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-orderingdb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlOrderingRoute.id - } - } - } - } -} - -resource sqlOrderingRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-orderingdb' - location: location - properties: { - application: eshop.id - port: 1433 - } -} - -resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'orderingdb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlOrderingRoute.properties.hostname - database: 'OrderingDb' - } -} - -resource sqlWebhooksContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-webhooksdb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlWebhooksRoute.id - } - } - } - } -} - -resource sqlWebhooksRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-webhooksdb' - location: location - properties: { - application: eshop.id - port: 1433 - } -} - -resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'webhooksdb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlWebhooksRoute.properties.hostname - database: 'WebhooksDb' - } -} - -resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'redis-container-basket-data' - location: location - properties: { - application: eshop.id - container: { - image: 'redis:6.2' - ports: { - redis: { - containerPort: 6379 - provides: redisBasketRoute.id - } - } - } - } -} - -resource redisBasketRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'redis-route-basket-data' - location: location - properties: { - application: eshop.id - port: 6379 - } -} - -resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { - name: 'basket-data' - location: location - properties: { - application: eshop.id - environment: environmentId - host: redisBasketRoute.properties.hostname - port: redisBasketRoute.properties.port - secrets: { - connectionString: '${redisBasketRoute.properties.hostname}:${redisBasketRoute.properties.port},password=},ssl=True,abortConnect=False' - password: '' - } - } -} - -resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'redis-container-keystore-data' - location: location - properties: { - application: eshop.id - container: { - image: 'redis:6.2' - ports: { - redis: { - containerPort: 6379 - provides: redisKeystoreRoute.id - } - } - } - } -} - -resource redisKeystoreRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'redis-route-keystore-data' - location: location - properties: { - application: eshop.id - port: 6379 - } -} - -resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { - name: 'keystore-data' - location: location - properties: { - application: eshop.id - environment: environmentId - host: redisKeystoreRoute.properties.hostname - port: redisKeystoreRoute.properties.port - secrets: { - connectionString: '${redisKeystoreRoute.properties.hostname}:${redisKeystoreRoute.properties.port},password=},ssl=True,abortConnect=False' - password: '' - } - } -} -resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'mongo-container' - location: location - properties: { - application: eshop.id - container: { - image: 'mongo:4.2' - env: { - MONGO_INITDB_ROOT_USERNAME: mongoUsername - MONGO_INITDB_ROOT_PASSWORD: mongoPassword - } - ports: { - mongo: { - containerPort: 27017 - provides: mongoRoute.id - } - } - } - } -} - -resource mongoRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'mongo-route' - location: location - properties: { - application: eshop.id - port: 27017 - } -} - -resource mongo 'Applications.Connector/mongoDatabases@2022-03-15-privatepreview' = { - name: 'mongo' - location: location - properties: { - application: eshop.id - environment: environmentId - secrets: { - connectionString: 'mongodb://${mongoUsername}:${mongoPassword}@${mongoRoute.properties.hostname}:${mongoRoute.properties.port}' - username: mongoUsername - password: mongoPassword - } - } -} \ No newline at end of file diff --git a/reference-apps/eshop/iac/infra.bicep b/reference-apps/eshop/iac/infra.bicep deleted file mode 100644 index 0d1e98bb..00000000 --- a/reference-apps/eshop/iac/infra.bicep +++ /dev/null @@ -1,372 +0,0 @@ -import radius as radius - -// Parameters -------------------------------------------- -param environmentId string - -param location string = resourceGroup().location - -@secure() -param adminPassword string - -param mongoUsername string = 'admin' - -param mongoPassword string = newGuid() - -resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'eshop' - location: location - properties: { - environment: environmentId - } -} -// Gateway -------------------------------------------- - -resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { - name: 'gateway' - location: location - properties: { - application: eshop.id - routes: [ - http: { - protocol: 'HTTP' - port: 80 - } - ] - } - } - -resource rabbitmqContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'rabbitmq-container-eshop-event-bus' - location: location - properties: { - application: eshop.id - container: { - image: 'rabbitmq:3.9' - env: { - //RABBITMQ_DEFAULT_USER: username - //RABBITMQ_DEFAULT_PASS: password - } - ports: { - rabbitmq: { - containerPort: 5672 - provides: rabbitmqRoute.id - } - } - } - } -} - -resource rabbitmqRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'rabbitmq-route-eshop-event-bus' - location: location - properties: { - application: eshop.id - port: 5672 - } -} - -resource rabbitmq 'Applications.Connector/rabbitmqMessageQueues@2022-03-15-privatepreview' = { - name: 'eshop-event-bus' - location: location - properties: { - application: eshop.id - environment: environmentId - queue: 'eshop-event-bus' - secrets: { - connectionString: 'amqp://${rabbitmqRoute.properties.hostname}:${rabbitmqRoute.properties.port}' - } - } -} - -resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-identitydb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlIdentityRoute.id - } - } - } - } -} - -resource sqlIdentityRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-identitydb' - location: location - properties: { - application: eshop.id - port: 1433 - } -} - -resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'identitydb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlIdentityRoute.properties.hostname - database: 'IdentityDb' - } -} - -resource sqlCatalogContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-catalogdb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlCatalogRoute.id - } - } - } - } -} - -resource sqlCatalogRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-catalogdb' - location: location - properties: { - application: eshop.id - port: 1433 - } -} - -resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'catalogdb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlCatalogRoute.properties.hostname - database: 'CatalogDb' - } -} - -resource sqlOrderingContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-orderingdb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlOrderingRoute.id - } - } - } - } -} - -resource sqlOrderingRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-orderingdb' - location: location - properties: { - application: eshop.id - port: 1433 - } -} - -resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'orderingdb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlOrderingRoute.properties.hostname - database: 'OrderingDb' - } -} - -resource sqlWebhooksContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-webhooksdb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlWebhooksRoute.id - } - } - } - } -} - -resource sqlWebhooksRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-webhooksdb' - location: location - properties: { - application: eshop.id - port: 1433 - } -} - -resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'webhooksdb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlWebhooksRoute.properties.hostname - database: 'WebhooksDb' - } -} - -resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'redis-container-basket-data' - location: location - properties: { - application: eshop.id - container: { - image: 'redis:6.2' - ports: { - redis: { - containerPort: 6379 - provides: redisBasketRoute.id - } - } - } - } -} - -resource redisBasketRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'redis-route-basket-data' - location: location - properties: { - application: eshop.id - port: 6379 - } -} - -resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { - name: 'basket-data' - location: location - properties: { - application: eshop.id - environment: environmentId - host: redisBasketRoute.properties.hostname - port: redisBasketRoute.properties.port - secrets: { - connectionString: '${redisBasketRoute.properties.hostname}:${redisBasketRoute.properties.port},password=},ssl=True,abortConnect=False' - password: '' - } - } -} - -resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'redis-container-keystore-data' - location: location - properties: { - application: eshop.id - container: { - image: 'redis:6.2' - ports: { - redis: { - containerPort: 6379 - provides: redisKeystoreRoute.id - } - } - } - } -} - -resource redisKeystoreRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'redis-route-keystore-data' - location: location - properties: { - application: eshop.id - port: 6379 - } -} - -resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { - name: 'keystore-data' - location: location - properties: { - application: eshop.id - environment: environmentId - host: redisKeystoreRoute.properties.hostname - port: redisKeystoreRoute.properties.port - secrets: { - connectionString: '${redisKeystoreRoute.properties.hostname}:${redisKeystoreRoute.properties.port},password=},ssl=True,abortConnect=False' - password: '' - } - } -} -resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'mongo-container' - location: location - properties: { - application: eshop.id - container: { - image: 'mongo:4.2' - env: { - MONGO_INITDB_ROOT_USERNAME: mongoUsername - MONGO_INITDB_ROOT_PASSWORD: mongoPassword - } - ports: { - mongo: { - containerPort: 27017 - provides: mongoRoute.id - } - } - } - } -} - -resource mongoRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'mongo-route' - location: location - properties: { - application: eshop.id - port: 27017 - } -} - -resource mongo 'Applications.Connector/mongoDatabases@2022-03-15-privatepreview' = { - name: 'mongo' - location: location - properties: { - application: eshop.id - environment: environmentId - secrets: { - connectionString: 'mongodb://${mongoUsername}:${mongoPassword}@${mongoRoute.properties.hostname}:${mongoRoute.properties.port}' - username: mongoUsername - password: mongoPassword - } - } -} \ No newline at end of file From 628c18d474ac719f9e5d9b3017fa71282073699c Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Wed, 27 Jul 2022 17:26:45 -0700 Subject: [PATCH 07/14] First set of fixes --- reference-apps/eshop/iac/app.bicep | 103 +++++++++++++---------------- reference-apps/eshop/rad.yaml | 17 ----- 2 files changed, 45 insertions(+), 75 deletions(-) delete mode 100644 reference-apps/eshop/rad.yaml diff --git a/reference-apps/eshop/iac/app.bicep b/reference-apps/eshop/iac/app.bicep index e15118c1..c0eea624 100644 --- a/reference-apps/eshop/iac/app.bicep +++ b/reference-apps/eshop/iac/app.bicep @@ -1,15 +1,12 @@ import radius as radius // Parameters -------------------------------------------- -param environmentId string +param environment string param location string = resourceGroup().location param mongoUsername string = 'admin' - param mongoPassword string = newGuid() -param ESHOP_EXTERNAL_DNS_NAME_OR_IP string = '*' -param CLUSTER_IP string param OCHESTRATOR_TYPE string = 'K8S' param APPLICATION_INSIGHTS_KEY string = '' param AZURESTORAGEENABLED string = 'False' @@ -17,10 +14,7 @@ param AZURESERVICEBUSENABLED string = 'False' param ENABLEDEVSPACES string = 'False' param TAG string = 'linux-dev' -var CLUSTERDNS = 'http://${CLUSTER_IP}.nip.io' -var PICBASEURL = '${CLUSTERDNS}/webshoppingapigw/c/api/v1/catalog/items/[0]/pic' - -var tempRabbitmqConnectionString = 'eshop-starter-rabbitmq-route-${uniqueString('eshop_event_bus')}' +var PICBASEURL = '${gateway.properties.url}/webshoppingapigw/c/api/v1/catalog/items/[0]/pic' param adminLogin string = 'SA' @secure() @@ -30,7 +24,7 @@ resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { name: 'eshop' location: location properties: { - environment: environmentId + environment: environment } } @@ -39,9 +33,6 @@ resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { location: location properties: { application: eshop.id - hostname: { - fullyQualifiedHostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - } routes: [ { path: '/identity-api' @@ -108,7 +99,7 @@ resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY AzureServiceBusEnabled: AZURESERVICEBUSENABLED ConnectionString: 'Server=tcp:${sqlCatalogDb.properties.server},1433;Initial Catalog=${sqlCatalogDb.properties.database};User Id=${adminLogin};Password=${adminPassword};' - EventBusConnection: tempRabbitmqConnectionString + EventBusConnection: rabbitmq.connectionString() } ports: { http: { @@ -170,13 +161,13 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { XamarinCallback: '' EnableDevspaces: ENABLEDEVSPACES ConnectionString: 'Server=tcp:${sqlIdentityDb.properties.server},1433;Initial Catalog=${sqlIdentityDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' - MvcClient: '${CLUSTERDNS}${webmvcHttp.properties.hostname}' - SpaClient: CLUSTERDNS - BasketApiClient: '${CLUSTERDNS}${basketHttp.properties.hostname}' - OrderingApiClient: '${CLUSTERDNS}${orderingHttp.properties.hostname}' - WebShoppingAggClient: '${CLUSTERDNS}${webshoppingaggHttp.properties.hostname}' - WebhooksApiClient: '${CLUSTERDNS}${webhooksHttp.properties.hostname}' - WebhooksWebClient: '${CLUSTERDNS}${webhooksclientHttp.properties.hostname}' + MvcClient: '${gateway.properties.url}/${webmvcHttp.properties.hostname}' + SpaClient: gateway.properties.url + BasketApiClient: '${gateway.properties.url}/${basketHttp.properties.hostname}' + OrderingApiClient: '${gateway.properties.url}/${orderingHttp.properties.hostname}' + WebShoppingAggClient: '${gateway.properties.url}/${webshoppingaggHttp.properties.hostname}' + WebhooksApiClient: '${gateway.properties.url}/${webhooksHttp.properties.hostname}' + WebhooksWebClient: '${gateway.properties.url}/${webhooksclientHttp.properties.hostname}' } ports: { http: { @@ -185,7 +176,6 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { } } } - connections: { redis: { source: redisKeystore.id @@ -224,7 +214,6 @@ resource identityHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = properties: { application: eshop.id port: 5105 - hostname: '/identity-api' } } @@ -252,9 +241,9 @@ resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { GRPC_PORT: '81' PORT: '80' ConnectionString: 'Server=tcp:${sqlOrderingDb.properties.server},1433;Initial Catalog=${sqlOrderingDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' - EventBusConnection: tempRabbitmqConnectionString + EventBusConnection: rabbitmq.connectionString() identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -287,7 +276,6 @@ resource orderingHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = properties: { application: eshop.id port: 5102 - hostname: '/ordering-api' } } @@ -320,9 +308,9 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { GRPC_PORT: '81' AzureServiceBusEnabled: AZURESERVICEBUSENABLED ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port}' - EventBusConnection: tempRabbitmqConnectionString + EventBusConnection: rabbitmq.connectionString() identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -355,7 +343,6 @@ resource basketHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5103 - hostname: '/basket-api' } } @@ -384,9 +371,9 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { OrchestratorType: OCHESTRATOR_TYPE AzureServiceBusEnabled: AZURESERVICEBUSENABLED ConnectionString: 'Server=tcp:${sqlWebhooksDb.properties.server},1433;Initial Catalog=${sqlWebhooksDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' - EventBusConnection: tempRabbitmqConnectionString + EventBusConnection: rabbitmq.connectionString() identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -416,7 +403,6 @@ resource webhooksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = properties: { application: eshop.id port: 5113 - hostname: '/webhooks-api' } } @@ -435,7 +421,7 @@ resource payment 'Applications.Core/containers@2022-03-15-privatepreview' = { 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' OrchestratorType: OCHESTRATOR_TYPE AzureServiceBusEnabled: AZURESERVICEBUSENABLED - EventBusConnection: tempRabbitmqConnectionString + EventBusConnection: rabbitmq.connectionString() } ports: { http: { @@ -482,7 +468,7 @@ resource orderbgtasks 'Applications.Core/containers@2022-03-15-privatepreview' = OrchestratorType: OCHESTRATOR_TYPE AzureServiceBusEnabled: AZURESERVICEBUSENABLED ConnectionString: 'Server=tcp:${sqlOrderingDb.properties.server},1433;Initial Catalog=${sqlOrderingDb.properties.database};User Id=${adminLogin};Password=${adminPassword}' - EventBusConnection: tempRabbitmqConnectionString + EventBusConnection: rabbitmq.connectionString() } ports: { http: { @@ -540,7 +526,7 @@ resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' IdentityUrlHC: '${identityHttp.properties.url}/hc' BasketUrlHC: '${basketHttp.properties.url}/hc' PaymentUrlHC: '${paymentHttp.properties.url}/hc' - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -575,7 +561,7 @@ resource webshoppingaggHttp 'Applications.Core/httproutes@2022-03-15-privateprev properties: { application: eshop.id port: 5121 - hostname: '/webshoppingagg' + //hostname: '/webshoppingagg' } } @@ -611,7 +597,7 @@ resource webshoppingapigwHttp 'Applications.Core/httproutes@2022-03-15-privatepr properties: { application: eshop.id port: 5202 - hostname: '/webshoppingapigw' + //hostname: '/webshoppingapigw' } } @@ -641,10 +627,10 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' AzureServiceBusEnabled: AZURESERVICEBUSENABLED - EventBusConnection: tempRabbitmqConnectionString + EventBusConnection: rabbitmq.connectionString() SignalrStoreConnectionString: redisKeystore.properties.host identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -699,10 +685,10 @@ resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webhooks-web' Token: 'WebHooks-Demo-Web' - CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.hostname}' + CallBackUrl: '${gateway.properties.url}/${webhooksclientHttp.properties.hostname}' SelfUrl: webhooksclientHttp.properties.url WebhooksUrl: webhooksHttp.properties.url - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrl: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -786,7 +772,7 @@ resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' properties: { application: eshop.id port: 8107 - hostname: '/webstatus' + //hostname: '/webstatus' } } @@ -807,11 +793,11 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' - CallBackUrl: '${CLUSTERDNS}/' + CallBackUrl: '${gateway.properties.url}/' DPConnectionString: redisKeystore.properties.host - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrl: '${gateway.properties.url}/${identityHttp.properties.hostname}' IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.hostname}' + PurchaseUrl: '${gateway.properties.url}/${webshoppingapigwHttp.properties.hostname}' SignalrHubUrl: orderingsignalrhubHttp.properties.url } ports: { @@ -847,7 +833,7 @@ resource webspaHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5104 - hostname: '/' + //hostname: '/' } } @@ -870,9 +856,9 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { UseLoadTest: 'False' OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' - ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.hostname}' - CallBackUrl: 'http://${CLUSTER_IP}.nip.io/webmvc' - IdentityUrl: 'http://${CLUSTER_IP}.nip.io/identity-api' + ExternalPurchaseUrl: '${gateway.properties.url}/${webshoppingapigwHttp.properties.hostname}' + CallBackUrl: '${gateway.properties.url}/webmvc' + IdentityUrl: '${gateway.properties.url}/identity-api' IdentityUrlHC: '${identityHttp.properties.url}/hc' PurchaseUrl: webshoppingapigwHttp.properties.url SignalrHubUrl: orderingsignalrhubHttp.properties.url @@ -910,7 +896,7 @@ resource webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5100 - hostname: '/webmvc' + //hostname: '/webmvc' } } @@ -983,10 +969,10 @@ resource rabbitmq 'Applications.Connector/rabbitmqMessageQueues@2022-03-15-priva location: location properties: { application: eshop.id - environment: environmentId + environment: environment queue: 'eshop-event-bus' secrets: { - connectionString: 'amqp://${rabbitmqRoute.properties.hostname}:${rabbitmqRoute.properties.port}' + connectionString: rabbitmqRoute.properties.hostname } } } @@ -1028,7 +1014,7 @@ resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepr location: location properties: { application: eshop.id - environment: environmentId + environment: environment server: sqlIdentityRoute.properties.hostname database: 'IdentityDb' } @@ -1071,7 +1057,7 @@ resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepre location: location properties: { application: eshop.id - environment: environmentId + environment: environment server: sqlCatalogRoute.properties.hostname database: 'CatalogDb' } @@ -1114,7 +1100,7 @@ resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepr location: location properties: { application: eshop.id - environment: environmentId + environment: environment server: sqlOrderingRoute.properties.hostname database: 'OrderingDb' } @@ -1157,7 +1143,7 @@ resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepr location: location properties: { application: eshop.id - environment: environmentId + environment: environment server: sqlWebhooksRoute.properties.hostname database: 'WebhooksDb' } @@ -1197,7 +1183,7 @@ resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privateprevi location: location properties: { application: eshop.id - environment: environmentId + environment: environment host: redisBasketRoute.properties.hostname port: redisBasketRoute.properties.port secrets: { @@ -1241,7 +1227,7 @@ resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepre location: location properties: { application: eshop.id - environment: environmentId + environment: environment host: redisKeystoreRoute.properties.hostname port: redisKeystoreRoute.properties.port secrets: { @@ -1250,6 +1236,7 @@ resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepre } } } + resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'mongo-container' location: location @@ -1286,7 +1273,7 @@ resource mongo 'Applications.Connector/mongoDatabases@2022-03-15-privatepreview' location: location properties: { application: eshop.id - environment: environmentId + environment: environment secrets: { connectionString: 'mongodb://${mongoUsername}:${mongoPassword}@${mongoRoute.properties.hostname}:${mongoRoute.properties.port}' username: mongoUsername diff --git a/reference-apps/eshop/rad.yaml b/reference-apps/eshop/rad.yaml deleted file mode 100644 index e0dd3c1c..00000000 --- a/reference-apps/eshop/rad.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: eshop -stages: -- name: infra - bicep: - template: iac/infra.bicep - profiles: - azure: - bicep: - template: iac/infra.azure.bicep -- name: app - bicep: - template: iac/app.bicep - profiles: - azure: - bicep: - template: iac/app.azure.bicep - From ff301cb96a0f25c2261f0067af92062b125e0228 Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Thu, 28 Jul 2022 13:42:08 -0700 Subject: [PATCH 08/14] Update templates --- reference-apps/eshop/iac/app.azure.bicep | 636 +++++++++++------------ reference-apps/eshop/iac/app.bicep | 46 +- 2 files changed, 307 insertions(+), 375 deletions(-) diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index ccd9a6cd..5157fc81 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -1,16 +1,11 @@ import radius as radius // Parameters -------------------------------------------- -param environmentId string +param environment string -param location string = resourceGroup().location +param ucpLocation string = 'global' +param azureLocation string = resourceGroup().location -param mongoUsername string = 'admin' - -param mongoPassword string = newGuid() - -param ESHOP_EXTERNAL_DNS_NAME_OR_IP string = '*' -param CLUSTER_IP string param OCHESTRATOR_TYPE string = 'K8S' param APPLICATION_INSIGHTS_KEY string = '' param AZURESTORAGEENABLED string = 'False' @@ -18,42 +13,25 @@ param AZURESERVICEBUSENABLED string = 'True' param ENABLEDEVSPACES string = 'False' param TAG string = 'linux-dev' -var CLUSTERDNS = 'http://${CLUSTER_IP}.nip.io' -var PICBASEURL = '${CLUSTERDNS}/webshoppingapigw/c/api/v1/catalog/items/[0]/pic' +var PICBASEURL = '${gateway.properties.url}/webshoppingapigw/c/api/v1/catalog/items/[0]/pic' param adminLogin string = 'sqladmin' @secure() -param adminPassword string - -resource servicebus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' existing = { - name: 'eshop${uniqueString(resourceGroup().id)}' - - resource topic 'topics' existing = { - name: 'eshop_event_bus' - - resource rootRule 'authorizationRules' existing = { - name: 'Root' - } - } - -} +param adminPassword string = newGuid() resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { name: 'eshop' - location: location + location: ucpLocation properties: { - environment: environmentId + environment: environment } } resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { name: 'gateway' - location: location + location: ucpLocation properties: { application: eshop.id - hostname: { - fullyQualifiedHostname: ESHOP_EXTERNAL_DNS_NAME_OR_IP - } routes: [ { path: '/identity-api' @@ -102,13 +80,12 @@ resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/catalog-api resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'catalog-api' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/catalog.api:${TAG}' env: { - disableDefaultEnvVars: 'True' UseCustomizationData: 'False' PATH_BASE: '/catalog-api' ASPNETCORE_ENVIRONMENT: 'Development' @@ -145,7 +122,7 @@ resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { resource catalogHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'catalog-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5101 @@ -154,7 +131,7 @@ resource catalogHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = resource catalogGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'catalog-grpc' - location: location + location: ucpLocation properties: { application: eshop.id port: 9101 @@ -164,13 +141,12 @@ resource catalogGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/identity-api resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'identity-api' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/identity.api:${TAG}' env: { - disableDefaultEnvVars: 'True' PATH_BASE: '/identity-api' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -181,13 +157,13 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { XamarinCallback: '' EnableDevspaces: ENABLEDEVSPACES ConnectionString: 'Server=tcp:${sqlIdentityDb.properties.server},1433;Initial Catalog=${sqlIdentityDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' - MvcClient: 'http://${CLUSTERDNS}${webmvcHttp.properties.hostname}' - SpaClient: CLUSTERDNS - BasketApiClient: 'http://${CLUSTERDNS}${basketHttp.properties.hostname}' - OrderingApiClient: 'http://${CLUSTERDNS}${orderingHttp.properties.hostname}' - WebShoppingAggClient: 'http://${CLUSTERDNS}${webshoppingaggHttp.properties.hostname}' - WebhooksApiClient: 'http://${CLUSTERDNS}${webhooksHttp.properties.hostname}' - WebhooksWebClient: 'http://${CLUSTERDNS}${webhooksclientHttp.properties.hostname}' + MvcClient: '${gateway.properties.url}/${webmvcHttp.properties.hostname}' + SpaClient: gateway.properties.url + BasketApiClient: '${gateway.properties.url}/${basketHttp.properties.hostname}' + OrderingApiClient: '${gateway.properties.url}/${orderingHttp.properties.hostname}' + WebShoppingAggClient: '${gateway.properties.url}/${webshoppingaggHttp.properties.hostname}' + WebhooksApiClient: '${gateway.properties.url}/${webhooksHttp.properties.hostname}' + WebhooksWebClient: '${gateway.properties.url}/${webhooksclientHttp.properties.hostname}' } ports: { http: { @@ -230,24 +206,22 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { resource identityHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'identity-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5105 - hostname: '/identity-api' } } // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-api resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'ordering-api' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/ordering.api:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' UseCustomizationData: 'False' @@ -264,7 +238,7 @@ resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { ConnectionString: 'Server=tcp:${sqlOrderingDb.properties.server},1433;Initial Catalog=${sqlOrderingDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -293,17 +267,16 @@ resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { resource orderingHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'ordering-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5102 - hostname: '/ordering-api' } } resource orderingGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'ordering-grpc' - location: location + location: ucpLocation properties: { application: eshop.id port: 9102 @@ -313,13 +286,12 @@ resource orderingGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/basket-api resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'basket-api' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'radius.azurecr.io/eshop-basket:linux-latest' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY @@ -332,7 +304,7 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port},password=${redisBasket.password()},ssl=True,abortConnect=False,sslprotocols=tls12' EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -361,17 +333,16 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { resource basketHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'basket-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5103 - hostname: '/basket-api' } } resource basketGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'basket-grpc' - location: location + location: ucpLocation properties: { application: eshop.id port: 9103 @@ -381,13 +352,12 @@ resource basketGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-api resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'webhooks-api' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/webhooks.api:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' OrchestratorType: OCHESTRATOR_TYPE @@ -395,7 +365,7 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { ConnectionString: 'Server=tcp:${sqlWebhooksDb.properties.server},1433;Initial Catalog=${sqlWebhooksDb.properties.database};User Id=${adminLogin};Password=${adminPassword};Encrypt=true' EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString identityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -420,24 +390,22 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { resource webhooksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'webhooks-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5113 - hostname: '/webhooks-api' } } // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/payment-api resource payment 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'payment-api' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/payment.api:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY @@ -464,7 +432,7 @@ resource payment 'Applications.Core/containers@2022-03-15-privatepreview' = { resource paymentHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'payment-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5108 @@ -474,13 +442,12 @@ resource paymentHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-backgroundtasks resource orderbgtasks 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'ordering-backgroundtasks' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/ordering.backgroundtasks:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/ordering-backgroundtasks' @@ -515,7 +482,7 @@ resource orderbgtasks 'Applications.Core/containers@2022-03-15-privatepreview' = resource orderbgtasksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'orderbgtasks-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5111 @@ -527,13 +494,12 @@ resource orderbgtasksHttp 'Applications.Core/httproutes@2022-03-15-privateprevie // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webshoppingagg resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'webshoppingagg' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/webshoppingagg:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' PATH_BASE: '/webshoppingagg' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -550,7 +516,7 @@ resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' IdentityUrlHC: '${identityHttp.properties.url}/hc' BasketUrlHC: '${basketHttp.properties.url}/hc' PaymentUrlHC: '${paymentHttp.properties.url}/hc' - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -578,25 +544,22 @@ resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' resource webshoppingaggHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'webshoppingagg-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5121 - hostname: '/webshoppingagg' } } // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/apigwws resource webshoppingapigw 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'webshoppingapigw' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'radius.azurecr.io/eshop-envoy:0.1.3' - env: { - disableDefaultEnvVars: 'True' - } + env: {} ports: { http: { containerPort: 80 @@ -614,17 +577,16 @@ resource webshoppingapigw 'Applications.Core/containers@2022-03-15-privateprevie resource webshoppingapigwHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'webshoppingapigw-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5202 - hostname: '/webshoppingapigw' } } resource webshoppingapigwHttp2 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'webshoppingapigw-http-2' - location: location + location: ucpLocation properties: { application: eshop.id port: 15202 @@ -634,13 +596,12 @@ resource webshoppingapigwHttp2 'Applications.Core/httproutes@2022-03-15-privatep // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/ordering-signalrhub resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'ordering-signalrhub' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/ordering.signalrhub:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/ordering-signalrhub' @@ -651,7 +612,7 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' IdentityUrl: identityHttp.properties.url - IdentityUrlExternal: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -685,7 +646,7 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev resource orderingsignalrhubHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'orderingsignalrhub-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5112 @@ -695,21 +656,20 @@ resource orderingsignalrhubHttp 'Applications.Core/httproutes@2022-03-15-private // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webhooks-web resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'webhooks-client' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/webhooks.client:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Production' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webhooks-web' Token: 'WebHooks-Demo-Web' - CallBackUrl: '${CLUSTERDNS}${webhooksclientHttp.properties.hostname}' + CallBackUrl: '${gateway.properties.url}/${webhooksclientHttp.properties.hostname}' SelfUrl: webhooksclientHttp.properties.url WebhooksUrl: webhooksHttp.properties.url - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrl: '${gateway.properties.url}/${identityHttp.properties.hostname}' } ports: { http: { @@ -731,11 +691,10 @@ resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' resource webhooksclientHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'webhooksclient-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5114 - hostname: '/webhooks-web' } } @@ -744,13 +703,12 @@ resource webhooksclientHttp 'Applications.Core/httproutes@2022-03-15-privateprev // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webstatus resource webstatus 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'webstatus' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/webstatus:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webstatus' @@ -790,24 +748,22 @@ resource webstatus 'Applications.Core/containers@2022-03-15-privatepreview' = { resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'webstatus-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 8107 - hostname: '/webstatus' } } // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webspa resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'web-spa' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/webspa:${TAG}' env: { - disableDefaultEnvVars: 'True' PATH_BASE: '/' ASPNETCORE_ENVIRONMENT: 'Production' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -815,11 +771,11 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' - CallBackUrl: '${CLUSTERDNS}/' + CallBackUrl: '${gateway.properties.url}/' DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' + IdentityUrl: '${gateway.properties.url}/identity-api' IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.hostname}' + PurchaseUrl: '${gateway.properties.url}/webshoppingapigw' SignalrHubUrl: orderingsignalrhubHttp.properties.url } ports: { @@ -851,24 +807,22 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { resource webspaHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'webspa-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5104 - hostname: '/' } } // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webmvc resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'webmvc' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'eshop/webmvc:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webmvc' @@ -878,11 +832,11 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' - CallBackUrl: '${CLUSTERDNS}${webmvcHttp.properties.hostname}' - IdentityUrl: '${CLUSTERDNS}${identityHttp.properties.hostname}' + ExternalPurchaseUrl: '${gateway.properties.url}/${webshoppingapigwHttp.properties.hostname}' + CallBackUrl: '${gateway.properties.url}/webmvc' + IdentityUrl: '${gateway.properties.url}/identity-api' IdentityUrlHC: '${identityHttp.properties.url}/hc' PurchaseUrl: webshoppingapigwHttp.properties.url - ExternalPurchaseUrl: '${CLUSTERDNS}${webshoppingapigwHttp.properties.hostname}' SignalrHubUrl: orderingsignalrhubHttp.properties.url } ports: { @@ -914,11 +868,10 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { resource webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'webmvc-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5100 - hostname: '/webmvc' } } @@ -926,13 +879,12 @@ resource webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { resource seq 'Applications.Core/containers@2022-03-15-privatepreview' = { name: 'seq' - location: location + location: ucpLocation properties: { application: eshop.id container: { image: 'datalust/seq:latest' env: { - disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' } ports: { @@ -948,313 +900,327 @@ resource seq 'Applications.Core/containers@2022-03-15-privatepreview' = { resource seqHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { name: 'seq-http' - location: location + location: ucpLocation properties: { application: eshop.id port: 5340 } } -resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-identitydb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - disableDefaultEnvVars: 'True' - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword +// Infrastructure -------------------------------------- + +resource servicebus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' = { + name: 'eshopsb${uniqueString(resourceGroup().id)}' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' + } + + resource topic 'topics' = { + name: 'eshop_event_bus' + properties: { + defaultMessageTimeToLive: 'P14D' + maxSizeInMegabytes: 1024 + requiresDuplicateDetection: false + enableBatchedOperations: true + supportOrdering: false + enablePartitioning: true + enableExpress: false + } + + resource rootRule 'authorizationRules' = { + name: 'Root' + properties: { + rights: [ + 'Manage' + 'Send' + 'Listen' + ] } - ports: { - sql: { - containerPort: 1433 - provides: sqlIdentityRoute.id - } + } + + resource basket 'subscriptions' = { + name: 'Basket' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true } } - } -} -resource sqlIdentityRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-identitydb' - location: location - properties: { - application: eshop.id - port: 1433 - } -} + resource catalog 'subscriptions' = { + name: 'Catalog' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true + } + } -resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'identitydb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlIdentityRoute.properties.hostname - database: 'IdentityDb' - } -} + resource ordering 'subscriptions' = { + name: 'Ordering' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true + } + } -resource sqlCatalogContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-catalogdb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - disableDefaultEnvVars: 'True' - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword + resource graceperiod 'subscriptions' = { + name: 'GracePeriod' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true } - ports: { - sql: { - containerPort: 1433 - provides: sqlCatalogRoute.id - } + } + + resource payment 'subscriptions' = { + name: 'Payment' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true + } + } + + resource backgroundTasks 'subscriptions' = { + name: 'backgroundtasks' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true + } + } + + resource OrderingSignalrHub 'subscriptions' = { + name: 'Ordering.signalrhub' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true } } + + resource webhooks 'subscriptions' = { + name: 'Webhooks' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true + } + } + } + } -resource sqlCatalogRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-catalogdb' - location: location +resource sql 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'eshopsql${uniqueString(resourceGroup().id)}' + location: azureLocation properties: { - application: eshop.id - port: 1433 + administratorLogin: adminLogin + administratorLoginPassword: adminPassword } -} -resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'catalogdb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlCatalogRoute.properties.hostname - database: 'CatalogDb' + // Allow communication from all other Azure resources + resource allowAzureResources 'firewallRules' = { + name: 'allow-azure-resources' + properties: { + startIpAddress: '0.0.0.0' + endIpAddress: '0.0.0.0' + } } -} -resource sqlOrderingContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-orderingdb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - disableDefaultEnvVars: 'True' - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlOrderingRoute.id - } - } + resource identityDb 'databases' = { + name: 'IdentityDb' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' } } -} -resource sqlOrderingRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-orderingdb' - location: location - properties: { - application: eshop.id - port: 1433 + resource catalogDb 'databases' = { + name: 'CatalogDb' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' + } } -} -resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'orderingdb' - location: location - properties: { - application: eshop.id - environment: environmentId - server: sqlOrderingRoute.properties.hostname - database: 'OrderingDb' + resource orderingDb 'databases' = { + name: 'OrderingDb' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' + } } -} -resource sqlWebhooksContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-server-webhooksdb' - location: location - properties: { - application: eshop.id - container: { - image: 'mcr.microsoft.com/mssql/server:2019-latest' - env: { - disableDefaultEnvVars: 'True' - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: adminPassword - } - ports: { - sql: { - containerPort: 1433 - provides: sqlWebhooksRoute.id - } - } + resource webhooksDb 'databases' = { + name: 'WebhooksDb' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' } } + } -resource sqlWebhooksRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'sql-route-webhooksdb' - location: location +resource keystoreCache 'Microsoft.Cache/redis@2020-12-01' = { + name: 'eshopkeystore${uniqueString(resourceGroup().id)}' + location: azureLocation properties: { - application: eshop.id - port: 1433 + enableNonSslPort: false + minimumTlsVersion: '1.2' + sku: { + family: 'C' + capacity: 1 + name: 'Basic' + } } } -resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { - name: 'webhooksdb' - location: location +resource basketCache 'Microsoft.Cache/redis@2020-12-01' = { + name: 'eshopbasket${uniqueString(resourceGroup().id)}' + location: azureLocation properties: { - application: eshop.id - environment: environmentId - server: sqlWebhooksRoute.properties.hostname - database: 'WebhooksDb' + enableNonSslPort: false + minimumTlsVersion: '1.2' + sku: { + family: 'C' + capacity: 1 + name: 'Basic' + } } } -resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'redis-container-basket-data' - location: location +resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2021-04-15' = { + name: 'eshopcosmos${uniqueString(resourceGroup().id)}' + location: azureLocation + kind: 'MongoDB' properties: { - application: eshop.id - container: { - image: 'redis:6.2' - env: { - disableDefaultEnvVars: 'True' + databaseAccountOfferType: 'Standard' + consistencyPolicy: { + defaultConsistencyLevel: 'Session' + } + locations: [ + { + locationName: azureLocation } - ports: { - redis: { - containerPort: 6379 - provides: redisBasketRoute.id - } + ] + } + + resource cosmosDb 'mongodbDatabases' = { + name: 'mongo' + properties: { + resource: { + id: 'mongo' + } + options: { + throughput: 400 } } } -} -resource redisBasketRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'redis-route-basket-data' - location: location - properties: { - application: eshop.id - port: 6379 - } } -resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { - name: 'basket-data' - location: location +// Connectors ---------------------------------------------------------------------------- + +resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'identitydb' + location: ucpLocation properties: { application: eshop.id - environment: environmentId - host: redisBasketRoute.properties.hostname - port: redisBasketRoute.properties.port - secrets: { - connectionString: '${redisBasketRoute.properties.hostname}:${redisBasketRoute.properties.port},password=},ssl=True,abortConnect=False' - password: '' - } + environment: environment + resource: sql::identityDb.id } } -resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'redis-container-keystore-data' - location: location +resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'catalogdb' + location: ucpLocation properties: { application: eshop.id - container: { - image: 'redis:6.2' - env: { - disableDefaultEnvVars: 'True' - } - ports: { - redis: { - containerPort: 6379 - provides: redisKeystoreRoute.id - } - } - } + environment: environment + resource: sql::catalogDb.id } } -resource redisKeystoreRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'redis-route-keystore-data' - location: location +resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'orderingdb' + location: ucpLocation properties: { application: eshop.id - port: 6379 + environment: environment + resource: sql::orderingDb.id } } -resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { - name: 'keystore-data' - location: location +resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'webhooksdb' + location: ucpLocation properties: { application: eshop.id - environment: environmentId - host: redisKeystoreRoute.properties.hostname - port: redisKeystoreRoute.properties.port - secrets: { - connectionString: '${redisKeystoreRoute.properties.hostname}:${redisKeystoreRoute.properties.port},password=},ssl=True,abortConnect=False' - password: '' - } + environment: environment + resource: sql::webhooksDb.id } } -resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'mongo-container' - location: location + +resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { + name: 'basket-data' + location: ucpLocation properties: { application: eshop.id - container: { - image: 'mongo:4.2' - env: { - disableDefaultEnvVars: 'True' - MONGO_INITDB_ROOT_USERNAME: mongoUsername - MONGO_INITDB_ROOT_PASSWORD: mongoPassword - } - ports: { - mongo: { - containerPort: 27017 - provides: mongoRoute.id - } - } - } + environment: environment + resource: basketCache.id } } -resource mongoRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'mongo-route' - location: location +resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { + name: 'keystore-data' + location: ucpLocation properties: { application: eshop.id - port: 27017 + environment: environment + resource: keystoreCache.id } } resource mongo 'Applications.Connector/mongoDatabases@2022-03-15-privatepreview' = { name: 'mongo' - location: location + location: ucpLocation properties: { application: eshop.id - environment: environmentId - secrets: { - connectionString: 'mongodb://${mongoUsername}:${mongoPassword}@${mongoRoute.properties.hostname}:${mongoRoute.properties.port}' - username: mongoUsername - password: mongoPassword - } + environment: environment + resource: cosmosAccount::cosmosDb.id } } diff --git a/reference-apps/eshop/iac/app.bicep b/reference-apps/eshop/iac/app.bicep index c0eea624..0219a16b 100644 --- a/reference-apps/eshop/iac/app.bicep +++ b/reference-apps/eshop/iac/app.bicep @@ -87,7 +87,6 @@ resource catalog 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/catalog.api:${TAG}' env: { - disableDefaultEnvVars: 'True' UseCustomizationData: 'False' PATH_BASE: '/catalog-api' ASPNETCORE_ENVIRONMENT: 'Development' @@ -150,7 +149,6 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/identity.api:${TAG}' env: { - disableDefaultEnvVars: 'True' PATH_BASE: '/identity-api' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -226,7 +224,6 @@ resource ordering 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/ordering.api:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' UseCustomizationData: 'False' @@ -297,7 +294,6 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/basket.api:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY @@ -364,7 +360,6 @@ resource webhooks 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/webhooks.api:linux-dev' env: { - disableDefaultEnvVars: 'True' PATH_BASE: '/webhooks-api' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -415,7 +410,6 @@ resource payment 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/payment.api:linux-dev' env: { - disableDefaultEnvVars: 'True' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY 'Serilog__MinimumLevel__Override__payment-api.IntegrationEvents.EventHandling': 'Verbose' 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' @@ -456,7 +450,6 @@ resource orderbgtasks 'Applications.Core/containers@2022-03-15-privatepreview' = container: { image: 'eshop/ordering.backgroundtasks:linux-dev' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' UseCustomizationData: 'False' @@ -508,7 +501,6 @@ resource webshoppingagg 'Applications.Core/containers@2022-03-15-privatepreview' container: { image: 'eshop/webshoppingagg:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' PATH_BASE: '/webshoppingagg' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -561,7 +553,6 @@ resource webshoppingaggHttp 'Applications.Core/httproutes@2022-03-15-privateprev properties: { application: eshop.id port: 5121 - //hostname: '/webshoppingagg' } } @@ -573,9 +564,7 @@ resource webshoppingapigw 'Applications.Core/containers@2022-03-15-privateprevie application: eshop.id container: { image: 'radius.azurecr.io/eshop-envoy:0.1.3' - env: { - disableDefaultEnvVars: 'True' - } + env: {} ports: { http: { containerPort: 80 @@ -597,7 +586,6 @@ resource webshoppingapigwHttp 'Applications.Core/httproutes@2022-03-15-privatepr properties: { application: eshop.id port: 5202 - //hostname: '/webshoppingapigw' } } @@ -619,7 +607,6 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev container: { image: 'eshop/ordering.signalrhub:${TAG}' env: { - disableDefaultEnvVars: 'True' PATH_BASE: '/payment-api' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -680,7 +667,6 @@ resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' container: { image: 'eshop/webhooks.client:linux-dev' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Production' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webhooks-web' @@ -729,7 +715,6 @@ resource webstatus 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/webstatus:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' HealthChecksUI__HealthChecks__0__Name: 'WebMVC HTTP Check' @@ -772,7 +757,6 @@ resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' properties: { application: eshop.id port: 8107 - //hostname: '/webstatus' } } @@ -785,7 +769,6 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/webspa:${TAG}' env: { - disableDefaultEnvVars: 'True' PATH_BASE: '/' ASPNETCORE_ENVIRONMENT: 'Production' ASPNETCORE_URLS: 'http://0.0.0.0:80' @@ -795,9 +778,9 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { IsClusterEnv: 'True' CallBackUrl: '${gateway.properties.url}/' DPConnectionString: redisKeystore.properties.host - IdentityUrl: '${gateway.properties.url}/${identityHttp.properties.hostname}' + IdentityUrl: '${gateway.properties.url}/identity-api' IdentityUrlHC: '${identityHttp.properties.url}/hc' - PurchaseUrl: '${gateway.properties.url}/${webshoppingapigwHttp.properties.hostname}' + PurchaseUrl: '${gateway.properties.url}/webshoppingapigw' SignalrHubUrl: orderingsignalrhubHttp.properties.url } ports: { @@ -833,7 +816,6 @@ resource webspaHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5104 - //hostname: '/' } } @@ -846,7 +828,6 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'eshop/webmvc:${TAG}' env: { - disableDefaultEnvVars: 'True' ASPNETCORE_ENVIRONMENT: 'Development' ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webmvc' @@ -896,7 +877,6 @@ resource webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { properties: { application: eshop.id port: 5100 - //hostname: '/webmvc' } } @@ -910,7 +890,6 @@ resource seq 'Applications.Core/containers@2022-03-15-privatepreview' = { container: { image: 'datalust/seq:latest' env: { - disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' } ports: { @@ -940,11 +919,7 @@ resource rabbitmqContainer 'Applications.Core/containers@2022-03-15-privateprevi application: eshop.id container: { image: 'rabbitmq:3.9' - env: { - disableDefaultEnvVars: 'True' - //RABBITMQ_DEFAULT_USER: username - //RABBITMQ_DEFAULT_PASS: password - } + env: {} ports: { rabbitmq: { containerPort: 5672 @@ -985,7 +960,6 @@ resource sqlIdentityContainer 'Applications.Core/containers@2022-03-15-privatepr container: { image: 'mcr.microsoft.com/mssql/server:2019-latest' env: { - disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' MSSQL_PID: 'Developer' MSSQL_SA_PASSWORD: adminPassword @@ -1028,7 +1002,6 @@ resource sqlCatalogContainer 'Applications.Core/containers@2022-03-15-privatepre container: { image: 'mcr.microsoft.com/mssql/server:2019-latest' env: { - disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' MSSQL_PID: 'Developer' MSSQL_SA_PASSWORD: adminPassword @@ -1071,7 +1044,6 @@ resource sqlOrderingContainer 'Applications.Core/containers@2022-03-15-privatepr container: { image: 'mcr.microsoft.com/mssql/server:2019-latest' env: { - disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' MSSQL_PID: 'Developer' MSSQL_SA_PASSWORD: adminPassword @@ -1114,7 +1086,6 @@ resource sqlWebhooksContainer 'Applications.Core/containers@2022-03-15-privatepr container: { image: 'mcr.microsoft.com/mssql/server:2019-latest' env: { - disableDefaultEnvVars: 'True' ACCEPT_EULA: 'Y' MSSQL_PID: 'Developer' MSSQL_SA_PASSWORD: adminPassword @@ -1156,9 +1127,7 @@ resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepr application: eshop.id container: { image: 'redis:6.2' - env: { - disableDefaultEnvVars: 'True' - } + env: {} ports: { redis: { containerPort: 6379 @@ -1200,9 +1169,7 @@ resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-private application: eshop.id container: { image: 'redis:6.2' - env: { - disableDefaultEnvVars: 'True' - } + env: {} ports: { redis: { containerPort: 6379 @@ -1245,7 +1212,6 @@ resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' container: { image: 'mongo:4.2' env: { - disableDefaultEnvVars: 'True' MONGO_INITDB_ROOT_USERNAME: mongoUsername MONGO_INITDB_ROOT_PASSWORD: mongoPassword } From 0cae44ef946d278192f06bb9e1b353950c600fb9 Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Thu, 11 Aug 2022 16:54:20 -0400 Subject: [PATCH 09/14] update redis connection string --- reference-apps/eshop/iac/app.azure.bicep | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index 5157fc81..9597435d 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -152,7 +152,7 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' - DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + DPConnectionString: redisKeystore.connectionString() ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY XamarinCallback: '' EnableDevspaces: ENABLEDEVSPACES @@ -301,7 +301,7 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { PORT: '80' GRPC_PORT: '81' AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port},password=${redisBasket.password()},ssl=True,abortConnect=False,sslprotocols=tls12' + ConnectionString: redisBasket.connectionString() EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString identityUrl: identityHttp.properties.url IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' @@ -610,7 +610,7 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev IsClusterEnv: 'True' AzureServiceBusEnabled: AZURESERVICEBUSENABLED EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + SignalrStoreConnectionString: redisKeystore.connectionString() IdentityUrl: identityHttp.properties.url IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } @@ -772,7 +772,7 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' CallBackUrl: '${gateway.properties.url}/' - DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + DPConnectionString: redisKeystore.connectionString() IdentityUrl: '${gateway.properties.url}/identity-api' IdentityUrlHC: '${identityHttp.properties.url}/hc' PurchaseUrl: '${gateway.properties.url}/webshoppingapigw' @@ -829,7 +829,7 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { UseCustomizationData: 'False' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY UseLoadTest: 'False' - DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + DPConnectionString: redisKeystore.connectionString() OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' ExternalPurchaseUrl: '${gateway.properties.url}/${webshoppingapigwHttp.properties.hostname}' From 92350741d5d9c73d9f026dd7bd9ecef84ac875fb Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Fri, 12 Aug 2022 12:30:48 -0400 Subject: [PATCH 10/14] revert redis changes --- reference-apps/eshop/iac/app.azure.bicep | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index 9597435d..5157fc81 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -152,7 +152,7 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' - DPConnectionString: redisKeystore.connectionString() + DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY XamarinCallback: '' EnableDevspaces: ENABLEDEVSPACES @@ -301,7 +301,7 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { PORT: '80' GRPC_PORT: '81' AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: redisBasket.connectionString() + ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port},password=${redisBasket.password()},ssl=True,abortConnect=False,sslprotocols=tls12' EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString identityUrl: identityHttp.properties.url IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' @@ -610,7 +610,7 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev IsClusterEnv: 'True' AzureServiceBusEnabled: AZURESERVICEBUSENABLED EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - SignalrStoreConnectionString: redisKeystore.connectionString() + SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' IdentityUrl: identityHttp.properties.url IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } @@ -772,7 +772,7 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' CallBackUrl: '${gateway.properties.url}/' - DPConnectionString: redisKeystore.connectionString() + DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' IdentityUrl: '${gateway.properties.url}/identity-api' IdentityUrlHC: '${identityHttp.properties.url}/hc' PurchaseUrl: '${gateway.properties.url}/webshoppingapigw' @@ -829,7 +829,7 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { UseCustomizationData: 'False' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY UseLoadTest: 'False' - DPConnectionString: redisKeystore.connectionString() + DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' ExternalPurchaseUrl: '${gateway.properties.url}/${webshoppingapigwHttp.properties.hostname}' From 9d1f3b7bf94ed3551918971a69296221c83f7a4f Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Fri, 12 Aug 2022 12:49:26 -0400 Subject: [PATCH 11/14] add redis route to azure bicep --- reference-apps/eshop/iac/app.azure.bicep | 60 +++++++++++++++++++++++- reference-apps/eshop/iac/app.bicep | 18 ++----- 2 files changed, 63 insertions(+), 15 deletions(-) diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index 5157fc81..1d60ce3c 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -1195,13 +1195,68 @@ resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepr } } +resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-basket-data' + location: ucpLocation + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + env: {} + ports: { + redis: { + containerPort: 6379 + provides: redisBasketRoute.id + } + } + } + } +} + +resource redisBasketRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-basket-data' + location: ucpLocation + properties: { + application: eshop.id + port: 6379 + } +} + resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { name: 'basket-data' location: ucpLocation properties: { application: eshop.id environment: environment - resource: basketCache.id + host: redisBasketRoute.properties.hostname + port: redisBasketRoute.properties.port + } +} + +resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'redis-container-keystore-data' + location: ucpLocation + properties: { + application: eshop.id + container: { + image: 'redis:6.2' + env: {} + ports: { + redis: { + containerPort: 6379 + provides: redisKeystoreRoute.id + } + } + } + } +} + +resource redisKeystoreRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'redis-route-keystore-data' + location: ucpLocation + properties: { + application: eshop.id + port: 6379 } } @@ -1211,7 +1266,8 @@ resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepre properties: { application: eshop.id environment: environment - resource: keystoreCache.id + host: redisKeystoreRoute.properties.hostname + port: redisKeystoreRoute.properties.port } } diff --git a/reference-apps/eshop/iac/app.bicep b/reference-apps/eshop/iac/app.bicep index 0219a16b..bed136c9 100644 --- a/reference-apps/eshop/iac/app.bicep +++ b/reference-apps/eshop/iac/app.bicep @@ -154,7 +154,7 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' OrchestratorType: 'K8S' IsClusterEnv: 'True' - DPConnectionString: redisKeystore.properties.host + DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY XamarinCallback: '' EnableDevspaces: ENABLEDEVSPACES @@ -303,7 +303,7 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { PORT: '80' GRPC_PORT: '81' AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port}' + ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port},password=${redisBasket.password()},ssl=True,abortConnect=False' EventBusConnection: rabbitmq.connectionString() identityUrl: identityHttp.properties.url IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' @@ -615,7 +615,7 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev IsClusterEnv: 'True' AzureServiceBusEnabled: AZURESERVICEBUSENABLED EventBusConnection: rabbitmq.connectionString() - SignalrStoreConnectionString: redisKeystore.properties.host + SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' identityUrl: identityHttp.properties.url IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } @@ -777,7 +777,7 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' CallBackUrl: '${gateway.properties.url}/' - DPConnectionString: redisKeystore.properties.host + DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' IdentityUrl: '${gateway.properties.url}/identity-api' IdentityUrlHC: '${identityHttp.properties.url}/hc' PurchaseUrl: '${gateway.properties.url}/webshoppingapigw' @@ -832,7 +832,7 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' PATH_BASE: '/webmvc' UseCustomizationData: 'False' - DPConnectionString: redisKeystore.properties.host + DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY UseLoadTest: 'False' OrchestratorType: OCHESTRATOR_TYPE @@ -1155,10 +1155,6 @@ resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privateprevi environment: environment host: redisBasketRoute.properties.hostname port: redisBasketRoute.properties.port - secrets: { - connectionString: '${redisBasketRoute.properties.hostname}:${redisBasketRoute.properties.port},password=},ssl=True,abortConnect=False' - password: '' - } } } @@ -1197,10 +1193,6 @@ resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepre environment: environment host: redisKeystoreRoute.properties.hostname port: redisKeystoreRoute.properties.port - secrets: { - connectionString: '${redisKeystoreRoute.properties.hostname}:${redisKeystoreRoute.properties.port},password=},ssl=True,abortConnect=False' - password: '' - } } } From 6578bbfdbf7b2e069cae42bdbdcef527779b9ab9 Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Fri, 12 Aug 2022 14:24:46 -0400 Subject: [PATCH 12/14] manually build connection string in keystore resource --- reference-apps/eshop/iac/app.azure.bicep | 78 +++++------------------- 1 file changed, 16 insertions(+), 62 deletions(-) diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index 1d60ce3c..7ea45f5b 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -152,7 +152,7 @@ resource identity 'Applications.Core/containers@2022-03-15-privatepreview' = { ASPNETCORE_URLS: 'http://0.0.0.0:80' OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' - DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + DPConnectionString: redisKeystore.connectionString() ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY XamarinCallback: '' EnableDevspaces: ENABLEDEVSPACES @@ -301,7 +301,7 @@ resource basket 'Applications.Core/containers@2022-03-15-privatepreview' = { PORT: '80' GRPC_PORT: '81' AzureServiceBusEnabled: AZURESERVICEBUSENABLED - ConnectionString: '${redisBasket.properties.host}:${redisBasket.properties.port},password=${redisBasket.password()},ssl=True,abortConnect=False,sslprotocols=tls12' + ConnectionString: redisBasket.connectionString() EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString identityUrl: identityHttp.properties.url IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' @@ -610,7 +610,7 @@ resource orderingsignalrhub 'Applications.Core/containers@2022-03-15-privateprev IsClusterEnv: 'True' AzureServiceBusEnabled: AZURESERVICEBUSENABLED EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString - SignalrStoreConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + SignalrStoreConnectionString: redisKeystore.connectionString() IdentityUrl: identityHttp.properties.url IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } @@ -772,7 +772,7 @@ resource webspa 'Applications.Core/containers@2022-03-15-privatepreview' = { OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' CallBackUrl: '${gateway.properties.url}/' - DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + DPConnectionString: redisKeystore.connectionString() IdentityUrl: '${gateway.properties.url}/identity-api' IdentityUrlHC: '${identityHttp.properties.url}/hc' PurchaseUrl: '${gateway.properties.url}/webshoppingapigw' @@ -829,7 +829,7 @@ resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { UseCustomizationData: 'False' ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY UseLoadTest: 'False' - DPConnectionString: '${redisKeystore.properties.host}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + DPConnectionString: redisKeystore.connectionString() OrchestratorType: OCHESTRATOR_TYPE IsClusterEnv: 'True' ExternalPurchaseUrl: '${gateway.properties.url}/${webshoppingapigwHttp.properties.hostname}' @@ -1195,79 +1195,33 @@ resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepr } } -resource redisBasketContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'redis-container-basket-data' - location: ucpLocation - properties: { - application: eshop.id - container: { - image: 'redis:6.2' - env: {} - ports: { - redis: { - containerPort: 6379 - provides: redisBasketRoute.id - } - } - } - } -} - -resource redisBasketRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'redis-route-basket-data' - location: ucpLocation - properties: { - application: eshop.id - port: 6379 - } -} - resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { name: 'basket-data' location: ucpLocation properties: { application: eshop.id environment: environment - host: redisBasketRoute.properties.hostname - port: redisBasketRoute.properties.port - } -} - -resource redisKeystoreContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'redis-container-keystore-data' - location: ucpLocation - properties: { - application: eshop.id - container: { - image: 'redis:6.2' - env: {} - ports: { - redis: { - containerPort: 6379 - provides: redisKeystoreRoute.id - } - } + host: basketCache.properties.hostName + port: basketCache.properties.port + secrets: { + password: basketCache.listKeys().primaryKey + connectionString: '${basketCache.properties.hostName}:${basketCache.properties.port},password=${basketCache.listKeys().primaryKey},ssl=True,abortConnect=False' } } } -resource redisKeystoreRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'redis-route-keystore-data' - location: ucpLocation - properties: { - application: eshop.id - port: 6379 - } -} - resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { name: 'keystore-data' location: ucpLocation properties: { application: eshop.id environment: environment - host: redisKeystoreRoute.properties.hostname - port: redisKeystoreRoute.properties.port + host: keystoreCache.properties.hostName + port: keystoreCache.properties.port + secrets: { + password: keystoreCache.listKeys().primaryKey + connectionString: '${keystoreCache.properties.hostName}:${keystoreCache.properties.port},password=${keystoreCache.listKeys().primaryKey},ssl=True,abortConnect=False' + } } } From d532bf6eaf0a1aebd6e1feb20b16d811d1450be6 Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Fri, 12 Aug 2022 14:43:09 -0400 Subject: [PATCH 13/14] change to sslport --- reference-apps/eshop/iac/app.azure.bicep | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index 7ea45f5b..dab20ded 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -1202,7 +1202,7 @@ resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privateprevi application: eshop.id environment: environment host: basketCache.properties.hostName - port: basketCache.properties.port + port: basketCache.properties.sslPort secrets: { password: basketCache.listKeys().primaryKey connectionString: '${basketCache.properties.hostName}:${basketCache.properties.port},password=${basketCache.listKeys().primaryKey},ssl=True,abortConnect=False' @@ -1217,7 +1217,7 @@ resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepre application: eshop.id environment: environment host: keystoreCache.properties.hostName - port: keystoreCache.properties.port + port: keystoreCache.properties.sslPort secrets: { password: keystoreCache.listKeys().primaryKey connectionString: '${keystoreCache.properties.hostName}:${keystoreCache.properties.port},password=${keystoreCache.listKeys().primaryKey},ssl=True,abortConnect=False' From f3acf9337408ea67ec9780b937051aff63d70b5c Mon Sep 17 00:00:00 2001 From: Mohammad Haveliwala Date: Fri, 12 Aug 2022 14:50:48 -0400 Subject: [PATCH 14/14] sslPort --- reference-apps/eshop/iac/app.azure.bicep | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index dab20ded..fe80fbe4 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -1205,7 +1205,7 @@ resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privateprevi port: basketCache.properties.sslPort secrets: { password: basketCache.listKeys().primaryKey - connectionString: '${basketCache.properties.hostName}:${basketCache.properties.port},password=${basketCache.listKeys().primaryKey},ssl=True,abortConnect=False' + connectionString: '${basketCache.properties.hostName}:${basketCache.properties.sslPort},password=${basketCache.listKeys().primaryKey},ssl=True,abortConnect=False' } } } @@ -1220,7 +1220,7 @@ resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepre port: keystoreCache.properties.sslPort secrets: { password: keystoreCache.listKeys().primaryKey - connectionString: '${keystoreCache.properties.hostName}:${keystoreCache.properties.port},password=${keystoreCache.listKeys().primaryKey},ssl=True,abortConnect=False' + connectionString: '${keystoreCache.properties.hostName}:${keystoreCache.properties.sslPort},password=${keystoreCache.listKeys().primaryKey},ssl=True,abortConnect=False' } } }