Skip to content

Commit

Permalink
refinements on wording (#156)
Browse files Browse the repository at this point in the history
## Purpose

## Does this introduce a breaking change?
<!-- Mark one with an "x". -->
```
[ ] Yes
[x] No
```

## Pull Request Type
What kind of change does this Pull Request introduce?

<!-- Please check the one that applies to this PR using "x". -->
```
[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Documentation content changes
[ ] Other... Please describe:
```
  • Loading branch information
sonwan2020 authored Dec 17, 2024
1 parent a257fca commit 5218808
Show file tree
Hide file tree
Showing 25 changed files with 72 additions and 70 deletions.
2 changes: 1 addition & 1 deletion docs/01_lab_plan/0102.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: '2. Consider Azure compute services'
title: '2. Azure services used'
layout: default
nav_order: 2
parent: 'Lab 1: Plan the microservices to Azure'
Expand Down
4 changes: 2 additions & 2 deletions docs/01_lab_plan/0105.md → docs/01_lab_plan/0103.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: '5. Tooling'
title: '3. Tooling'
layout: default
nav_order: 5
nav_order: 3
parent: 'Lab 1: Plan the microservices to Azure'
---

Expand Down
2 changes: 1 addition & 1 deletion docs/02_lab_launch/0201.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: '1. User info'
title: '1. User information'
layout: default
nav_order: 1
parent: 'Lab 2: Launch to Azure Container Apps'
Expand Down
16 changes: 8 additions & 8 deletions docs/02_lab_launch/0202.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: '2. Create ACA Environment'
title: '2. Container Apps Environment'
layout: default
nav_order: 2
parent: 'Lab 2: Launch to Azure Container Apps'
---

# Create an Azure Container Apps environment
# Create an Azure Container Apps Environment

As a first step you will need to create your Azure Container Apps (ACA) environment. Make sure you also pre-create the virtual network for your ACA service. This will make it easier in the following labs to add additional networking features. You can use the following guidance:
As a first step you will need to create your Azure Container Apps environment. Make sure you also pre-create the virtual network for your Azure Container Apps service. This will make it easier in the following labs to add additional networking features. You can use the following guidance:

- [Guidance on ACA environment and app creation](https://learn.microsoft.com/azure/container-apps/tutorial-deploy-first-app-cli?tabs=bash)
- [Tutorial: Deploy your first container app](https://learn.microsoft.com/azure/container-apps/tutorial-deploy-first-app-cli?tabs=bash)

## Step by step guidance

Expand All @@ -31,7 +31,7 @@ As a first step you will need to create your Azure Container Apps (ACA) environm
{: .note }
> This lab uses quite some environment variables. In case you are using a codespace for running this lab, your environment variables will be lost if the codespace restarts. You can find a couple of methods for persisting these environment variables across codespace restarts in the [LabTips]({% link tips.md %}).
1. Create a virtual network and subnet for your ACA.
1. Create a virtual network and subnet for your Container Apps environment.

```bash
VIRTUAL_NETWORK_NAME=vnet-$APPNAME-$UNIQUEID
Expand All @@ -50,13 +50,13 @@ As a first step you will need to create your Azure Container Apps (ACA) environm
--delegations Microsoft.App/environments
```

1. You will need the ID of this subnet when you create the ACA environment.
1. You will need the ID of this subnet when you create the Container Apps environment.

```bash
SUBNET_ID=$(az network vnet subnet show --resource-group $RESOURCE_GROUP --vnet-name $VIRTUAL_NETWORK_NAME --name aca-subnet --query id -o tsv)
```

1. Create your ACA environment and link it to the subnet you just created. We will be creating the environment in the dedicated plan. This plan is also called `workload profiles` plan. This plan gives you more advanced features as opposed to the consumption plan. In this plan you can choose whether you want to run your workload on dedicated hardware or consumption based. It basically gives you the choice.
1. Create your Container Apps Environment and link it to the subnet you just created. We will be creating the environment in the dedicated plan. This plan is also called `workload profiles` plan. This plan gives you more advanced features as opposed to the consumption plan. In this plan you can choose whether you want to run your workload on dedicated hardware or consumption based. It basically gives you the choice.

```bash
ACA_ENVIRONMENT=acalab-env-$APPNAME-$UNIQUEID
Expand Down Expand Up @@ -87,4 +87,4 @@ As a first step you will need to create your Azure Container Apps (ACA) environm
> In case you don't see the container apps environment in the overview list of the resource group, hit the <kbd>Refresh</kbd> button a couple of times, until they show up.
{: .note }
> You may also notice an additional resource group in your subscription, which name will start with ME_. This resource group got created by the ACA creation process. It holds the resources of the vnet and your ACA environment. For learning purposes it might be good to check this resource group from time to time and to see what got created there.
> You may also notice an additional resource group in your subscription, which name will start with ME_. This resource group got created by the Azure Container Apps Environment creation process. It holds the resources of the vnet and your environment. For learning purposes it might be good to check this resource group from time to time and to see what got created there.
8 changes: 4 additions & 4 deletions docs/02_lab_launch/0203.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ parent: 'Lab 2: Launch to Azure Container Apps'

# Create an Azure MySQL Database service

You now have the compute service that will host your applications. Before you start deploying individual microservices as Azure Container Apps, you need to first create an Azure Database for MySQL Flexible Server-hosted database for them. To accomplish this, you can use the following guidance:
You now have the compute service that will host your applications. Before you start deploying individual microservices as container apps, you need to first create an Azure Database for MySQL Flexible Server-hosted database for them. To accomplish this, you can use the following guidance:

- [Quickstart: Create an Azure Database for MySQL Flexible Server using Azure CLI](https://learn.microsoft.com/azure/mysql/flexible-server/quickstart-create-server-cli).

Your MySQL database will also have a firewall enabled. This firewall will by default block all incoming calls. You will need to open this firewall in case you want to connect to it from your microservices running in the ACA environment.
Your MySQL database will also have a firewall enabled. This firewall will by default block all incoming calls. You will need to open this firewall in case you want to connect to it from your microservices running in the Container Apps environment.

## Step by step guidance

1. Run the following commands to create an instance of MySQL Flexible server. Note that the name of the server must be globally unique, so adjust it accordingly in case the randomly generated name is already in use. Keep in mind that the name can contain only lowercase letters, numbers and hyphens. In addition, replace the `<sqladmin-password>` placeholder with a complex password and record its value.

{: .note }
> Here we use mysql admin password for apps to connect to sql server, this is not recommanded in production environment. Please refer to [Lab 04: Connect to Database securely using identity]({% link docs/04_lab_secrets/04_openlab_secrets_aca.md %}) for the secured managed identity solution.
> Here we use mysql admin password for apps to connect to sql server, this is not recommanded in production environment. Please refer to [Lab 04: Connect to database securely using identity]({% link docs/04_lab_secrets/04_openlab_secrets_aca.md %}) for the secured managed identity solution.
Replace the `<sqladmin-password>` with your own password.

Expand Down Expand Up @@ -52,7 +52,7 @@ Your MySQL database will also have a firewall enabled. This firewall will by def
-d $DATABASE_NAME
```

1. You will also need to allow connections to the server from your ACA environment. For now, you will create a server firewall rule to allow inbound traffic from all Azure Services.
1. You will also need to allow connections to the server from your Container Apps environment. For now, you will create a server firewall rule to allow inbound traffic from all Azure Services.

Check the status of your sql server
![SQL Server Networking](../../images/sql-server-manage-firewall.png)
Expand Down
2 changes: 1 addition & 1 deletion docs/02_lab_launch/0204.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: '4. Config repo'
title: '4. Config repository'
layout: default
nav_order: 4
parent: 'Lab 2: Launch to Azure Container Apps'
Expand Down
8 changes: 4 additions & 4 deletions docs/02_lab_launch/0205.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parent: 'Lab 2: Launch to Azure Container Apps'

# Create the java components for your config and discovery server

As a next step, you will configure some of the Spring Cloud components on your ACA environment, like the config server and the discovery server. These are available as build-in components on ACA. You can follow the below guidance to do so.
As a next step, you will configure some of the Spring Cloud components on your Container Apps environment, like the config server and the discovery server. These are available as build-in components on Container Apps Environment. You can follow the below guidance to do so.

- [Tutorial: Connect to a managed Config Server for Spring in Azure Container Apps](https://learn.microsoft.com/azure/container-apps/java-config-server)
- [Tutorial: Connect to a managed Eureka Server for Spring in Azure Container Apps](https://learn.microsoft.com/azure/container-apps/java-eureka-server)
Expand Down Expand Up @@ -35,7 +35,7 @@ As a next step, you will configure some of the Spring Cloud components on your A
--name $JAVA_CONFIG_COMP_NAME
```

1. As a next step you now create the Spring Cloud Eureka Java component. This will create a standard eureka or discovery endpoint within your ACA environment for your Java microservices to use.
1. As a next step you now create the Spring Cloud Eureka Java component. This will create a standard eureka or discovery endpoint within your Container Apps environment for your Java microservices to use.

```bash
JAVA_EUREKA_COMP_NAME=eureka
Expand All @@ -61,9 +61,9 @@ As a next step, you will configure some of the Spring Cloud components on your A

1. Check the managed components in Azure Container Apps environment from portal.

In your browser, navigate to the Azure Portal and your Container Apps Environment, open Services > Services, you may see the components you just created.
In your browser, navigate to the Azure Portal and your Container Apps environment, open Services > Services, you may see the components you just created.

![managed components](../../images/managed-components.png)

{: .note }
> Azure Container Apps also has an internal naming mechanism for microservices to call into each other. The usage of the Eureka component is handy in case you are migrating an existing spring cloud application and you want to keep leveraging your current naming mechanism between microservices. In other cases you might use the internal naming mechanism ACA is already providing you.
> Azure Container Apps also has an internal naming mechanism for microservices to call into each other. The usage of the Eureka component is handy in case you are migrating an existing spring cloud application and you want to keep leveraging your current naming mechanism between microservices. In other cases you might use the internal naming mechanism Container Apps is already providing you.
8 changes: 4 additions & 4 deletions docs/02_lab_launch/0206.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: '6. Acr and Managed Identity'
title: '6. Container Registry and Managed Identity'
layout: default
nav_order: 6
parent: 'Lab 2: Launch to Azure Container Apps'
---

# Prepare Azure Container Registry and Managed Identity for the applications

Before deploy the microservices application as Container Apps instance to Azure Container Apps environment, you will need an Azure Container Registry (ACR) instance to build and save your application images. And you will allow the new Container Apps instances to pull images from the ACR. In this step, we create a user Managed Identity (MI), assign required privilege to the MI, and in the next step the new container apps can pull images from ACR with this MI.
Before deploy the microservices application as Container Apps instance to Azure Container Apps environment, you will need an Azure Container Registry instance to build and save your application images. And you will allow the new Container Apps instances to pull images from the ACR. In this step, we create a user Managed Identity (MI), assign required privilege to the MI, and in the next step the new container apps can pull images from ACR with this MI.

* [Azure Container Registry](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-intro) to save the build images
* [Managed Identity](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview) for secure connection between apps and ACR, SQL server etc.
* [Managed Identity](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview) for secure connection between apps and Container Registry, SQL server etc.

## Step by step guidance

1. Create a Azure Container Registry (ACR) instance to build and save your container images.
1. Create a Azure Container Registry instance to build and save your container images.

```bash
MYACR=acr$APPNAME$UNIQUEID
Expand Down
5 changes: 3 additions & 2 deletions docs/02_lab_launch/0207.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: '7. Deploy app'
title: '7. Deploy applications'
layout: default
nav_order: 7
parent: 'Lab 2: Launch to Azure Container Apps'
---

# Deploy the microservices to Azure Container Apps

You now have an ACA environment deployed in your resource group and it has been enabled with some of the internal components. You are now ready to deploy your microservices to your ACA environment.
You now have a Container Apps environment deployed in your resource group and it has been enabled with some of the internal components. You are now ready to deploy your microservices to your environment.

You will first get the sample code from upstream git repository, build the projects to generate the jar file for each application. Then you will prepare the `Dockerfile` to build container image.

Expand All @@ -34,6 +34,7 @@ Azure Container Apps can collect JVM metrics for java applications, see [Java me
FROM mcr.microsoft.com/openjdk/jdk:17-distroless
# Prepare the Application Insights Java agent
# This is optional for Lab 2. It's prepared for the Application Insights monitoring in Lab 3.
ARG AI_VERSION=3.6.2
ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/$AI_VERSION/applicationinsights-agent-$AI_VERSION.jar /applicationinsights-agent.jar
Expand Down
8 changes: 4 additions & 4 deletions docs/02_lab_launch/02_openlab_setup_aca.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ has_children: true

## Lab scenario

You have a general description about the microservice application. It is time to launch the components to Azure Container Apps (ACA).
You have a general description about the microservice application. It is time to launch the components to Azure Container Apps.

## Objectives

Expand All @@ -20,8 +20,8 @@ After you complete this lab, you will be able to:
- Create an Azure Container Apps environment
- Set up a configuration repository
- Create an Azure MySQL Database service
- Create the ACA managed java components for your services
- Deploy the microservices of the Spring Petclinic app to ACA and bind them to managed java components
- Create the Container Apps Environment managed java components for your services
- Deploy the microservices of the Spring Petclinic applications to Azure Container Apps environment and bind them to managed java components
- Test the application through the publicly available endpoint

The below image illustrates the end state you will be building in this lab.
Expand All @@ -30,7 +30,7 @@ The below image illustrates the end state you will be building in this lab.

## Lab Duration

- **Estimated Time**: 120 minutes
- **Estimated Time**: 60 minutes

{: .note }
> The Azure-Samples/java-microservices-aca-lab repository contains a dev container for Java development. This container contains all the needed tools for running this lab. In case you want to use this dev container you can either use a [GitHub CodeSpace](https://github.com/features/codespaces) in case your GitHub account is enabled for Codespaces. Or you can use the [Visual Studio Code Remote Containers option](https://code.visualstudio.com/docs/remote/containers). You can find all steps to get this set up in the [installation instructions]({% link install.md %}).
5 changes: 2 additions & 3 deletions docs/03_lab_monitor/0301.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ parent: 'Lab 3: Enable monitoring'

# Inspect your Azure Container Apps in the Azure Portal

By default the Azure Portal already gives you quite some info on the current status of the ACA instance. In this first part of this module, open the Azure Portal, navigate to one of your ACA instances and inspect what info you can find on the instance. Try and find information on:
By default the Azure Portal already gives you quite some info on the current status of the Container Apps instance. In this first part of this module, open the Azure Portal, navigate to one of your Container Apps instances and inspect what info you can find on the instance. Try and find information on:

- The ACA revison status.
- The container apps revison status.
- The live logs (console and system) of the `customers-service`.

You can follow the below guidance to do so.

- [log streams in Azure Container Apps](https://learn.microsoft.com/azure/container-apps/log-streaming?tabs=bash)


## Step by step guidance

1. In your browser navigate to the Azure Portal, and to the resource group where you deployed your Azure Container Apps environment. Select the customers-service container app.
Expand Down
6 changes: 3 additions & 3 deletions docs/03_lab_monitor/0302.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: '2. ACA monitoring'
title: '2. Log Analytics'
layout: default
nav_order: 2
parent: 'Lab 3: Enable monitoring'
---

# Configure Azure Container Apps environment monitoring
# Set Log Analytics to Azure Container Apps environment

Point in time info of your application is nice, however, it is also beneficial to have overall monitoring data available. For this you can enable logs on your Azure Container Apps environment. Container Apps application logs consist of two different categories:

Expand Down Expand Up @@ -44,7 +44,7 @@ Enable logging on your Azure Container Apps environment. You can follow the belo
--logs-workspace-key $WORKSPACE_KEY
```

1. To verify that monitoring data is available in your Log Analytics workspace, in your browser, navigate to your ACA instance in the Azure Portal. Under `Monitoring`, select `Logs`. You can inspect here the monitoring data in your app. If you double click `ContainerAppConsoleLogs_CL` or `ContainerAppSystemLogs_CL` and press `Run`, it will show you the data in this log table.
1. To verify that monitoring data is available in your Log Analytics workspace, in your browser, navigate to your container apps instance in the Azure Portal. Under `Monitoring`, select `Logs`. You can inspect here the monitoring data in your app. If you double click `ContainerAppConsoleLogs_CL` or `ContainerAppSystemLogs_CL` and press `Run`, it will show you the data in this log table.

Get logs for all apps

Expand Down
Loading

0 comments on commit 5218808

Please sign in to comment.