From c24b593b86acef4fbab78ccb13a3414e77e57f7f Mon Sep 17 00:00:00 2001 From: Fernando Antivero Date: Tue, 22 Feb 2022 20:06:25 +0000 Subject: [PATCH 1/8] add second fron/backend container app envs --- README.md | 74 +++++++++++++++++++++++++++--------------------------- main.bicep | 36 +++++++++++++++----------- 2 files changed, 59 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 1d39908..ff107e8 100644 --- a/README.md +++ b/README.md @@ -14,43 +14,43 @@ This repository guides you during the process of running an example application ```output - ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ - │ Azure │ │ Azure │ │ Azure │ - ┌───────────►│ Service │ │ Key Vault │ │ Container │ - │ │ Bus │ │ │ │ Registry │ - │ └─────┬───────┘ └─────────────┘ └─────────────┘ - │ │ -┌───────────│──────────────────│───────────────Azure Container App Environment────┐ -│ │ │ │ -│ │ │ │ -│ │ │ ┌─────────────┐ │ ┌─────────────┐ -│ │ │ │ │ │ │ Azure │ -│ │ │ ┌─────────────►│ Package │────────►│ MongoDb │ -│ │ │ │ │ Container │ │ │ │ -│ │ │ │ │ App │ │ └─────────────┘ -│ │ │ │ └─────────────┘ │ -│ │ │ │ │ -│ ┌───────┴─────┐ │ ┌──────┴──────┐ ┌─────────────┐ │ ┌─────────────┐ -│ │ │ │ │ │ │ Drone │ │ │ Azure │ -│ │ Ingestion │ │ │ Workflow │ │ Scheduler │ ───────►│ CosmosDb │ -│ │ Container │ └─────────►│ Container ├──────►│ Container │ │ │ │ -│ │ App │ │ App │ │ App │ │ └─────────────┘ -│ └─────────────┘ └──────┬──────┘ └─────────────┘ │ -│ │ │ -│ │ ┌─────────────┐ │ ┌─────────────┐ -│ │ │ │ │ │ Azure │ -│ │ │ Delivery │ ───────►│ Redis │ -│ └─────────────►│ Container │ │ │ Cache │ -│ │ App │ │ └─────────────┘ -│ └─────────────┘ │ -│ │ -│ │ -└─────────────────────────────────────────────────────────────────────────────────┘ - -┌───────────────────────────────────────┐┌────────────────────────────────────────┐ -│ Azure ││ Azure Monitor │ -│ Log Analytics Workspace ││ Application Insights │ -└───────────────────────────────────────┘└────────────────────────────────────────┘ + ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ + │ Azure │ │ Azure │ │ Azure │ + ┌────────────────────────────────────────►│ Service │ │ Key Vault │ │ Container │ + │ │ Bus │ │ │ │ Registry │ + │ └─────-┬──────┘ └─────────────┘ └─────────────┘ + │ │ +┌───────────│───Azure Container App Environmen Front──┐ ┌──│────────Azure Container App Environment Backend───┐ +│ │ │ │ │ │ +│ │ │ │ │ │ +│ │ │ │ │ ┌─────────────┐ │ ┌─────────────┐ +│ │ │ │ │ │ │ │ │ Azure │ +│ │ │ │ │ ┌─────────────►│ Package │────────►│ MongoDb │ +│ │ │ │ │ │ │ Container │ │ │ │ +│ │ │ │ │ │ │ App │ │ └─────────────┘ +│ │ │ │ │ │ └─────────────┘ │ +│ │ │ │ │ │ │ +│ ┌─────┴───────┐ │ │ │ ┌──────┴──────┐ ┌─────────────┐ │ ┌─────────────┐ +│ │ │ │ │ │ │ │ │ Drone │ │ │ Azure │ +│ │ Ingestion │ │ │ │ │ Workflow │ │ Scheduler │ ───────►│ CosmosDb │ +│ │ Container │ │ │ └─────────►│ Container ├──────►│ Container │ │ │ │ +│ │ App │ │ │ │ App │ │ App │ │ └─────────────┘ +│ └─────────────┘ │ │ └──────┬──────┘ └─────────────┘ │ +│ │ │ │ │ +│ │ │ │ ┌─────────────┐ │ ┌─────────────┐ +│ │ │ │ │ │ │ │ Azure │ +│ │ │ │ │ Delivery │ ───────►│ Redis │ +│ │ │ └─────────────►│ Container │ │ │ Cache │ +│ │ │ │ App │ │ └─────────────┘ +│ │ │ └─────────────┘ │ +│ │ │ │ ┌───────────────┐ +│ │ │ │ │ Azure Monitor │ +└─────────────────────────────────────────────────────┘ └─────────────────────────────────────────────────────┘ │ App Insights │ + └───────────────┘ +┌─────────────────────────────────────────────────────┐ ┌─────────────────────────────────────────────────────┐ +│ Azure │ │ Azure │ +│ Log Analytics Workspace │ │ Log Analytics Workspace │ +└─────────────────────────────────────────────────────┘ └─────────────────────────────────────────────────────┘ Workflow Service is a message consumer app, so it needs to be deployed in single revision mode, otherwise an old versions could still process a message if happen to be one that retrieves it first. ``` diff --git a/main.bicep b/main.bicep index 761f6cf..ebd6f08 100644 --- a/main.bicep +++ b/main.bicep @@ -20,11 +20,19 @@ param ingestionNamespaceSASName string param ingestionNamespaceSASKey string param ingestionQueueName string -// Drone Delivery App Environment -module env_shipping_dronedelivery 'environment.bicep' = { - name: 'env-shipping-dronedelivery' +// Drone Delivery App Environment Ingestion +module env_shipping_dronedelivery_front 'environment.bicep' = { + name: 'env-shipping-dronedelivery-front' params: { - environmentName: 'shipping-dronedelivery' + environmentName: 'shipping-dronedelivery-front' + } +} + +// Drone Delivery App Environment Backend Services +module env_shipping_dronedelivery_backend 'environment.bicep' = { + name: 'env-shipping-dronedelivery-backend' + params: { + environmentName: 'shipping-dronedelivery-backend' } } @@ -33,8 +41,8 @@ module ca_delivery 'container-http.bicep' = { name: 'ca-delivery' params: { location: resourceGroup().location - containerAppName: 'delivery-app' - environmentId: env_shipping_dronedelivery.outputs.id + containerAppName: 'ca-delivery-svc' + environmentId: env_shipping_dronedelivery_backend.outputs.id containerImage: '${acrSever}/shipping/delivery:0.1.0' containerPort: 8080 isExternalIngress: false @@ -97,8 +105,8 @@ module ca_dronescheduler 'container-http.bicep' = { name: 'ca-dronescheduler' params: { location: resourceGroup().location - containerAppName: 'dronescheduler-app' - environmentId: env_shipping_dronedelivery.outputs.id + containerAppName: 'ca-dronescheduler-svc' + environmentId: env_shipping_dronedelivery_backend.outputs.id containerImage: '${acrSever}/shipping/dronescheduler:0.1.0' containerPort: 8080 isExternalIngress: false @@ -177,8 +185,8 @@ module ca_workflow 'container-http.bicep' = { name: 'ca-workflow' params: { location: resourceGroup().location - containerAppName: 'workflow-app' - environmentId: env_shipping_dronedelivery.outputs.id + containerAppName: 'ca-workflow-svc' + environmentId: env_shipping_dronedelivery_backend.outputs.id containerImage: '${acrSever}/shipping/workflow:0.1.0' revisionMode: 'single' containerRegistry: acrSever @@ -276,8 +284,8 @@ module ca_package 'container-http.bicep' = { name: 'ca-package' params: { location: resourceGroup().location - containerAppName: 'package-app' - environmentId: env_shipping_dronedelivery.outputs.id + containerAppName: 'ca-package-svc' + environmentId: env_shipping_dronedelivery_backend.outputs.id containerImage: '${acrSever}/shipping/package:0.1.0' containerPort: 80 isExternalIngress: false @@ -328,8 +336,8 @@ module ca_ingestion 'container-http.bicep' = { name: 'ca-ingestion' params: { location: resourceGroup().location - containerAppName: 'ingestion-app' - environmentId: env_shipping_dronedelivery.outputs.id + containerAppName: 'ca-ingestion-svc' + environmentId: env_shipping_dronedelivery_front.outputs.id containerImage: '${acrSever}/shipping/ingestion:0.1.0' containerPort: 80 cpu: '1' From ea486ee12cac99a2eeb38e08519e73acd5bc53fb Mon Sep 17 00:00:00 2001 From: Fernando Antivero Date: Tue, 22 Feb 2022 20:36:31 +0000 Subject: [PATCH 2/8] normalize a bit the namings --- main.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.bicep b/main.bicep index ebd6f08..33c8ea4 100644 --- a/main.bicep +++ b/main.bicep @@ -20,7 +20,7 @@ param ingestionNamespaceSASName string param ingestionNamespaceSASKey string param ingestionQueueName string -// Drone Delivery App Environment Ingestion +// Drone Delivery App Environment Frontend module env_shipping_dronedelivery_front 'environment.bicep' = { name: 'env-shipping-dronedelivery-front' params: { From 04808b3cb07f7c21973a4c239e09b1fa1359978e Mon Sep 17 00:00:00 2001 From: Fernando Antivero Date: Tue, 22 Feb 2022 22:14:40 +0000 Subject: [PATCH 3/8] updating the expected results in terms of resources --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff107e8..d871edb 100644 --- a/README.md +++ b/README.md @@ -94,9 +94,9 @@ Following the steps below will result in the creation of the following Azure res | An Azure Service Bus | Ingestion and Workflow services communicate using Azure Service Bus queues | | An Azure Application Insights instance | All services are sending trace information to a shared Azure Application Insights instance | | An Azure Container Registry | This is the private container registry where all Fabrikam workload images are uploaded and later pulled from the different Azure Container Apps | -| An Azure Container App Environment | This is the managed Container App environment where Container Apps are deployed | +| Two Azure Container App Environments | Two separated environments are created, one for a containarized public rest api and one for backend compaonents. Container Apps are deployed to one or the another environment respectively. | | Five Azure Container Apps | These are the Azure resources that represents the five Fabrikam microservices in the Azure Container App environment | -| An Azure Log Analytics Workspace | This is where all the Container Apps logs are sent | +| Two Azure Log Analytics Workspaces | Adding one per Container App Environment. This is where all the Container Apps logs are sent | ## Clone the repository From 5f93bb021f2687dd53922b5cf0961c5ed7dca2ee Mon Sep 17 00:00:00 2001 From: Fernando Antivero Date: Thu, 24 Feb 2022 12:15:43 +0000 Subject: [PATCH 4/8] Address PR Feedback: add consistency around naminings --- main.bicep | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.bicep b/main.bicep index 33c8ea4..c1cf753 100644 --- a/main.bicep +++ b/main.bicep @@ -21,10 +21,10 @@ param ingestionNamespaceSASKey string param ingestionQueueName string // Drone Delivery App Environment Frontend -module env_shipping_dronedelivery_front 'environment.bicep' = { - name: 'env-shipping-dronedelivery-front' +module env_shipping_dronedelivery_frontend 'environment.bicep' = { + name: 'env-shipping-dronedelivery-frontend' params: { - environmentName: 'shipping-dronedelivery-front' + environmentName: 'shipping-dronedelivery-frontend' } } @@ -337,7 +337,7 @@ module ca_ingestion 'container-http.bicep' = { params: { location: resourceGroup().location containerAppName: 'ca-ingestion-svc' - environmentId: env_shipping_dronedelivery_front.outputs.id + environmentId: env_shipping_dronedelivery_frontend.outputs.id containerImage: '${acrSever}/shipping/ingestion:0.1.0' containerPort: 80 cpu: '1' From 8918e207b3c6dbb150996c96c31aae8514dcade4 Mon Sep 17 00:00:00 2001 From: Fernando Antivero Date: Thu, 24 Feb 2022 12:16:03 +0000 Subject: [PATCH 5/8] remove reference to single environment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d871edb..ff3139f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Azure Container Apps is a new cloud native serverless managed service that is ju ## Migrating a microservices workload from AKS to Azure Container Apps -This repository guides you during the process of running an example application composed of microservices in Azure Container Apps. In this example scenario, the Fabrikam Drone Delivery app that was previously running in Azure Kubernetes Services will be run in a newly created Azure Container App environment. This Azure managed service is optimized for running applications that span many microservices. This example will make some containers internet-facing via an HTTPS ingress, and internally accessible thanks to its built-in DNS-based service discovery capability. Additionally, it will manage their secrets in a secure manner. +This repository guides you during the process of running an example application composed of microservices in Azure Container Apps. In this example scenario, the Fabrikam Drone Delivery app that was previously running in Azure Kubernetes Services will be run in two Azure Container App environments. This Azure managed service is optimized for running applications that span many microservices. This example will make some containers internet-facing via an HTTPS ingress, and internally accessible thanks to its built-in DNS-based service discovery capability. Additionally, it will manage their secrets in a secure manner. ```output From 0060ab90a2c41affd38183526c64dc0d9addda67 Mon Sep 17 00:00:00 2001 From: Fernando Antivero Date: Fri, 25 Feb 2022 18:48:49 -0300 Subject: [PATCH 6/8] topic (narratives): update intro to incorporate the idea of two environments (#15) * adds why multiple environments narrative * Apply PR Feedback: improving wording, fixing typos and other contribs. Co-authored-by: Catherine Bundy <23391945+cebundy@users.noreply.github.com> --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff3139f..12813c3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ Fabrikam inc has created a new operations team, and under its organization there is a brown field app called [Drone Delivery](https://github.com/mspnp/fabrikam-dronedelivery-workload/tree/beb2c60f9450ce04038fb95aa0110ab4143fc76a). This application been running for a while in [AKS (Kubernetes)](https://github.com/mspnp/microservices-reference-implementation), and while they are huge fans of containers to build microservices and K8s, it has been discovered that it is not making use of any of the advance features like custom Service Mesh or Autoscaling among others. -The team has detected an opportunity to be more efficient at the devops level, and this is why they are now looking into a new fully managed Container App service to experiment with Fabrikam Drone Delivery. This will allow them to publish and run containarized microservices at scale, faster than before, reducing the complexity, saving resources by using scale to `0` built-in autoscaling capability, and without losing all the container advantages they love. +The team has detected an opportunity to be more efficient at the DevOps level, and this is why they are now looking into a new fully managed Container App service to experiment with Fabrikam Drone Delivery. This will allow them to publish and run containerized microservices at scale faster than before while reducing the complexity, saving resources by using scale to `0` built-in autoscaling capability, and without losing all the container advantages they love. + +Fabrikam Drone Delivery does not require external and internal services to be seated SxS, since they neither communicate directly with each other or share resources such as compute and/or memory. The development team has implemented a publish & subscribe pattern to loosely couple internet-facing rest apis from all underlying services. Thanks to simplicity introduced by Azure Container Apps, it is now easier than ever to deploy the solution with a clear separation of concerns between Frontend and Backend by using multiple Container App Environments. Additionally, the team is envisioning that this also might contribute to laying down a better network topology by using a custom VNET in the future. Azure Container Apps is a new cloud native serverless managed service that is just using AKS with KEDA behind the scenes to deploy and run containerized applications. @@ -340,5 +342,5 @@ az containerapp revision restart -g rg-shipping-dronedelivery --app Date: Fri, 25 Feb 2022 21:52:12 +0000 Subject: [PATCH 7/8] improve diagram --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 12813c3..4e6eb20 100644 --- a/README.md +++ b/README.md @@ -18,26 +18,26 @@ This repository guides you during the process of running an example application ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ Azure │ │ Azure │ │ Azure │ - ┌────────────────────────────────────────►│ Service │ │ Key Vault │ │ Container │ - │ │ Bus │ │ │ │ Registry │ - │ └─────-┬──────┘ └─────────────┘ └─────────────┘ - │ │ -┌───────────│───Azure Container App Environmen Front──┐ ┌──│────────Azure Container App Environment Backend───┐ -│ │ │ │ │ │ -│ │ │ │ │ │ -│ │ │ │ │ ┌─────────────┐ │ ┌─────────────┐ -│ │ │ │ │ │ │ │ │ Azure │ -│ │ │ │ │ ┌─────────────►│ Package │────────►│ MongoDb │ -│ │ │ │ │ │ │ Container │ │ │ │ -│ │ │ │ │ │ │ App │ │ └─────────────┘ -│ │ │ │ │ │ └─────────────┘ │ -│ │ │ │ │ │ │ -│ ┌─────┴───────┐ │ │ │ ┌──────┴──────┐ ┌─────────────┐ │ ┌─────────────┐ -│ │ │ │ │ │ │ │ │ Drone │ │ │ Azure │ -│ │ Ingestion │ │ │ │ │ Workflow │ │ Scheduler │ ───────►│ CosmosDb │ -│ │ Container │ │ │ └─────────►│ Container ├──────►│ Container │ │ │ │ -│ │ App │ │ │ │ App │ │ App │ │ └─────────────┘ -│ └─────────────┘ │ │ └──────┬──────┘ └─────────────┘ │ + ┌──────────────────────────────────────────►│ Service │ │ Key Vault │ │ Container │ + │ │ Bus │ │ │ │ Registry │ + │ └─────-┬──────┘ └─────────────┘ └─────────────┘ + │ │ +┌─────────│─Azure Container App Environment Frontend──┐ ┌──│────────Azure Container App Environment Backend───┐ +│ │ │ │ │ │ +│ │ │ │ │ │ +│ │ │ │ │ ┌─────────────┐ │ ┌─────────────┐ +│ │ │ │ │ │ │ │ │ Azure │ +│ │ │ │ │ ┌─────────────►│ Package │────────►│ MongoDb │ +│ │ │ │ │ │ │ Container │ │ │ │ +│ │ │ │ │ │ │ App │ │ └─────────────┘ +│ │ │ │ │ │ └─────────────┘ │ +│ │ │ │ │ │ │ +│ ┌─────┴───────┐ │ │ │ ┌──────┴──────┐ ┌─────────────┐ │ ┌─────────────┐ +│ │ │ │ │ │ │ │ │ Drone │ │ │ Azure │ +│ │ Ingestion │ │ │ │ │ Workflow │ │ Scheduler │ ───────►│ CosmosDb │ +│ │ Container │ │ │ └─────────►│ Container ├──────►│ Container │ │ │ │ +│ │ App │ │ │ │ App │ │ App │ │ └─────────────┘ +│ └─────────────┘ │ │ └──────┬──────┘ └─────────────┘ │ │ │ │ │ │ │ │ │ │ ┌─────────────┐ │ ┌─────────────┐ │ │ │ │ │ │ │ │ Azure │ From ae146f47665d6f20560155c6e1fe4ab00db6a13b Mon Sep 17 00:00:00 2001 From: Fernando Antivero Date: Fri, 25 Feb 2022 22:26:58 +0000 Subject: [PATCH 8/8] add another benefit of having multiple environments for legacy app being migrated --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e6eb20..e54a606 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,11 @@ Fabrikam inc has created a new operations team, and under its organization there The team has detected an opportunity to be more efficient at the DevOps level, and this is why they are now looking into a new fully managed Container App service to experiment with Fabrikam Drone Delivery. This will allow them to publish and run containerized microservices at scale faster than before while reducing the complexity, saving resources by using scale to `0` built-in autoscaling capability, and without losing all the container advantages they love. -Fabrikam Drone Delivery does not require external and internal services to be seated SxS, since they neither communicate directly with each other or share resources such as compute and/or memory. The development team has implemented a publish & subscribe pattern to loosely couple internet-facing rest apis from all underlying services. Thanks to simplicity introduced by Azure Container Apps, it is now easier than ever to deploy the solution with a clear separation of concerns between Frontend and Backend by using multiple Container App Environments. Additionally, the team is envisioning that this also might contribute to laying down a better network topology by using a custom VNET in the future. +Fabrikam Drone Delivery has two different dev teams, one is dedicated to Frontend while the other one is fully focused in the backend. Frontend services are external endpoints that can be reached by their clients, and do not require to be seated SxS with backend services, since they neither communicate directly with each other or share resources such as compute and/or memory. The development teams have implemented a publish & subscribe pattern to loosely couple internet-facing rest apis from all underlying services. This allows to keep all backend services remain internal to the organization. Thanks to simplicity introduced by Azure Container Apps, it is now easier than ever to deploy the solution with a clear separation of concerns between Frontend and Backend by using multiple Container App Environments. Additionally, the team is envisioning that this also might contribute to laying down a better network topology by using a custom VNET in the future. + +The operations team is ready to execute a migration plan but they know it is not an easy task. Managing multiple environments will be really convenient, since it is enabling the possibility to start experimenting with one Azure Container Environment at the time, while the another one stays in AKS (Kubernetes) until the new infrastracture gets stabilized. Once the team feels confident, they will proceed with the subsequent environments, and it will be just mater of enrounting the traffic properly. + +Additionally, it has been evaluated the possiblity of having Azure App Service in the FrontEnd, but they know that sooner rather than later the Frontend dev team will populate its Azure Container App Environment with many services, and they will need to scale individually. Azure Container Apps is a new cloud native serverless managed service that is just using AKS with KEDA behind the scenes to deploy and run containerized applications.