diff --git a/reference-apps/README.md b/reference-apps/README.md index fb0fa912..0acb6cd3 100644 --- a/reference-apps/README.md +++ b/reference-apps/README.md @@ -5,5 +5,6 @@ Reference apps are templates that show a complete app. You are able to clone and | Reference app | Description | |---------------|-------------| | [eShop](./eshop) | A full retail microservices application. | +| [eShop on Recipes](./eshop-recipes) | A full retail microservices application leveraging Radius recipes for infrastructure deployment and management | | [eShop on Dapr](./eshop-dapr) | A full retail microservices application leveraging Dapr for full code + infrastructure portability | | [Container App Store](./container-app-store) | A microservices application that uses Dapr. | diff --git a/reference-apps/eshop-recipes/README.md b/reference-apps/eshop-recipes/README.md new file mode 100644 index 00000000..ece32444 --- /dev/null +++ b/reference-apps/eshop-recipes/README.md @@ -0,0 +1,32 @@ +# eShop on Recipes reference application + +## Source + +This reference app is a "radified" version of the [eShop on containers](https://github.com/dotnet-architecture/eShopOnContainers) .NET reference application. + +## Deploy + +1. Have a kubernetes cluster handy from the [supported clusters](https://docs.radapp.dev/operations/platforms/kubernetes/supported-clusters/). + - (AWS only) Make sure that each of the Subnets in your EKS cluster Subnet Group are within the list of [supported MemoryDB availability zones](https://docs.aws.amazon.com/memorydb/latest/devguide/subnetgroups.html) +1. [Install the rad CLI](https://radapp.dev/getting-started/) +1. [Initialize a new Radius environment](https://radapp.dev/getting-started/) +1. Clone the repository and switch to the app directory: + ```bash + git clone https://github.com/project-radius/samples.git + cd samples/reference-apps/eshop + ``` +1. Deploy the environment (choose which type of hosting infrastructure you wish to use): + ```bash + # AWS + rad deploy iac/environments/aws.bicep + + # Azure + rad deploy iac/environments/azure.bicep + + # Containers + rad deploy iac/environments/containers.bicep + ``` +1. Deploy the application: + ```bash + rad deploy iac/eshop.bicep + ``` diff --git a/reference-apps/eshop-recipes/envoy/Dockerfile b/reference-apps/eshop-recipes/envoy/Dockerfile new file mode 100644 index 00000000..18194c1c --- /dev/null +++ b/reference-apps/eshop-recipes/envoy/Dockerfile @@ -0,0 +1,3 @@ +FROM envoyproxy/envoy:v1.11.1 +COPY envoy.yaml /etc/envoy/envoy.yaml +CMD ["/usr/local/bin/envoy", "-c", "/etc/envoy/envoy.yaml"] diff --git a/reference-apps/eshop-recipes/envoy/README.md b/reference-apps/eshop-recipes/envoy/README.md new file mode 100644 index 00000000..d459ed4f --- /dev/null +++ b/reference-apps/eshop-recipes/envoy/README.md @@ -0,0 +1,14 @@ +# Envoy for eshop + +Eshop uses an internal gateway to route requests between different services. Today in Radius, we don't support private/internal gateways (see https://github.com/project-radius/radius/issues/4789), so we created a custom image of envoy with the routing rules necessary to make eshop work. + +What this means is that if we need to update the names of routes in eshop, *we likely need to update the envoy image*. + +The routing configuration is in [envoy.yaml](envoy.yaml). See the `route_config` section specifically. + +To build the docker image, run `docker build . -t radius.azurecr.io/eshop-envoy:0.1.`. + +Where NUMBER is one greater than the latest version made. To view versions, see https://ms.portal.azure.com/#view/Microsoft_Azure_ContainerRegistries/RepositoryBlade/id/%2Fsubscriptions%2F66d1209e-1382-45d3-99bb-650e6bf63fc0%2FresourceGroups%2Fassets%2Fproviders%2FMicrosoft.ContainerRegistry%2Fregistries%2Fradius/repository/eshop-envoy. + +To push the image, run `az acr login -n radius` and then `docker push radius.azurecr.io/eshop-envoy:0.1.`. + diff --git a/reference-apps/eshop-recipes/envoy/envoy.yaml b/reference-apps/eshop-recipes/envoy/envoy.yaml new file mode 100644 index 00000000..1eeec0b6 --- /dev/null +++ b/reference-apps/eshop-recipes/envoy/envoy.yaml @@ -0,0 +1,143 @@ +admin: + access_log_path: "/dev/stdout" + address: + socket_address: + address: 0.0.0.0 + port_value: 8001 +static_resources: + listeners: + - address: + socket_address: + address: 0.0.0.0 + port_value: 80 + filter_chains: + - filters: + - name: envoy.http_connection_manager + config: + codec_type: auto + stat_prefix: ingress_http + route_config: + name: eshop_backend_route + virtual_hosts: + - name: eshop_backend + domains: + - "*" + routes: + - name: "c-short" + match: + prefix: "/webshoppingapigw/c/" + route: + auto_host_rewrite: true + prefix_rewrite: "/catalog-api/" + cluster: catalog + - name: "c-long" + match: + prefix: "/webshoppingapigw/catalog-api/" + route: + auto_host_rewrite: true + cluster: catalog + - name: "o-short" + match: + prefix: "/webshoppingapigw/o/" + route: + auto_host_rewrite: true + prefix_rewrite: "/ordering-api/" + cluster: ordering + - name: "o-long" + match: + prefix: "/webshoppingapigw/ordering-api/" + route: + auto_host_rewrite: true + cluster: ordering + - name: "h-long" + match: + prefix: "/webshoppingapigw/hub/notificationhub" + route: + auto_host_rewrite: true + cluster: signalr-hub + timeout: 300s + upgrade_configs: + upgrade_type: "websocket" + enabled: true + - name: "b-short" + match: + prefix: "/webshoppingapigw/b/" + route: + auto_host_rewrite: true + prefix_rewrite: "/basket-api/" + cluster: basket + - name: "b-long" + match: + prefix: "/webshoppingapigw/basket-api/" + route: + auto_host_rewrite: true + cluster: basket + - name: "agg" + match: + prefix: "/webshoppingapigw/" + route: + auto_host_rewrite: true + prefix_rewrite: "/" + cluster: shoppingagg + http_filters: + - name: envoy.router + access_log: + - name: envoy.file_access_log + filter: + not_health_check_filter: {} + config: + json_format: + time: "%START_TIME%" + protocol: "%PROTOCOL%" + duration: "%DURATION%" + request_method: "%REQ(:METHOD)%" + request_host: "%REQ(HOST)%" + path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" + response_flags: "%RESPONSE_FLAGS%" + route_name: "%ROUTE_NAME%" + upstream_host: "%UPSTREAM_HOST%" + upstream_cluster: "%UPSTREAM_CLUSTER%" + upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" + path: "/tmp/access.log" + clusters: + - name: shoppingagg + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + hosts: + - socket_address: + address: webshoppingagg-http + port_value: 5121 + - name: catalog + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + hosts: + - socket_address: + address: catalog-http + port_value: 5101 + - name: basket + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + hosts: + - socket_address: + address: basket-http + port_value: 5103 + - name: ordering + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + hosts: + - socket_address: + address: ordering-http + port_value: 5102 + - name: signalr-hub + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + hosts: + - socket_address: + address: orderingsignalrhub-http + port_value: 5112 + \ No newline at end of file diff --git a/reference-apps/eshop-recipes/iac/environments/aws.bicep b/reference-apps/eshop-recipes/iac/environments/aws.bicep new file mode 100644 index 00000000..4022cc9f --- /dev/null +++ b/reference-apps/eshop-recipes/iac/environments/aws.bicep @@ -0,0 +1,53 @@ +import radius as rad + +@description('Account ID of the AWS account resources should be deployed in') +param awsAccountId string + +@description('AWS region that resources should be deployed in') +param awsRegion string + +@description('Name of your EKS cluster') +param eksClusterName string + +resource awsEshopEnv 'Applications.Core/environments@2022-03-15-privatepreview' = { + name: 'aws-eshop-env' + properties: { + compute: { + kind: 'kubernetes' + resourceId: 'self' + namespace: 'aws-eshop' + } + providers: { + aws: { + scope: '/planes/aws/aws/accounts/${awsAccountId}/regions/${awsRegion}' + } + } + recipes: { + 'Applications.Datastores/sqlDatabases': { + sqldatabase: { + templateKind: 'bicep' + templatePath: 'radiusdev.azurecr.io/recipes/aws/sqldatabases:pr-29' + parameters: { + eksClusterName: eksClusterName + } + } + } + 'Applications.Datastores/redisCaches': { + rediscache: { + templateKind: 'bicep' + templatePath: 'radius.azurecr.io/recipes/aws/rediscaches:edge' + parameters: { + eksClusterName: eksClusterName + } + } + } + // Temporarily using containerized rabbitmq until we can use SQS or AmazonMQ + 'Applications.Messaging/rabbitMQQueues': { + rabbitmqmessagequeue: { + templateKind: 'bicep' + templatePath: 'radius.azurecr.io/recipes/local-dev/rabbitmqmessagequeues:edge' + } + } + } + } +} diff --git a/reference-apps/eshop-recipes/iac/environments/azure.bicep b/reference-apps/eshop-recipes/iac/environments/azure.bicep new file mode 100644 index 00000000..5708f5a5 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/environments/azure.bicep @@ -0,0 +1,43 @@ +import radius as rad + +@description('Azure ResourceGroup name') +param azureResourceGroup string = resourceGroup().name + +@description('Azure SubscriptionId') +param azureSubscription string = subscription().subscriptionId + +resource azureEShopEnv 'Applications.Core/environments@2022-03-15-privatepreview' = { + name: 'azure-eshop-env' + properties: { + compute: { + kind: 'kubernetes' + resourceId: 'self' + namespace: 'azure-eshop' + } + providers: { + azure: { + scope: '/subscriptions/${azureSubscription}/resourceGroups/${azureResourceGroup}' + } + } + recipes: { + 'Applications.Datastores/sqlDatabases': { + sqldatabase: { + templateKind: 'bicep' + templatePath: 'radius.azurecr.io/recipes/azure/sqldatabases:latest' + } + } + 'Applications.Datastores/redisCaches': { + rediscache: { + templateKind: 'bicep' + templatePath: 'radius.azurecr.io/recipes/azure/rediscaches:latest' + } + } + 'Applications.Core/extenders': { + servicebus: { + templateKind: 'bicep' + templatePath: 'radius.azurecr.io/recipes/azure/extender-servicebus:latest' + } + } + } + } +} diff --git a/reference-apps/eshop-recipes/iac/environments/containers.bicep b/reference-apps/eshop-recipes/iac/environments/containers.bicep new file mode 100644 index 00000000..6fd47e85 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/environments/containers.bicep @@ -0,0 +1,32 @@ +import radius as rad + +resource containersEShopEnv 'Applications.Core/environments@2022-03-15-privatepreview' = { + name: 'containers-eshop-env' + properties: { + compute: { + kind: 'kubernetes' + resourceId: 'self' + namespace: 'containers-eshop' + } + recipes: { + 'Applications.Datastores/sqlDatabases': { + sqldatabase: { + templateKind: 'bicep' + templatePath: 'radius.azurecr.io/recipes/local-dev/sqldatabases:edge' + } + } + 'Applications.Datastores/redisCaches': { + rediscache: { + templateKind: 'bicep' + templatePath: 'radius.azurecr.io/recipes/local-dev/rediscaches:edge' + } + } + 'Applications.Messaging/rabbitMQQueues': { + rabbitmqmessagequeue: { + templateKind: 'bicep' + templatePath: 'radius.azurecr.io/recipes/local-dev/rabbitmqmessagequeues:edge' + } + } + } + } +} diff --git a/reference-apps/eshop-recipes/iac/eshop.bicep b/reference-apps/eshop-recipes/iac/eshop.bicep new file mode 100644 index 00000000..ca171bfd --- /dev/null +++ b/reference-apps/eshop-recipes/iac/eshop.bicep @@ -0,0 +1,255 @@ +import radius as rad + +// Parameters ------------------------------------------------------- + +@description('Name of the eshop application. Defaults to "eshop"') +param appName string = 'eshop' + +@description('Radius environment ID. Set automatically by Radius') +param environment string + +@description('SQL administrator username') +param adminLogin string = 'SA' + +@description('SQL administrator password') +@secure() +param adminPassword string = newGuid() + +@description('Container orchestrator to use. Defaults to "K8S"') +@allowed([ + 'K8S' +]) +param ORCHESTRATOR_TYPE string = 'K8S' + +@description('Optional App Insights Key') +param APPLICATION_INSIGHTS_KEY string = '' + +@description('Use Azure storage for custom resource images. Defaults to "False"') +@allowed([ + 'True' + 'False' +]) +param AZURESTORAGEENABLED string = 'False' + +@description('Use Azure Service Bus for messaging. Defaults to "False"') +@allowed([ + 'True' + 'False' +]) +param AZURESERVICEBUSENABLED string = 'False' + +@description('Use dev spaces. Defaults to "False"') +@allowed([ + 'True' + 'False' +]) +param ENABLEDEVSPACES string = 'False' + +@description('Container image tag to use for eshop images. Defaults to "linux-dotnet7"') +param TAG string = 'linux-dotnet7' + +// Application -------------------------------------------------------- + +resource eshop 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: appName + properties: { + environment: environment + } +} + +// Infrastructure ------------------------------------------------------ + +module infra 'infra/infra.bicep' = { + name: 'infra' + params: { + application: eshop.id + environment: environment + adminLogin: adminLogin + adminPassword: adminPassword + AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED + } +} + +// Networking ---------------------------------------------------------- + +module networking 'infra/networking.bicep' = { + name: 'networking' + params: { + application: eshop.id + } +} + +// Services ------------------------------------------------------------ + +module basket 'services/basket.bicep' = { + name: 'basket' + params: { + application: eshop.id + APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY + AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED + ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE + gatewayName: networking.outputs.gateway + identityHttpName: networking.outputs.identityHttp + basketHttpName: networking.outputs.basketHttp + basketGrpcName: networking.outputs.basketGrpc + redisBasketName: infra.outputs.redisBasket + TAG: TAG + eventBusConnectionString: infra.outputs.eventBusConnectionString + } +} + +module catalog 'services/catalog.bicep' = { + name: 'catalog' + params: { + application: eshop.id + APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY + AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED + AZURESTORAGEENABLED: AZURESTORAGEENABLED + catalogGrpcName: networking.outputs.catalogGrpc + catalogHttpName: networking.outputs.catalogHttp + gatewayName: networking.outputs.gateway + ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE + sqlCatalogDbName: infra.outputs.sqlCatalogDb + TAG: TAG + eventBusConnectionString: infra.outputs.eventBusConnectionString + } +} + +module identity 'services/identity.bicep' = { + name: 'identity' + params: { + application: eshop.id + APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY + basketHttpName: networking.outputs.basketHttp + ENABLEDEVSPACES: ENABLEDEVSPACES + gatewayName: networking.outputs.gateway + identityHttpName: networking.outputs.identityHttp + orderingHttpName: networking.outputs.orderingHttp + redisKeystoreName: infra.outputs.redisKeystore + sqlIdentityDbName: infra.outputs.sqlIdentityDb + TAG: TAG + webhooksclientHttpName: networking.outputs.webhooksclientHttp + webhooksHttpName: networking.outputs.webhooksHttp + webmvcHttpName: networking.outputs.webmvcHttp + webshoppingaggHttpName: networking.outputs.webshoppingaggHttp + } +} + +module ordering 'services/ordering.bicep' = { + name: 'ordering' + params: { + application: eshop.id + APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY + AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED + basketHttpName: networking.outputs.basketHttp + catalogHttpName: networking.outputs.catalogHttp + gatewayName: networking.outputs.gateway + identityHttpName: networking.outputs.identityHttp + ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE + orderbgtasksHttpName: networking.outputs.orderbgtasksHttp + orderingGrpcName: networking.outputs.orderingGrpc + orderingHttpName: networking.outputs.orderingHttp + orderingsignalrhubHttpName: networking.outputs.orderingsignalrhubHttp + redisKeystoreName: infra.outputs.redisKeystore + sqlOrderingDbName: infra.outputs.sqlOrderingDb + TAG: TAG + eventBusConnectionString: infra.outputs.eventBusConnectionString + } +} + +module payment 'services/payment.bicep' = { + name: 'payment' + params: { + application: eshop.id + APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY + AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED + ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE + paymentHttpName: networking.outputs.paymentHttp + TAG: TAG + eventBusConnectionString: infra.outputs.eventBusConnectionString + } +} + +module seq 'services/seq.bicep' = { + name: 'seq' + params: { + application: eshop.id + seqHttpName: networking.outputs.seqHttp + } +} + +module web 'services/web.bicep' = { + name: 'web' + params: { + application: eshop.id + APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY + gatewayName: networking.outputs.gateway + identityHttpName: networking.outputs.identityHttp + ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE + orderingsignalrhubHttpName: networking.outputs.orderingsignalrhubHttp + redisKeystoreName: infra.outputs.redisKeystore + TAG: TAG + webmvcHttpName: networking.outputs.webmvcHttp + webshoppingaggHttpName: networking.outputs.webshoppingaggHttp + webshoppingapigwHttpName: networking.outputs.webshoppingapigwHttp + webspaHttpName: networking.outputs.webspaHttp + } +} + +module webhooks 'services/webhooks.bicep' = { + name: 'webhooks' + params: { + application: eshop.id + AZURESERVICEBUSENABLED: AZURESERVICEBUSENABLED + gatewayName: networking.outputs.gateway + identityHttpName: networking.outputs.identityHttp + ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE + sqlWebhooksDbName: infra.outputs.sqlWebhooksDb + TAG: TAG + webhooksclientHttpName: networking.outputs.webhooksclientHttp + webhooksHttpName: networking.outputs.webhooksHttp + eventBusConnectionString: infra.outputs.eventBusConnectionString + } +} + +module webshopping 'services/webshopping.bicep' = { + name: 'webshopping' + params: { + application: eshop.id + basketGrpcName: networking.outputs.basketGrpc + basketHttpName: networking.outputs.basketHttp + catalogGrpcName: networking.outputs.catalogGrpc + catalogHttpName: networking.outputs.catalogHttp + gatewayName: networking.outputs.gateway + identityHttpName: networking.outputs.identityHttp + ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE + orderingGrpcName: networking.outputs.orderingGrpc + orderingHttpName: networking.outputs.basketHttp + paymentHttpName: networking.outputs.paymentHttp + TAG: TAG + webshoppingaggHttpName: networking.outputs.webshoppingaggHttp + webshoppingapigwHttp2Name: networking.outputs.webshoppingapigwHttp2 + webshoppingapigwHttpName: networking.outputs.webshoppingapigwHttp + } +} + +module webstatus 'services/webstatus.bicep' = { + name: 'webstatus' + params: { + application: eshop.id + APPLICATION_INSIGHTS_KEY: APPLICATION_INSIGHTS_KEY + basketHttpName: networking.outputs.basketHttp + catalogHttpName: networking.outputs.catalogHttp + identityHttpName: networking.outputs.identityHttp + ORCHESTRATOR_TYPE: ORCHESTRATOR_TYPE + orderbgtasksHttpName: networking.outputs.orderbgtasksHttp + orderingHttpName: networking.outputs.orderingHttp + orderingsignalrhubHttpName: networking.outputs.orderingsignalrhubHttp + paymentHttpName: networking.outputs.paymentHttp + TAG: TAG + webmvcHttpName: networking.outputs.webmvcHttp + webshoppingaggHttpName: networking.outputs.webshoppingaggHttp + webspaHttpName: networking.outputs.webspaHttp + webstatusHttpName: networking.outputs.webstatusHttp + } +} diff --git a/reference-apps/eshop-recipes/iac/infra/infra.bicep b/reference-apps/eshop-recipes/iac/infra/infra.bicep new file mode 100644 index 00000000..9cd58018 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/infra/infra.bicep @@ -0,0 +1,165 @@ +import radius as rad + +@description('Radius environment ID') +param environment string + +@description('Radius application ID') +param application string + +@description('SQL administrator username') +@secure() +param adminLogin string + +@description('SQL administrator password') +@secure() +param adminPassword string + +@description('Use Azure Service Bus for messaging. Allowed values: "True", "False".') +@allowed([ + 'True' + 'False' +]) +param AZURESERVICEBUSENABLED string + +// Links --------------------------------------------------------------- + +resource sqlIdentityDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatepreview' = { + name: 'identitydb' + properties: { + application: application + environment: environment + recipe: { + name: 'sqldatabase' + parameters: { + database: 'IdentityDb' + adminLogin: adminLogin + adminPassword: adminPassword + } + } + } +} + +resource sqlCatalogDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatepreview' = { + name: 'catalogdb' + properties: { + application: application + environment: environment + recipe: { + name: 'sqldatabase' + parameters: { + database: 'CatalogDb' + adminLogin: adminLogin + adminPassword: adminPassword + } + } + } +} + +resource sqlOrderingDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatepreview' = { + name: 'orderingdb' + properties: { + application: application + environment: environment + recipe: { + name: 'sqldatabase' + parameters: { + database: 'OrderingDb' + adminLogin: adminLogin + adminPassword: adminPassword + } + } + } +} + +resource sqlWebhooksDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatepreview' = { + name: 'webhooksdb' + properties: { + application: application + environment: environment + recipe: { + name: 'sqldatabase' + parameters: { + database: 'WebhooksDb' + adminLogin: adminLogin + adminPassword: adminPassword + } + } + } +} + +resource redisKeystore 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' = { + name: 'keystore-data' + properties: { + application: application + environment: environment + recipe: { + name: 'rediscache' + } + } +} + +resource redisBasket 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' = { + name: 'basket-data' + properties: { + application: application + environment: environment + recipe: { + name: 'rediscache' + } + } +} + +resource rabbitmq 'Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview' = if (AZURESERVICEBUSENABLED == 'False') { + name: 'rabbitmq' + properties: { + application: application + environment: environment + recipe: { + name: 'rabbitmqmessagequeue' + } + } +} + +resource servicebus 'Applications.Core/extenders@2022-03-15-privatepreview' = if (AZURESERVICEBUSENABLED == 'True') { + name: 'servicebus' + properties: { + application: application + environment: environment + recipe: { + name: 'servicebus' + parameters: { + topicName: 'eshop_event_bus' + subscriptions: ['Basket', 'Catalog', 'Ordering', 'GracePeriod', 'Payment', 'backgroundtasks', 'Ordering.signalrhub', 'Webhooks'] + } + } + } +} + +// Outputs ------------------------------------ + +@description('The name of the SQL Identity Link') +output sqlIdentityDb string = sqlIdentityDb.name + +@description('The name of the SQL Catalog Link') +output sqlCatalogDb string = sqlCatalogDb.name + +@description('The name of the SQL Ordering Link') +output sqlOrderingDb string = sqlOrderingDb.name + +@description('The name of the SQL Webhooks Link') +output sqlWebhooksDb string = sqlWebhooksDb.name + +@description('The name of the Redis Keystore Link') +output redisKeystore string = redisKeystore.name + +@description('The name of the Redis Basket Link') +output redisBasket string = redisBasket.name + +@description('The name of the RabbitMQ Link') +output rabbitmq string = rabbitmq.name + +@description('The name of the Service Bus Link') +output servicebus string = servicebus.name + +@description('Event Bus connection string') +output eventBusConnectionString string = (AZURESERVICEBUSENABLED == 'True') ? servicebus.secrets('connectionString') : rabbitmq.properties.host diff --git a/reference-apps/eshop-recipes/iac/infra/networking.bicep b/reference-apps/eshop-recipes/iac/infra/networking.bicep new file mode 100644 index 00000000..2ceb05d3 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/infra/networking.bicep @@ -0,0 +1,275 @@ +import radius as rad + +// PARAMETERS ------------------------------------------------------------ +@description('Radius application ID') +param application string + +// GATEWAY --------------------------------------------------------- + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { + name: 'gateway' + properties: { + application: application + 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 + } + ] + } +} + + +// ROUTES ---------------------------------------------------------- + +resource basketHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'basket-http' + properties: { + application: application + port: 5103 + } +} + +resource basketGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'basket-grpc' + properties: { + application: application + port: 9103 + } +} + +resource catalogHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'catalog-http' + properties: { + application: application + port: 5101 + } +} + +resource catalogGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'catalog-grpc' + properties: { + application: application + port: 9101 + } +} + +resource identityHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'identity-http' + properties: { + application: application + port: 5105 + } +} + +resource orderingHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'ordering-http' + properties: { + application: application + port: 5102 + } +} + +resource orderingGrpc 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'ordering-grpc' + properties: { + application: application + port: 9102 + } +} + +resource orderingsignalrhubHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'orderingsignalrhub-http' + properties: { + application: application + port: 5112 + } +} + +resource orderbgtasksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'orderbgtasks-http' + properties: { + application: application + port: 5111 + } +} + +resource paymentHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'payment-http' + properties: { + application: application + port: 5108 + } +} + +resource seqHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'seq-http' + properties: { + application: application + port: 5340 + } +} + +resource webspaHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webspa-http' + properties: { + application: application + port: 5104 + } +} + +resource webmvcHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webmvc-http' + properties: { + application: application + port: 5100 + } +} + +resource webhooksHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooks-http' + properties: { + application: application + port: 5113 + } +} + +resource webhooksclientHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webhooksclient-http' + properties: { + application: application + port: 5114 + hostname: '/webhooks-web' + } +} + +resource webshoppingaggHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingagg-http' + properties: { + application: application + port: 5121 + } +} + +resource webshoppingapigwHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingapigw-http' + properties: { + application: application + port: 5202 + } +} + +resource webshoppingapigwHttp2 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webshoppingapigw-http-2' + properties: { + application: application + port: 15202 + } +} + +resource webstatusHttp 'Applications.Core/httproutes@2022-03-15-privatepreview' = { + name: 'webstatus-http' + properties: { + application: application + port: 8107 + } +} + +// OUTPUTS -------------------------------------------------------------------- + +@description('Name of the Gateway') +output gateway string = gateway.name + +@description('Name of the Basket HTTP route') +output basketHttp string = basketHttp.name + +@description('Name of the Basket gRPC route') +output basketGrpc string = basketGrpc.name + +@description('Name of the Catalog HTTP route') +output catalogHttp string = catalogHttp.name + +@description('Name of the Catalog gRPC route') +output catalogGrpc string = catalogGrpc.name + +@description('Name of the Identity HTTP route') +output identityHttp string = identityHttp.name + +@description('Name of the Ordering HTTP route') +output orderingHttp string = orderingHttp.name + +@description('Name of the Ordering gRPC route') +output orderingGrpc string = orderingGrpc.name + +@description('Name of the Ordering SignalR Hub HTTP route') +output orderingsignalrhubHttp string = orderingsignalrhubHttp.name + +@description('Name of the Ordering Background Tasks HTTP route') +output orderbgtasksHttp string = orderbgtasksHttp.name + +@description('Name of the Payment HTTP route') +output paymentHttp string = paymentHttp.name + +@description('Name of the SEQ HTTP route') +output seqHttp string = seqHttp.name + +@description('Name of the WebSPA HTTP route') +output webspaHttp string = webspaHttp.name + +@description('Name of the WebMVC HTTP route') +output webmvcHttp string = webmvcHttp.name + +@description('Name of the Webhooks HTTP route') +output webhooksHttp string = webhooksHttp.name + +@description('Name of the Webhooks Client HTTP route') +output webhooksclientHttp string = webhooksclientHttp.name + +@description('Name of the WebShopping Aggregator HTTP route') +output webshoppingaggHttp string = webshoppingaggHttp.name + +@description('Name of the WebShopping API Gateway HTTP route') +output webshoppingapigwHttp string = webshoppingapigwHttp.name + +@description('Name of the WebShopping API Gateway HTTP route') +output webshoppingapigwHttp2 string = webshoppingapigwHttp2.name + +@description('Name of the WebStatus HTTP route') +output webstatusHttp string = webstatusHttp.name + diff --git a/reference-apps/eshop-recipes/iac/services/basket.bicep b/reference-apps/eshop-recipes/iac/services/basket.bicep new file mode 100644 index 00000000..ad1b4cc0 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/basket.bicep @@ -0,0 +1,116 @@ +import radius as rad + +// Parameters --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('Container image tag to use for eshop images') +param TAG string + +@description('Optional App Insights Key') +param APPLICATION_INSIGHTS_KEY string + +@description('What container orchestrator to use') +@allowed([ + 'K8S' +]) +param ORCHESTRATOR_TYPE string + +@description('Use Azure Service Bus for messaging') +@allowed([ + 'True' + 'False' +]) +param AZURESERVICEBUSENABLED string + +@description('The name of the Radius Gateway') +param gatewayName string + +@description('The name of the Identity HTTP Route') +param identityHttpName string + +@description('The name of the Basket HTTP Route') +param basketHttpName string + +@description('The name of the Basket gRPC Route') +param basketGrpcName string + +@description('The name of the Redis Basket Link') +param redisBasketName string + +@description('The connection string for the event bus') +@secure() +param eventBusConnectionString string + +// Container ------------------------------------- + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/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: ORCHESTRATOR_TYPE + PORT: '80' + GRPC_PORT: '81' + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: redisBasket.connectionString() + EventBusConnection: eventBusConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' + } + ports: { + http: { + containerPort: 80 + provides: basketHttp.id + } + grpc: { + containerPort: 81 + provides: basketGrpc.id + } + } + } + connections: { + redis: { + source: redisBasket.id + disableDefaultEnvVars: true + } + identity: { + source: identityHttp.id + disableDefaultEnvVars: true + } + } + } +} + +// Networking ------------------------------------------- + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' existing = { + name: gatewayName +} + +resource identityHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: identityHttpName +} + +resource basketHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: basketHttpName +} + +resource basketGrpc 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: basketGrpcName +} + +// Links ------------------------------------------ + +resource redisBasket 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' existing = { + name: redisBasketName +} diff --git a/reference-apps/eshop-recipes/iac/services/catalog.bicep b/reference-apps/eshop-recipes/iac/services/catalog.bicep new file mode 100644 index 00000000..a4d7a3ce --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/catalog.bicep @@ -0,0 +1,114 @@ +import radius as rad + +// Parameters --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('What container orchestrator to use') +@allowed([ + 'K8S' +]) +param ORCHESTRATOR_TYPE string + +@description('Optional App Insights Key') +param APPLICATION_INSIGHTS_KEY string + +@description('Use Azure storage for custom resource images') +@allowed([ + 'True' + 'False' +]) +param AZURESTORAGEENABLED string + +@description('Use Azure Service Bus for messaging') +@allowed([ + 'True' + 'False' +]) +param AZURESERVICEBUSENABLED string + +@description('Container image tag to use for eshop images') +param TAG string + +@description('Name of the Gateway') +param gatewayName string + +@description('The name of the Catalog HTTP Route') +param catalogHttpName string + +@description('The name of the Catalog gRPC Route') +param catalogGrpcName string + +@description('The name of the Catalog SQL Link') +param sqlCatalogDbName string + +@description('The connection string for the event bus') +@secure() +param eventBusConnectionString string + +// VARIABLES ----------------------------------------------------------------------------------- + +var PICBASEURL = '${gateway.properties.url}/webshoppingapigw/c/api/v1/catalog/items/[0]/pic' + +// CONTAINERS ------------------------------------------------------------------- + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/eshop/catalog.api:${TAG}' + env: { + UseCustomizationData: 'False' + PATH_BASE: '/catalog-api' + ASPNETCORE_ENVIRONMENT: 'Development' + OrchestratorType: ORCHESTRATOR_TYPE + PORT: '80' + GRPC_PORT: '81' + PicBaseUrl: PICBASEURL + AzureStorageEnabled: AZURESTORAGEENABLED + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: sqlCatalogDb.connectionString() + EventBusConnection: eventBusConnectionString + } + ports: { + http: { + containerPort: 80 + provides: catalogHttp.id + } + grpc: { + containerPort: 81 + provides: catalogGrpc.id + } + } + } + connections: { + sql: { + source: sqlCatalogDb.id + } + } + } +} + +// NETWORKING ------------------------------------------------------ + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' existing = { + name: gatewayName +} + +resource catalogHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: catalogHttpName +} + +resource catalogGrpc 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: catalogGrpcName +} + +// LINKS ----------------------------------------------------------- + +resource sqlCatalogDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatepreview' existing = { + name: sqlCatalogDbName +} diff --git a/reference-apps/eshop-recipes/iac/services/identity.bicep b/reference-apps/eshop-recipes/iac/services/identity.bicep new file mode 100644 index 00000000..81130344 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/identity.bicep @@ -0,0 +1,165 @@ +import radius as rad + +// PARAMETERS --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('Optional App Insights Key') +param APPLICATION_INSIGHTS_KEY string + +@description('Use dev spaces') +@allowed([ + 'True' + 'False' +]) +param ENABLEDEVSPACES string + +@description('Container image tag to use for eshop images. Defaults to linux-dotnet7') +param TAG string + +@description('Name of the Gateway') +param gatewayName string + +@description('Name of the Identity HTTP Route') +param identityHttpName string + +@description('Name of the Basket HTTP Route') +param basketHttpName string + +@description('Name of the Ordering HTTP Route') +param orderingHttpName string + +@description('Name of the WebShoppingAgg HTTP Route') +param webshoppingaggHttpName string + +@description('Name of the Webhooks HTTP Route') +param webhooksHttpName string + +@description('Name of the WebhooksClient HTTP Route') +param webhooksclientHttpName string + +@description('Name of the WebMVC HTTP Route') +param webmvcHttpName string + +@description('Name of the Identity SQL Database Link') +param sqlIdentityDbName string + +@description('Name of the Keystore Redis Link') +param redisKeystoreName string + +// CONTAINERS ------------------------------------------------------------------- + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/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.connectionString() + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + XamarinCallback: '' + EnableDevspaces: ENABLEDEVSPACES + ConnectionString: sqlIdentityDb.connectionString() + MvcClient: '${gateway.properties.url}/${webmvcHttp.properties.hostname}' + SpaClient: gateway.properties.url + BasketApiClient: '${gateway.properties.url}/${basketHttp.properties.hostname}' + OrderingApiClient: '${gateway.properties.url}/${orderingHttp.properties.hostname}' + WebShoppingAggClient: '${gateway.properties.url}/${webshoppingaggHttp.properties.hostname}' + WebhooksApiClient: '${gateway.properties.url}/${webhooksHttp.properties.hostname}' + WebhooksWebClient: '${gateway.properties.url}/${webhooksclientHttp.properties.hostname}' + } + ports: { + http: { + containerPort: 80 + provides: identityHttp.id + } + } + } + connections: { + redis: { + source: redisKeystore.id + disableDefaultEnvVars: true + } + sql: { + source: sqlIdentityDb.id + disableDefaultEnvVars: true + } + webmvc: { + source: webmvcHttp.id + disableDefaultEnvVars: true + } + basket: { + source: basketHttp.id + disableDefaultEnvVars: true + } + ordering: { + source: orderingHttp.id + disableDefaultEnvVars: true + } + webshoppingagg: { + source: webshoppingaggHttp.id + disableDefaultEnvVars: true + } + webhooks: { + source: webhooksHttp.id + disableDefaultEnvVars: true + } + webhoolsclient: { + source: webhooksclientHttp.id + disableDefaultEnvVars: true + } + } + } +} + +// NETWORKING ------------------------------------------------------ + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' existing = { + name: gatewayName +} + +resource identityHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: identityHttpName +} + +resource basketHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: basketHttpName +} + +resource orderingHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderingHttpName +} + +resource webshoppingaggHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webshoppingaggHttpName +} + +resource webhooksHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webhooksHttpName +} + +resource webhooksclientHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webhooksclientHttpName +} + +resource webmvcHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webmvcHttpName +} + +// LINKS ----------------------------------------------------------- + +resource sqlIdentityDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatepreview' existing = { + name: sqlIdentityDbName +} + +resource redisKeystore 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' existing = { + name: redisKeystoreName +} diff --git a/reference-apps/eshop-recipes/iac/services/ordering.bicep b/reference-apps/eshop-recipes/iac/services/ordering.bicep new file mode 100644 index 00000000..b78f9343 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/ordering.bicep @@ -0,0 +1,244 @@ +import radius as rad + +// PARAMETERS --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('What container orchestrator to use') +@allowed([ + 'K8S' +]) +param ORCHESTRATOR_TYPE string + +@description('Optional App Insights Key') +param APPLICATION_INSIGHTS_KEY string + +@description('Use Azure Service Bus for messaging') +@allowed([ + 'True' + 'False' +]) +param AZURESERVICEBUSENABLED string + +@description('Container image tag to use for eshop images') +param TAG string + +@description('Name of the Gateway') +param gatewayName string + +@description('Name of the Identity HTTP Route') +param identityHttpName string + +@description('Name of the Basket HTTP Route') +param basketHttpName string + +@description('The name of the Catalog HTTP Route') +param catalogHttpName string + +@description('Name of the Ordering HTTP Route') +param orderingHttpName string + +@description('Name of the Ordering gRPC Route') +param orderingGrpcName string + +@description('Name of the Ordering SignalR Hub HTTP Route') +param orderingsignalrhubHttpName string + +@description('Name of the Ordering background tasks HTTP Route') +param orderbgtasksHttpName string + +@description('Name of the Keystore Redis Link') +param redisKeystoreName string + +@description('Name of the Ordering SQL Link') +param sqlOrderingDbName string + +@description('The connection string for the event bus') +@secure() +param eventBusConnectionString string + +// CONTAINERS ------------------------------------------------------- + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/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: ORCHESTRATOR_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: sqlOrderingDb.connectionString() + EventBusConnection: eventBusConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' + } + ports: { + http: { + containerPort: 80 + provides: orderingHttp.id + } + grpc: { + containerPort: 81 + provides: orderingGrpc.id + } + } + } + connections: { + sql: { + source: sqlOrderingDb.id + disableDefaultEnvVars: true + } + identity: { + source: identityHttp.id + disableDefaultEnvVars: true + } + } + } +} + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/eshop/ordering.backgroundtasks:${TAG}' + 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: ORCHESTRATOR_TYPE + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: sqlOrderingDb.connectionString() + EventBusConnection: eventBusConnectionString + } + ports: { + http: { + containerPort: 80 + provides: orderbgtasksHttp.id + } + } + } + connections: { + sql: { + source: sqlOrderingDb.id + disableDefaultEnvVars: true + } + } + } +} + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/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: ORCHESTRATOR_TYPE + IsClusterEnv: 'True' + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + EventBusConnection: eventBusConnectionString + 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 + disableDefaultEnvVars: true + } + identity: { + source: identityHttp.id + disableDefaultEnvVars: true + } + ordering: { + source: orderingHttp.id + disableDefaultEnvVars: true + } + catalog: { + source: catalogHttp.id + disableDefaultEnvVars: true + } + basket: { + source: basketHttp.id + disableDefaultEnvVars: true + } + } + } +} + +// NETWORKING ------------------------------------------------------ + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' existing = { + name: gatewayName +} + +resource identityHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: identityHttpName +} + +resource basketHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: basketHttpName +} + +resource catalogHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: catalogHttpName +} + +resource orderingHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderingHttpName +} + +resource orderingGrpc 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderingGrpcName +} + +resource orderingsignalrhubHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderingsignalrhubHttpName +} + +resource orderbgtasksHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderbgtasksHttpName +} + +// LINKS ----------------------------------------------------------- + +resource redisKeystore 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' existing = { + name: redisKeystoreName +} + +resource sqlOrderingDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatepreview' existing = { + name: sqlOrderingDbName +} diff --git a/reference-apps/eshop-recipes/iac/services/payment.bicep b/reference-apps/eshop-recipes/iac/services/payment.bicep new file mode 100644 index 00000000..2bbaa9d2 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/payment.bicep @@ -0,0 +1,65 @@ +import radius as rad + +// PARAMETERS --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('What container orchestrator to use') +@allowed([ + 'K8S' +]) +param ORCHESTRATOR_TYPE string + +@description('Optional App Insights Key') +param APPLICATION_INSIGHTS_KEY string + +@description('Use Azure Service Bus for messaging') +@allowed([ + 'True' + 'False' +]) +param AZURESERVICEBUSENABLED string + +@description('Container image tag to use for eshop images') +param TAG string + +@description('Name of the Payment HTTP route') +param paymentHttpName string + +@description('The connection string for the event bus') +@secure() +param eventBusConnectionString string + +// CONTAINERS --------------------------------------------------------- + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/eshop/payment.api:${TAG}' + env: { + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + 'Serilog__MinimumLevel__Override__payment-api.IntegrationEvents.EventHandling': 'Verbose' + 'Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ': 'Verbose' + OrchestratorType: ORCHESTRATOR_TYPE + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + EventBusConnection: eventBusConnectionString + } + ports: { + http: { + containerPort: 80 + provides: paymentHttp.id + } + } + } + } +} + +// NETWORKING ------------------------------------------------------ + +resource paymentHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: paymentHttpName +} diff --git a/reference-apps/eshop-recipes/iac/services/seq.bicep b/reference-apps/eshop-recipes/iac/services/seq.bicep new file mode 100644 index 00000000..b8074b9f --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/seq.bicep @@ -0,0 +1,36 @@ +import radius as rad + +// PARAMETERS --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('Name of the SEQ Http Route') +param seqHttpName string + +// CONTAINERS ------------------------------------------------------------ + +resource seq 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'seq' + properties: { + application: application + container: { + image: 'datalust/seq:latest' + env: { + ACCEPT_EULA: 'Y' + } + ports: { + web: { + containerPort: 80 + provides: seqHttp.id + } + } + } + } +} + +// NETWORKING --------------------------------------------------------------- + +resource seqHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: seqHttpName +} diff --git a/reference-apps/eshop-recipes/iac/services/web.bicep b/reference-apps/eshop-recipes/iac/services/web.bicep new file mode 100644 index 00000000..6d466b62 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/web.bicep @@ -0,0 +1,190 @@ +import radius as rad + +// PARAMETERS --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('What container orchestrator to use') +@allowed([ + 'K8S' +]) +param ORCHESTRATOR_TYPE string + +@description('Optional App Insights Key') +param APPLICATION_INSIGHTS_KEY string + +@description('Container image tag to use for eshop images') +param TAG string + +@description('Name of the Gateway') +param gatewayName string + +@description('Ordering SignalR Hub Http Route name') +param orderingsignalrhubHttpName string + +@description('Identity Http Route name') +param identityHttpName string + +@description('Web MVC Http Route name') +param webmvcHttpName string + +@description('Web SPA Http Route name') +param webspaHttpName string + +@description('Web Shopping Aggregator Http Route name') +param webshoppingaggHttpName string + +@description('Web shopping API GW HTTP Route name') +param webshoppingapigwHttpName string + +@description('Name of the Keystore Redis Link name') +param redisKeystoreName string + +// CONTAINER -------------------------------------------------------------------- + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/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: ORCHESTRATOR_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 + disableDefaultEnvVars: true + } + webshoppingagg: { + source: webshoppingaggHttp.id + disableDefaultEnvVars: true + } + identity: { + source: identityHttp.id + disableDefaultEnvVars: true + } + webshoppingapigw: { + source: webshoppingapigwHttp.id + disableDefaultEnvVars: true + } + orderingsignalrhub: { + source: orderingsignalrhubHttp.id + disableDefaultEnvVars: true + } + } + } +} + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/eshop/webmvc:${TAG}' + env: { + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + PATH_BASE: '/webmvc' + UseCustomizationData: 'False' + DPConnectionString: redisKeystore.connectionString() + ApplicationInsights__InstrumentationKey: APPLICATION_INSIGHTS_KEY + UseLoadTest: 'False' + OrchestratorType: ORCHESTRATOR_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 + disableDefaultEnvVars: true + } + webshoppingagg: { + source: webshoppingaggHttp.id + disableDefaultEnvVars: true + } + identity: { + source: identityHttp.id + disableDefaultEnvVars: true + } + webshoppingapigw: { + source: webshoppingapigwHttp.id + disableDefaultEnvVars: true + } + orderingsignalrhub: { + source: orderingsignalrhubHttp.id + disableDefaultEnvVars: true + } + } + } +} + +// NETWORKING ---------------------------------------------- + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' existing = { + name: gatewayName +} + +resource orderingsignalrhubHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderingsignalrhubHttpName +} + +resource identityHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: identityHttpName +} + +resource webmvcHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webmvcHttpName +} + +resource webspaHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webspaHttpName +} + +resource webshoppingaggHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webshoppingaggHttpName +} + +resource webshoppingapigwHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webshoppingapigwHttpName +} + +// LINKS ------------------------------------------------------ + +resource redisKeystore 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' existing = { + name: redisKeystoreName +} diff --git a/reference-apps/eshop-recipes/iac/services/webhooks.bicep b/reference-apps/eshop-recipes/iac/services/webhooks.bicep new file mode 100644 index 00000000..bfe4d0b2 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/webhooks.bicep @@ -0,0 +1,141 @@ +import radius as rad + +// PARAMETERS --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('What container orchestrator to use') +@allowed([ + 'K8S' +]) +param ORCHESTRATOR_TYPE string + +@description('Use Azure Service Bus for messaging') +@allowed([ + 'True' + 'False' +]) +param AZURESERVICEBUSENABLED string + +@description('Container image tag to use for eshop images. Defaults to linux-dotnet7') +param TAG string + +@description('Name of the Gateway') +param gatewayName string + +@description('Name of the Identity HTTP Route') +param identityHttpName string + +@description('Name of the Webhooks HTTP Route') +param webhooksHttpName string + +@description('Name of the WebhooksClient HTTP Route') +param webhooksclientHttpName string + +@description('The name of the Webhooks SQL Link') +param sqlWebhooksDbName string + +@description('The connection string for the event bus') +@secure() +param eventBusConnectionString string + +// CONTAINERS ----------------------------------------------------------- + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/eshop/webhooks.api:${TAG}' + env: { + PATH_BASE: '/webhooks-api' + ASPNETCORE_ENVIRONMENT: 'Development' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + OrchestratorType: ORCHESTRATOR_TYPE + AzureServiceBusEnabled: AZURESERVICEBUSENABLED + ConnectionString: sqlWebhooksDb.connectionString() + EventBusConnection: eventBusConnectionString + identityUrl: identityHttp.properties.url + IdentityUrlExternal: '${gateway.properties.url}/${identityHttp.properties.hostname}' + } + ports: { + http: { + containerPort: 80 + provides: webhooksHttp.id + } + } + } + connections: { + sql: { + source: sqlWebhooksDb.id + disableDefaultEnvVars: true + } + identity: { + source: identityHttp.id + disableDefaultEnvVars: true + } + } + } +} + + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/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}' + } + ports: { + http: { + containerPort: 80 + provides: webhooksclientHttp.id + } + } + } + connections: { + webhooks: { + source: webhooksHttp.id + } + identity: { + source: identityHttp.id + } + } + } +} + +// NETWORKING ---------------------------------------------- + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' existing = { + name: gatewayName +} + +resource identityHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: identityHttpName +} + +resource webhooksHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webhooksHttpName +} + +resource webhooksclientHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webhooksclientHttpName +} + +// LINKS ----------------------------------------------------------- + +resource sqlWebhooksDb 'Applications.Datastores/sqlDatabases@2022-03-15-privatepreview' existing = { + name: sqlWebhooksDbName +} diff --git a/reference-apps/eshop-recipes/iac/services/webshopping.bicep b/reference-apps/eshop-recipes/iac/services/webshopping.bicep new file mode 100644 index 00000000..93afb086 --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/webshopping.bicep @@ -0,0 +1,178 @@ +import radius as rad + +// PARAMETERS --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('What container orchestrator to use') +@allowed([ + 'K8S' +]) +param ORCHESTRATOR_TYPE string + +@description('Container image tag to use for eshop images') +param TAG string + +@description('Name of the Gateway') +param gatewayName string + +@description('Basket Http Route name') +param basketHttpName string + +@description('Basket gRPC Route name') +param basketGrpcName string + +@description('Ordering Http Route name') +param orderingHttpName string + +@description('Ordering gRPC Route name') +param orderingGrpcName string + +@description('Identity Http Route name') +param identityHttpName string + +@description('Catalog Http Route name') +param catalogHttpName string + +@description('Catalog gRPC Route name') +param catalogGrpcName string + +@description('Payment Http Route name') +param paymentHttpName string + +@description('Web shopping API GW HTTP Route name') +param webshoppingapigwHttpName string + +@description('Web shopping API GW HTTP Route 2 name') +param webshoppingapigwHttp2Name string + +@description('Web Shopping Aggregator Http Route name') +param webshoppingaggHttpName string + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/eshop/webshoppingagg:${TAG}' + env: { + ASPNETCORE_ENVIRONMENT: 'Development' + PATH_BASE: '/webshoppingagg' + ASPNETCORE_URLS: 'http://0.0.0.0:80' + OrchestratorType: ORCHESTRATOR_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}' + } + ports: { + http: { + containerPort: 80 + provides: webshoppingaggHttp.id + } + } + } + connections: { + identity: { + source: identityHttp.id + disableDefaultEnvVars: true + } + ordering: { + source: orderingHttp.id + disableDefaultEnvVars: true + } + catalog: { + source: catalogHttp.id + disableDefaultEnvVars: true + } + basket: { + source: basketHttp.id + disableDefaultEnvVars: true + } + } + } +} + + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/eshop-envoy:0.1.4' + ports: { + http: { + containerPort: 80 + provides: webshoppingapigwHttp.id + } + http2: { + containerPort: 8001 + provides: webshoppingapigwHttp2.id + } + } + } + } +} + +// NETWORKING ---------------------------------------------- + +resource gateway 'Applications.Core/gateways@2022-03-15-privatepreview' existing = { + name: gatewayName +} + +resource basketGrpc 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: basketGrpcName +} + +resource catalogGrpc 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: catalogGrpcName +} + +resource orderingGrpc 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderingGrpcName +} + +resource catalogHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: catalogHttpName +} + +resource basketHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: basketHttpName +} + +resource orderingHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderingHttpName +} + +resource identityHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: identityHttpName +} + +resource paymentHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: paymentHttpName +} + +resource webshoppingaggHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webshoppingaggHttpName +} + +resource webshoppingapigwHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webshoppingapigwHttpName +} + +resource webshoppingapigwHttp2 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webshoppingapigwHttp2Name +} diff --git a/reference-apps/eshop-recipes/iac/services/webstatus.bicep b/reference-apps/eshop-recipes/iac/services/webstatus.bicep new file mode 100644 index 00000000..e1e9cf9e --- /dev/null +++ b/reference-apps/eshop-recipes/iac/services/webstatus.bicep @@ -0,0 +1,142 @@ +import radius as rad + +// PARAMETERS --------------------------------------------------------- + +@description('Radius application ID') +param application string + +@description('What container orchestrator to use') +@allowed([ + 'K8S' +]) +param ORCHESTRATOR_TYPE string + +@description('Optional App Insights Key') +param APPLICATION_INSIGHTS_KEY string + +@description('Container image tag to use for eshop images') +param TAG string + +@description('Basket Http Route name') +param basketHttpName string + +@description('Ordering Http Route name') +param orderingHttpName string + +@description('Ordering SignalR Hub Http Route name') +param orderingsignalrhubHttpName string + +@description('Ordering Background Tasks Http Route name') +param orderbgtasksHttpName string + +@description('Identity Http Route name') +param identityHttpName string + +@description('Catalog Http Route name') +param catalogHttpName string + +@description('Payment Http Route name') +param paymentHttpName string + +@description('Web MVC Http Route name') +param webmvcHttpName string + +@description('Web SPA Http Route name') +param webspaHttpName string + +@description('Web Shopping Aggregator Http Route name') +param webshoppingaggHttpName string + +@description('Web Status Http Route name') +param webstatusHttpName string + +// CONTAINAERS --------------------------------------------------------- + +// 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' + properties: { + application: application + container: { + image: 'radius.azurecr.io/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: ORCHESTRATOR_TYPE + } + ports: { + http: { + containerPort: 80 + provides: webstatusHttp.id + } + } + } + } +} + +// NETWORKING ---------------------------------------------- + +resource catalogHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: catalogHttpName +} + +resource basketHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: basketHttpName +} + +resource orderingHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderingHttpName +} + +resource orderingsignalrhubHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderingsignalrhubHttpName +} + +resource orderbgtasksHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: orderbgtasksHttpName +} + +resource identityHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: identityHttpName +} + +resource paymentHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: paymentHttpName +} + +resource webmvcHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webmvcHttpName +} + +resource webspaHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webspaHttpName +} + +resource webshoppingaggHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webshoppingaggHttpName +} + +resource webstatusHttp 'Applications.Core/httpRoutes@2022-03-15-privatepreview' existing = { + name: webstatusHttpName +}