Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Azure MySQL Server to Flexible Server #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions 00-setup-your-environment/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down
26 changes: 13 additions & 13 deletions 07-build-a-spring-boot-microservice-using-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.