1. Run Azd Command to deploy
Run azd up
to deploy the petclinic solution and dependent components to Azure Container App
Step by step guidance
-
Run
azd up
- fill your environment name.
- select the target subscription
- select the target region
This command will create these components to your environment:
- Resource Group
- Virtual Network with subnets
- Log Analytics Workspace
- Azure Container Apps environment
- Managed components in ACA environment: SpringCloudEureka / SpringCloudConfig / SpringBootAdmin
- MySQL flexibleServers
- The petclinic solution apps api-gateway, admin-server, customer-service, vets-service, visits-service
You can view detailed progress in the Azure Portal: xxx Open the link to check the deployment status in portal
You may encounter some failures during the deploy, fix the errors according to the deployment status. If there are internal errors, please re-run the
azd up
commands to redeploy. -
Run rebuild service connection from apps to sql database Due to some limitation, the bicep won’t create database user for the service connections, See Lab 4 step 2.
Run the commands below to create the db user
CLIENT_ID=$(az identity show --resource-group $RESOURCE_GROUP --name $ACA_IDENTITY --query 'clientId' --output tsv) echo $CLIENT_ID az containerapp connection create mysql-flexible \ --connection mysql_conn \ --source-id $CUSTOMERS_ID \ --target-id $DB_ID \ --client-type SpringBoot \ --user-identity client-id=$CLIENT_ID subs-id=$SUBID mysql-identity-id=$ADMIN_IDENTITY_RESOURCE_ID \ -c customers-service
Only one command required for this solution:
- The apps share the same connection name, so same user name in db.
- Once the user name is set, your don’t have to recreate it.
-
Verify
- visit the api-gateway Application Url
- visit the admin-server Application Url