diff --git a/reference-apps/eshop/iac/app.azure.bicep b/reference-apps/eshop/iac/app.azure.bicep index d0ae5147..fe80fbe4 100644 --- a/reference-apps/eshop/iac/app.azure.bicep +++ b/reference-apps/eshop/iac/app.azure.bicep @@ -1,5 +1,11 @@ -param ESHOP_EXTERNAL_DNS_NAME_OR_IP string = '*' -param CLUSTER_IP string +import radius as radius + +// Parameters -------------------------------------------- +param environment string + +param ucpLocation string = 'global' +param azureLocation string = resourceGroup().location + param OCHESTRATOR_TYPE string = 'K8S' param APPLICATION_INSIGHTS_KEY string = '' param AZURESTORAGEENABLED string = 'False' @@ -7,993 +13,1224 @@ 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' +param adminPassword string = newGuid() - resource rootRule 'authorizationRules' existing = { - name: 'Root' - } +resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'eshop' + location: ucpLocation + properties: { + environment: environment } - } -resource eshop 'radius.dev/Application@v1alpha3' existing = { - name: 'eshop' +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { + name: 'gateway' + location: ucpLocation + properties: { + application: eshop.id + 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 '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 - } - } +// 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: ucpLocation + 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: 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: ucpLocation + 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: ucpLocation + 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: ucpLocation + 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: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + DPConnectionString: redisKeystore.connectionString() + 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: '${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}' } - 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 } } } - } - - 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' - } - } - } + 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 } } } +} - // 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 - } - } +resource identityHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'identity-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5105 + } +} + +// 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: ucpLocation + 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: '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: '${gateway.properties.url}/${identityHttp.properties.hostname}' } - 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 } } } - } - - 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' - } - } - } + connections: { + sql: { + source: sqlOrderingDb.id + } + identity: { + source: identityHttp.id + } + servicebus: { + source: servicebus.id } } } +} - resource orderingGrpc 'HttpRoute' = { - name: 'ordering-grpc' - properties: { - port: 9102 - } +resource orderingHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'ordering-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5102 } +} - // 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 - } - } +resource orderingGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'ordering-grpc' + location: ucpLocation + properties: { + application: eshop.id + port: 9102 + } +} + +// 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: ucpLocation + properties: { + application: eshop.id + 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.connectionString() + EventBusConnection: listKeys(servicebus::topic::rootRule.id, servicebus::topic::rootRule.apiVersion).primaryConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } - traits: [] - connections: { - redis: { - kind: 'redislabs.com/Redis' - source: redisBasket.id - } - identity: { - kind: 'Http' - source: identityHttp.id + ports: { + http: { + containerPort: 80 + provides: basketHttp.id } - servicebus: { - kind: 'azure' - source: servicebus.id + grpc: { + containerPort: 81 + provides: basketGrpc.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' - } - } - } + connections: { + redis: { + source: redisBasket.id + } + identity: { + source: identityHttp.id + } + servicebus: { + source: servicebus.id } } } +} - resource basketGrpc 'HttpRoute' = { - name: 'basket-grpc' - properties: { - port: 9103 - } +resource basketHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'basket-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5103 } +} - // 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 - } - } +resource basketGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'basket-grpc' + location: ucpLocation + properties: { + application: eshop.id + port: 9103 + } +} + +// 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: ucpLocation + properties: { + application: eshop.id + 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:${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: '${gateway.properties.url}/${identityHttp.properties.hostname}' } - 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 } } } - } - - 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' - } - } - } + connections: { + sql: { + source: sqlWebhooksDb.id + } + identity: { + source: identityHttp.id + } + servicebus: { + source: servicebus.id } } } +} + +resource webhooksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooks-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5113 + } +} - // 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: ucpLocation + properties: { + application: eshop.id + 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 } - 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: ucpLocation + 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: ucpLocation + properties: { + application: eshop.id + 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:${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: ucpLocation + 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: ucpLocation + 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 + 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: '${gateway.properties.url}/${identityHttp.properties.hostname}' } - 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 } } } - } - - 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' - } - } - } + connections: { + identity: { + source: identityHttp.id + } + ordering: { + source: orderingHttp.id + } + catalog: { + source: catalogHttp.id + } + basket: { + source: basketHttp.id } } } +} - // 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 - } +resource webshoppingaggHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingagg-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5121 + } +} + +// 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: ucpLocation + 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: {} } + 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: ucpLocation + properties: { + application: eshop.id + port: 5202 + } +} + +resource webshoppingapigwHttp2 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingapigw-http-2' + location: ucpLocation + properties: { + application: eshop.id + port: 15202 + } +} + +// 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: ucpLocation + properties: { + application: eshop.id + 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.connectionString() + IdentityUrl: identityHttp.properties.url + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' + } + 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 webshoppingapigwHttp2 'HttpRoute' = { - name: 'webshoppingapigw-http-2' - properties: { - port: 15202 - } +resource orderingsignalrhubHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'orderingsignalrhub-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5112 } +} - // 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/webhooks-web +resource webhooksclient 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webhooks-client' + location: ucpLocation + properties: { + application: eshop.id + 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: '${gateway.properties.url}/${webhooksclientHttp.properties.hostname}' + SelfUrl: webhooksclientHttp.properties.url + WebhooksUrl: webhooksHttp.properties.url + IdentityUrl: '${gateway.properties.url}/${identityHttp.properties.hostname}' } - 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: webhooksclientHttp.id } } } + connections: { + webhooks: { + source: webhooksHttp.id + } + identity: { + source: identityHttp.id + } + } } +} - resource orderingsignalrhubHttp 'HttpRoute' = { - name: 'orderingsignalrhub-http' - properties: { - port: 5112 - } +resource webhooksclientHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooksclient-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5114 } +} - // 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 - } - } +// 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: ucpLocation + properties: { + application: eshop.id + 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 } - traits: [] - connections: { - webhooks: { - kind: 'Http' - source: webhooksHttp.id - } - identity: { - kind: 'Http' - source: identityHttp.id + ports: { + http: { + containerPort: 80 + provides: webstatusHttp.id } } } + connections: {} } +} - 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 webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webstatus-http' + location: ucpLocation + properties: { + application: eshop.id + port: 8107 + } +} + +// 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: ucpLocation + 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: '${gateway.properties.url}/' + DPConnectionString: redisKeystore.connectionString() + IdentityUrl: '${gateway.properties.url}/identity-api' + IdentityUrlHC: '${identityHttp.properties.url}/hc' + PurchaseUrl: '${gateway.properties.url}/webshoppingapigw' + SignalrHubUrl: orderingsignalrhubHttp.properties.url + } + 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 + } + } } +} - // Sites ---------------------------------------------- +resource webspaHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webspa-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5104 + } +} - // 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/webmvc +resource webmvc 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'webmvc' + location: ucpLocation + 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' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + DPConnectionString: redisKeystore.connectionString() + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + 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 + } + ports: { + http: { + containerPort: 80 + provides: webmvcHttp.id } } - traits: [] - connections: {} + } + connections: { + redis: { + source: redisKeystore.id + } + webshoppingagg: { + source: webshoppingaggHttp.id + } + identity: { + source: identityHttp.id + } + webshoppingapigw: { + source: webshoppingapigwHttp.id + } + orderingsignalrhub: { + source: orderingsignalrhubHttp.id + } } } +} - 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 webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webmvc-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5100 + } +} + +// Logging -------------------------------------------- + +resource seq 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'seq' + location: ucpLocation + properties: { + application: eshop.id + container: { + image: 'datalust/seq:latest' + env: { + ACCEPT_EULA: 'Y' + } + ports: { + web: { + containerPort: 80 + provides: seqHttp.id } } } + connections: {} + } +} + +resource seqHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'seq-http' + location: ucpLocation + properties: { + application: eshop.id + port: 5340 + } +} + +// Infrastructure -------------------------------------- + +resource servicebus 'Microsoft.ServiceBus/namespaces@2021-06-01-preview' = { + name: 'eshopsb${uniqueString(resourceGroup().id)}' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' } - // Based on https://github.com/dotnet-architecture/eShopOnContainers/tree/dev/deploy/k8s/helm/webspa - resource webspa 'Container' = { - name: 'web-spa' + resource topic 'topics' = { + name: 'eshop_event_bus' 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 - } - } + defaultMessageTimeToLive: 'P14D' + maxSizeInMegabytes: 1024 + requiresDuplicateDetection: false + enableBatchedOperations: true + supportOrdering: false + enablePartitioning: true + enableExpress: false + } + + resource rootRule 'authorizationRules' = { + name: 'Root' + properties: { + rights: [ + 'Manage' + 'Send' + 'Listen' + ] } - 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 basket 'subscriptions' = { + name: 'Basket' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true } } - } - 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 catalog 'subscriptions' = { + name: 'Catalog' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true } } - } - // 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 - } - } + resource ordering 'subscriptions' = { + name: 'Ordering' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true } - 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 graceperiod 'subscriptions' = { + name: 'GracePeriod' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true } } - } - 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 payment 'subscriptions' = { + name: 'Payment' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true } } - } - // Logging -------------------------------------------- + resource backgroundTasks 'subscriptions' = { + name: 'backgroundtasks' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true + } + } - resource seq 'Container' = { - name: 'seq' - properties: { - container: { - image: 'datalust/seq:latest' - env: { - ACCEPT_EULA: 'Y' - } - ports: { - web: { - containerPort: 80 - provides: seqHttp.id - } - } + resource OrderingSignalrHub 'subscriptions' = { + name: 'Ordering.signalrhub' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true } - traits: [] - connections: {} } - } - resource seqHttp 'HttpRoute' = { - name: 'seq-http' - properties: { - port: 5340 + resource webhooks 'subscriptions' = { + name: 'Webhooks' + properties: { + requiresSession: false + defaultMessageTimeToLive: 'P14D' + deadLetteringOnMessageExpiration: true + deadLetteringOnFilterEvaluationExceptions: true + maxDeliveryCount: 10 + enableBatchedOperations: true + } } + } - // Gateway -------------------------------------------- +} - resource gateway 'Gateway' existing = { - name: 'gateway' +resource sql 'Microsoft.Sql/servers@2021-02-01-preview' = { + name: 'eshopsql${uniqueString(resourceGroup().id)}' + location: azureLocation + properties: { + administratorLogin: adminLogin + administratorLoginPassword: adminPassword } - // Infrastructure -------------------------------------------- + // 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 sqlIdentity 'microsoft.com.SQLDatabase' existing = { + resource identityDb 'databases' = { name: 'IdentityDb' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' + } } - resource sqlCatalog 'microsoft.com.SQLDatabase' existing = { + resource catalogDb 'databases' = { name: 'CatalogDb' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' + } } - resource sqlOrdering 'microsoft.com.SQLDatabase' existing = { + resource orderingDb 'databases' = { name: 'OrderingDb' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' + } } - resource sqlWebhooks 'microsoft.com.SQLDatabase' existing = { + resource webhooksDb 'databases' = { name: 'WebhooksDb' + location: azureLocation + sku: { + name: 'Standard' + tier: 'Standard' + } } - resource redisBasket 'redislabs.com.RedisCache' existing = { - name: 'basket-data' +} + +resource keystoreCache 'Microsoft.Cache/redis@2020-12-01' = { + name: 'eshopkeystore${uniqueString(resourceGroup().id)}' + location: azureLocation + properties: { + enableNonSslPort: false + minimumTlsVersion: '1.2' + sku: { + family: 'C' + capacity: 1 + name: 'Basic' + } + } +} + +resource basketCache 'Microsoft.Cache/redis@2020-12-01' = { + name: 'eshopbasket${uniqueString(resourceGroup().id)}' + location: azureLocation + properties: { + enableNonSslPort: false + minimumTlsVersion: '1.2' + sku: { + family: 'C' + capacity: 1 + name: 'Basic' + } } +} - resource redisKeystore 'redislabs.com.RedisCache' existing = { - name: 'keystore-data' +resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2021-04-15' = { + name: 'eshopcosmos${uniqueString(resourceGroup().id)}' + location: azureLocation + kind: 'MongoDB' + properties: { + databaseAccountOfferType: 'Standard' + consistencyPolicy: { + defaultConsistencyLevel: 'Session' + } + locations: [ + { + locationName: azureLocation + } + ] } - resource mongo 'mongo.com.MongoDatabase' existing = { + resource cosmosDb 'mongodbDatabases' = { name: 'mongo' + properties: { + resource: { + id: 'mongo' + } + options: { + throughput: 400 + } + } + } + +} + +// Connectors ---------------------------------------------------------------------------- + +resource sqlIdentityDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'identitydb' + location: ucpLocation + properties: { + application: eshop.id + environment: environment + resource: sql::identityDb.id + } +} + +resource sqlCatalogDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'catalogdb' + location: ucpLocation + properties: { + application: eshop.id + environment: environment + resource: sql::catalogDb.id + } +} + +resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'orderingdb' + location: ucpLocation + properties: { + application: eshop.id + environment: environment + resource: sql::orderingDb.id + } +} + +resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'webhooksdb' + location: ucpLocation + properties: { + application: eshop.id + environment: environment + resource: sql::webhooksDb.id + } +} + +resource redisBasket 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { + name: 'basket-data' + location: ucpLocation + properties: { + application: eshop.id + environment: environment + host: basketCache.properties.hostName + port: basketCache.properties.sslPort + secrets: { + password: basketCache.listKeys().primaryKey + connectionString: '${basketCache.properties.hostName}:${basketCache.properties.sslPort},password=${basketCache.listKeys().primaryKey},ssl=True,abortConnect=False' + } + } +} + +resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { + name: 'keystore-data' + location: ucpLocation + properties: { + application: eshop.id + environment: environment + host: keystoreCache.properties.hostName + port: keystoreCache.properties.sslPort + secrets: { + password: keystoreCache.listKeys().primaryKey + connectionString: '${keystoreCache.properties.hostName}:${keystoreCache.properties.sslPort},password=${keystoreCache.listKeys().primaryKey},ssl=True,abortConnect=False' + } + } +} + +resource mongo 'Applications.Connector/mongoDatabases@2022-03-15-privatepreview' = { + name: 'mongo' + location: ucpLocation + properties: { + application: eshop.id + environment: environment + resource: cosmosAccount::cosmosDb.id } } diff --git a/reference-apps/eshop/iac/app.bicep b/reference-apps/eshop/iac/app.bicep index 158c0a5d..bed136c9 100644 --- a/reference-apps/eshop/iac/app.bicep +++ b/reference-apps/eshop/iac/app.bicep @@ -1,5 +1,12 @@ -param ESHOP_EXTERNAL_DNS_NAME_OR_IP string = '*' -param CLUSTER_IP string +import radius as radius + +// Parameters -------------------------------------------- +param environment string + +param location string = resourceGroup().location + +param mongoUsername string = 'admin' +param mongoPassword string = newGuid() param OCHESTRATOR_TYPE string = 'K8S' param APPLICATION_INSIGHTS_KEY string = '' param AZURESTORAGEENABLED string = 'False' @@ -7,989 +14,1228 @@ 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() 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: environment + } +} - // 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 - } - } +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { + name: 'gateway' + location: location + properties: { + application: eshop.id + routes: [ + { + path: '/identity-api' + destination: identityHttp.id } - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlCatalog.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' + 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: rabbitmq.connectionString() + } + ports: { + http: { + containerPort: 80 + provides: catalogHttp.id } - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id + grpc: { + containerPort: 81 + provides: catalogGrpc.id } } } + connections: { + sql: { + source: sqlCatalogDb.id + } + rabbitmq: { + 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}:${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}' + 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}' } - 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 } } } - } - - 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' - } - } - } + 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 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'identity-http' + location: location + properties: { + application: eshop.id + port: 5105 + } +} - // 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: rabbitmq.connectionString() + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } - 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 } } } - } - - 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' - } - } - } + connections: { + sql: { + source: sqlOrderingDb.id + } + rabbitmq: { + source: rabbitmq.id + } + identity: { + source: identityHttp.id } } } +} - resource orderingGrpc 'HttpRoute' = { - name: 'ordering-grpc' - properties: { - port: 9102 - } +resource orderingHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'ordering-http' + location: location + properties: { + application: eshop.id + port: 5102 } +} - // 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 - } - } +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 '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},password=${redisBasket.password()},ssl=True,abortConnect=False' + EventBusConnection: rabbitmq.connectionString() + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } - 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 } } } - } - - 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' - } - } - } + connections: { + redis: { + source: redisBasket.id + } + rabbitmq: { + source: rabbitmq.id + } + identity: { + source: identityHttp.id } } } +} - resource basketGrpc 'HttpRoute' = { - name: 'basket-grpc' - properties: { - port: 9103 - } +resource basketHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'basket-http' + location: location + properties: { + application: eshop.id + port: 5103 } +} - // 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 - } - } +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 '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: rabbitmq.connectionString() + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' } - 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 } } } - } - 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' - } - } - } + connections: { + sql: { + source: sqlWebhooksDb.id + } + rabbitmq: { + source: rabbitmq.id + } + identity: { + source: identityHttp.id } } } +} - // 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 - } - } +resource webhooksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooks-http' + location: location + properties: { + application: eshop.id + port: 5113 + } +} + +// 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: rabbitmq.connectionString() } - traits: [] - connections: { - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id + ports: { + http: { + containerPort: 80 + provides: paymentHttp.id } } } + connections: { + rabbitmq: { + 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: rabbitmq.connectionString() } - traits: [] - connections: { - sql: { - kind: 'microsoft.com/SQL' - source: sqlOrdering.id - } - rabbitmq: { - kind: 'rabbitmq.com/MessageQueue' - source: rabbitmq.id + ports: { + http: { + containerPort: 80 + provides: orderbgtasksHttp.id } } } + connections: { + sql: { + source: sqlOrderingDb.id + } + rabbitmq: { + 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 - } - } +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: '${gateway.properties.url}/${identityHttp.properties.hostname}' } - 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 + ports: { + http: { + containerPort: 80 + provides: webshoppingaggHttp.id } } } + connections: { + rabbitmq: { + source: rabbitmq.id + } + 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 + } +} + +// 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 } } } + connections: {} + } +} + +resource webshoppingapigwHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingapigw-http' + location: location + properties: { + application: eshop.id + port: 5202 } +} - // 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 - } +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 '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: rabbitmq.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}' + } + ports: { + http: { + containerPort: 80 + provides: orderingsignalrhubHttp.id } } - traits: [] - connections: {} + } + connections: { + redis: { + source: redisKeystore.id + } + rabbitmq: { + source: rabbitmq.id + } + identity: { + source: identityHttp.id + } + ordering: { + source: orderingHttp.id + } + catalog: { + source: catalogHttp.id + } + basket: { + source: basketHttp.id + } } } +} - 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 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 '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: '${gateway.properties.url}/${webhooksclientHttp.properties.hostname}' + SelfUrl: webhooksclientHttp.properties.url + WebhooksUrl: webhooksHttp.properties.url + IdentityUrl: '${gateway.properties.url}/${identityHttp.properties.hostname}' + } + ports: { + http: { + containerPort: 80 + provides: webhooksclientHttp.id } } } + connections: { + webhooks: { + source: webhooksHttp.id + } + identity: { + source: identityHttp.id + } + } } +} - resource webshoppingapigwHttp2 'HttpRoute' = { - name: 'webshoppingapigw-http-2' - properties: { - port: 15202 - } +resource webhooksclientHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooksclient-http' + location: location + properties: { + application: eshop.id + port: 5114 + hostname: '/webhooks-web' } +} - // 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 - } - } +// 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 } - 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: webstatusHttp.id } } } + connections: {} } +} - resource orderingsignalrhubHttp 'HttpRoute' = { - name: 'orderingsignalrhub-http' - properties: { - port: 5112 - } +resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webstatus-http' + location: location + properties: { + application: eshop.id + port: 8107 } +} - // 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/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: '${gateway.properties.url}/' + 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' + SignalrHubUrl: orderingsignalrhubHttp.properties.url } - traits: [] - connections: { - webhooks: { - kind: 'Http' - source: webhooksHttp.id - } - identity: { - kind: 'Http' - source: identityHttp.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 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webspa-http' + location: location + properties: { + application: eshop.id + port: 5104 } +} - 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' - } - } +// 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}:${redisKeystore.properties.port},password=${redisKeystore.password()},ssl=True,abortConnect=False' + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + OrchestratorType: OCHESTRATOR_TYPE + IsClusterEnv: 'True' + 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 + } + ports: { + http: { + containerPort: 80 + provides: webmvcHttp.id } } } + connections: { + redis: { + source: redisKeystore.id + } + webshoppingagg: { + source: webshoppingaggHttp.id + } + identity: { + source: identityHttp.id + } + webshoppingapigw: { + source: webshoppingapigwHttp.id + } + orderingsignalrhub: { + source: orderingsignalrhubHttp.id + } + } } +} - // 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 webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webmvc-http' + location: location + properties: { + application: eshop.id + port: 5100 + } +} + +// 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' + } + ports: { + web: { + containerPort: 80 + provides: seqHttp.id } } - traits: [] - connections: {} } + connections: {} + } +} + +resource seqHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'seq-http' + location: location + properties: { + application: eshop.id + port: 5340 } +} - 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 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: {} + ports: { + rabbitmq: { + containerPort: 5672 + provides: rabbitmqRoute.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 - } - } - } - 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 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: environment + queue: 'eshop-event-bus' + secrets: { + connectionString: rabbitmqRoute.properties.hostname } } +} - 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 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 } } } } +} - // 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 - } - } +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: environment + 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 } - 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: { + sql: { + containerPort: 1433 + provides: sqlCatalogRoute.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 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: environment + 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 } } } } +} - // Logging -------------------------------------------- +resource sqlOrderingRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-orderingdb' + location: location + properties: { + application: eshop.id + port: 1433 + } +} - resource seq 'Container' = { - name: 'seq' - properties: { - container: { - image: 'datalust/seq:latest' - env: { - ACCEPT_EULA: 'Y' - } - ports: { - web: { - containerPort: 80 - provides: seqHttp.id - } +resource sqlOrderingDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'orderingdb' + location: location + properties: { + application: eshop.id + environment: environment + 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 } } - traits: [] - connections: {} } } +} - resource seqHttp 'HttpRoute' = { - name: 'seq-http' - properties: { - port: 5340 - } +resource sqlWebhooksRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'sql-route-webhooksdb' + location: location + properties: { + application: eshop.id + port: 1433 } +} - // Gateway -------------------------------------------- - - resource gateway 'Gateway' existing = { - name: 'gateway' +resource sqlWebhooksDb 'Applications.Connector/sqlDatabases@2022-03-15-privatepreview' = { + name: 'webhooksdb' + location: location + properties: { + application: eshop.id + environment: environment + 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: {} + 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: environment + host: redisBasketRoute.properties.hostname + port: redisBasketRoute.properties.port } +} - 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: {} + 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 redisKeystore 'redislabs.com.RedisCache' existing = { - name: 'keystore-data' +resource redisKeystore 'Applications.Connector/redisCaches@2022-03-15-privatepreview' = { + name: 'keystore-data' + location: location + properties: { + application: eshop.id + environment: environment + host: redisKeystoreRoute.properties.hostname + port: redisKeystoreRoute.properties.port } +} - resource redisBasket 'redislabs.com.RedisCache' existing = { - name: 'basket-data' +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: environment + 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 deleted file mode 100644 index 1906b5df..00000000 --- a/reference-apps/eshop/iac/infra.azure.bicep +++ /dev/null @@ -1,230 +0,0 @@ -// Parameters -------------------------------------------- -param location string = resourceGroup().location -param adminLogin string = 'sqladmin' -@secure() -param adminPassword string - -resource eshop 'radius.dev/Application@v1alpha3' = { - name: 'eshop' - - // Gateway -------------------------------------------- - - resource gateway 'Gateway' = { - name: 'gateway' - properties: { - listeners: { - 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 - } - } - - } - -} - -// Starters --------------------------------------------------------- - -module sqlIdentity 'br:radius.azurecr.io/starters/sql-azure:latest' = { - name: 'sql-identity' - params: { - adminUsername: adminLogin - adminPassword: adminPassword - databaseName: 'IdentityDb' - location: location - radiusApplication: eshop - } -} - -module sqlCatalog 'br:radius.azurecr.io/starters/sql-azure:latest' = { - name: 'sql-catalog' - params: { - adminUsername: adminLogin - adminPassword: adminPassword - databaseName: 'CatalogDb' - location: location - radiusApplication: eshop - } -} - -module sqlOrdering 'br:radius.azurecr.io/starters/sql-azure:latest' = { - name: 'sql-ordering' - params: { - adminUsername: adminLogin - adminPassword: adminPassword - databaseName: 'OrderingDb' - location: location - radiusApplication: eshop - } -} - -module sqlWebhooks 'br:radius.azurecr.io/starters/sql-azure:latest' = { - name: 'sql-webhooks' - params: { - adminUsername: adminLogin - adminPassword: adminPassword - databaseName: 'WebhooksDb' - location: location - radiusApplication: eshop - } -} - -module redisBasket 'br:radius.azurecr.io/starters/redis-azure:latest' = { - name: 'basket-data' - params: { - cacheName: 'basket-data' - location: location - radiusApplication: eshop - } -} - -module redisKeystore 'br:radius.azurecr.io/starters/redis-azure:latest' = { - name: 'keystore-data' - params: { - cacheName: 'keystore-data' - location: location - radiusApplication: eshop - } -} - -module mongo 'br:radius.azurecr.io/starters/mongo-azure:latest' = { - name: 'mongo' - params: { - dbName: 'mongo' - location: location - radiusApplication: eshop - } -} diff --git a/reference-apps/eshop/iac/infra.bicep b/reference-apps/eshop/iac/infra.bicep deleted file mode 100644 index 62c0a1e9..00000000 --- a/reference-apps/eshop/iac/infra.bicep +++ /dev/null @@ -1,92 +0,0 @@ -// Parameters -------------------------------------------- -@secure() -param adminPassword string - -resource eshop 'radius.dev/Application@v1alpha3' = { - name: 'eshop' - - // Gateway -------------------------------------------- - - resource gateway 'Gateway' = { - name: 'gateway' - properties: { - listeners: { - http: { - protocol: 'HTTP' - port: 80 - } - } - } - } - -} - -// Starters --------------------------------------------------------- - -module rabbitMQ 'br:radius.azurecr.io/starters/rabbitmq:latest' = { - name: 'rabbitmq' - params: { - queueName: 'eshop_event_bus' - radiusApplication: eshop - } -} - -module sqlIdentity 'br:radius.azurecr.io/starters/sql:latest' = { - name: 'sql-identity' - params: { - adminPassword: adminPassword - databaseName: 'IdentityDb' - radiusApplication: eshop - } -} - -module sqlCatalog 'br:radius.azurecr.io/starters/sql:latest' = { - name: 'sql-catalog' - params: { - adminPassword: adminPassword - databaseName: 'CatalogDb' - radiusApplication: eshop - } -} - -module sqlOrdering 'br:radius.azurecr.io/starters/sql:latest' = { - name: 'sql-ordering' - params: { - adminPassword: adminPassword - databaseName: 'OrderingDb' - radiusApplication: eshop - } -} - -module sqlWebhooks 'br:radius.azurecr.io/starters/sql:latest' = { - name: 'sql-webhooks' - params: { - adminPassword: adminPassword - databaseName: 'WebhooksDb' - radiusApplication: eshop - } -} - -module redisBasket 'br:radius.azurecr.io/starters/redis:latest' = { - name: 'basket-data' - params: { - cacheName: 'basket-data' - radiusApplication: eshop - } -} - -module redisKeystore 'br:radius.azurecr.io/starters/redis:latest' = { - name: 'keystore-data' - params: { - cacheName: 'keystore-data' - radiusApplication: eshop - } -} - -module mongo 'br:radius.azurecr.io/starters/mongo:latest' = { - name: 'mongo' - params: { - dbName: 'mongo' - radiusApplication: eshop - } -} 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 -