diff --git a/00-setup-your-environment/azuredeploy.json b/00-setup-your-environment/azuredeploy.json index 0d87c30..c3651c4 100644 --- a/00-setup-your-environment/azuredeploy.json +++ b/00-setup-your-environment/azuredeploy.json @@ -28,28 +28,27 @@ }, "resources": [ { - "type": "Microsoft.DBforMySQL/servers", - "apiVersion": "2017-12-01", + "type": "Microsoft.DBForMySql/flexibleServers", + "apiVersion": "2023-06-30", "name": "[parameters('db_for_mysql_name')]", "location": "[parameters('location')]", "sku": { - "name": "B_Gen5_1", - "tier": "Basic", - "family": "Gen5", - "capacity": 1 + "name": "Standard_B1ms", + "tier": "Burstable" }, "properties": { "administratorLogin" : "sqlAdmin", "administratorLoginPassword" : "[parameters('mysql_admin_password')]", "createMode" : "Default", - "storageProfile": { - "storageMB": 5120, - "backupRetentionDays": 7, - "geoRedundantBackup": "Disabled", - "storageAutoGrow": "Enabled" + "storage": { + "storageSizeGB": 20, + "iops": 360, + "autoGrow": "Enabled", + "autoIoScaling": "Enabled", + "logOnDisk": "Disabled", + "storageRedundancy": "LocalRedundancy" }, - "version": "5.7", - "sslEnforcement": "Enabled" + "version": "8.0.21" } }, { diff --git a/07-build-a-spring-boot-microservice-using-mysql/README.md b/07-build-a-spring-boot-microservice-using-mysql/README.md index 5f31e91..4fac8fe 100644 --- a/07-build-a-spring-boot-microservice-using-mysql/README.md +++ b/07-build-a-spring-boot-microservice-using-mysql/README.md @@ -28,29 +28,29 @@ Before we can use it however, we will need to perform several tasks: > 💡When prompted for a password, enter the MySQL password you specified when deploying the ARM template in [Section 00](../00-setup-your-environment/README.md). ```bash -# Obtain the info on the MYSQL server in our resource group: -export MYSQL_SERVERNAME=$(az mysql server list --query '[0].name' -o tsv) -export MYSQL_USERNAME="$(az mysql server list --query '[0].administratorLogin' -o tsv)@${MYSQL_SERVERNAME}" -export MYSQL_HOST="$(az mysql server list --query '[0].fullyQualifiedDomainName' -o tsv)" +# Obtain the info on the MYSQL flexible server in our resource group: +export MYSQL_SERVERNAME=$(az mysql flexible-server list --query '[0].name' -o tsv) +export MYSQL_USERNAME="$(az mysql flexible-server list --query '[0].administratorLogin' -o tsv)@${MYSQL_SERVERNAME}" +export MYSQL_HOST="$(az mysql flexible-server list --query '[0].fullyQualifiedDomainName' -o tsv)" # Create a firewall rule to allow connections from your machine: export MY_IP=$(curl whatismyip.akamai.com 2>/dev/null) -az mysql server firewall-rule create \ - --server-name $MYSQL_SERVERNAME \ - --name "connect-from-lab" \ +az mysql flexible-server firewall-rule create \ + --name $MYSQL_SERVERNAME \ + --rule-name "connect-from-lab" \ --start-ip-address "$MY_IP" \ --end-ip-address "$MY_IP" # Create a firewall rule to allow connections from Azure services: -az mysql server firewall-rule create \ - --server-name $MYSQL_SERVERNAME \ - --name "connect-from-azure" \ +az mysql flexible-server firewall-rule create \ + --name $MYSQL_SERVERNAME \ + --rule-name "connect-from-azure" \ --start-ip-address "0.0.0.0" \ --end-ip-address "0.0.0.0" # Create a MySQL database -az mysql db create \ - --name "azure-spring-apps-training" \ +az mysql flexible-server db create \ + --database-name "azure-spring-apps-training" \ --server-name $MYSQL_SERVERNAME # Display MySQL username (to be used in the next section) @@ -68,7 +68,7 @@ In the [Azure Portal](https://portal.azure.com/?WT.mc_id=java-0000-judubois): - Click on `weather-service`. - Click on `Service Connector` and then on `+ Create`. - Populate the Service Connector fields as shown: - - For Service type, select `DB for MySQL single server` + - For Service type, select `DB for MySQL flexible server` - Specify a connection name, e.g. "weatherdb" - Verify the correct subscription is shown - Choose the MySQL server created in the preceding steps diff --git a/07-build-a-spring-boot-microservice-using-mysql/media/01-create-service-connector-mysql.png b/07-build-a-spring-boot-microservice-using-mysql/media/01-create-service-connector-mysql.png index d28ed45..6684405 100644 Binary files a/07-build-a-spring-boot-microservice-using-mysql/media/01-create-service-connector-mysql.png and b/07-build-a-spring-boot-microservice-using-mysql/media/01-create-service-connector-mysql.png differ