You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-php-mysql-app.md
+29-16Lines changed: 29 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,9 +174,10 @@ The creation wizard generated the connectivity variables for you already as [app
174
174
:::column span="2":::
175
175
**Step 1: Retrieve the existing connection string**
176
176
1. In the left menu of the App Service page, select **Settings > Environment variables**.
177
-
1. Select **AZURE_MYSQL_PASSWORD**.
178
-
1. In **Add/Edit application setting**, in the **Value** field, copy the password string for use later.
179
-
The app settings you see let you connect to the MySQL database and Redis cache secured behind private endpoints. However, the secrets are saved directly in the App Service app, which isn't the best. You'll change this.
177
+
1. Select **Connection strings**.
178
+
1. Select **AZURE_MYSQL_CONNECTIONSTRING**.
179
+
1. In **Add/Edit application setting**, in the **Value** field, copy the username and password for use later.
180
+
The connection string lets you connect to the MySQL database secured behind private endpoints. However, the secrets are saved directly in the App Service app, which isn't the best. You'll change this.
180
181
:::column-end:::
181
182
:::column:::
182
183
:::image type="content" source="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-1.png" alt-text="A screenshot showing how to see the value of an app setting." lightbox="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-1.png":::
@@ -214,37 +215,49 @@ The creation wizard generated the connectivity variables for you already as [app
214
215
:::row-end:::
215
216
:::row:::
216
217
:::column span="2":::
217
-
**Step 4: Configure the MySQL connector**
218
+
**Step 4: Create the MySQL connector**
218
219
1. In the top search bar, type *msdocs-laravel-mysql*, then select the App Service resource called **msdocs-laravel-mysql-XYZ**.
219
-
1. In the App Service page, in the left menu, select **Settings > Service Connector**. There are already two connectors, which the app creation wizard created for you.
220
-
1. Select checkbox next to the MySQL connector, then select **Edit**.
220
+
1. In the App Service page, in the left menu, select **Settings > Service Connector**.
221
+
1. Select **Create**.
222
+
1. For **Service type**, select **DB for MySQL flexible server**.
223
+
1. For **MySQL flexible server**, select your server (for example, **msdocs-laravel-mysql-235-server**).
224
+
1. For **MySQL database**, select your database (for example, **msdocs-laravel-mysql-235-database**).
225
+
:::column-end:::
226
+
:::column:::
227
+
:::image type="content" source="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-4.png" alt-text="A screenshot showing how to edit a service connector with a key vault connection." lightbox="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-4.png":::
228
+
:::column-end:::
229
+
:::row-end:::
230
+
:::row:::
231
+
:::column span="2":::
232
+
**Step 5: Configure authentication for the MySQL connector**
221
233
1. Select the **Authentication** tab.
234
+
1. Select **Connection string**.
222
235
1. In **Password**, paste the password you copied earlier.
223
236
1. Select **Store Secret in Key Vault**.
224
237
1. Under **Key Vault Connection**, select **Create new**.
225
238
A **Create connection** dialog is opened on top of the edit dialog.
226
239
:::column-end:::
227
240
:::column:::
228
-
:::image type="content" source="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-4.png" alt-text="A screenshot showing how to edit a service connector with a key vault connection." lightbox="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-4.png":::
241
+
:::image type="content" source="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-5.png" alt-text="A screenshot showing how to edit a service connector with a key vault connection." lightbox="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-5.png":::
229
242
:::column-end:::
230
243
:::row-end:::
231
244
:::row:::
232
245
:::column span="2":::
233
-
**Step 5: Establish the Key Vault connection**
246
+
**Step 6: Establish the Key Vault connection**
234
247
1. In the **Create connection** dialog for the Key Vault connection, in **Key Vault**, select the key vault you created earlier.
235
248
1. Select **Review + Create**.
236
249
1. When validation completes, select **Create**.
237
250
:::column-end:::
238
251
:::column:::
239
-
:::image type="content" source="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-5.png" alt-text="A screenshot showing how to configure a key vault service connector." lightbox="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-5.png":::
252
+
:::image type="content" source="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-6.png" alt-text="A screenshot showing how to configure a key vault service connector." lightbox="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-6.png":::
240
253
:::column-end:::
241
254
:::row-end:::
242
255
:::row:::
243
256
:::column span="2":::
244
257
**Step 6: Finalize the MySQL connector settings**
245
-
1. You're back in the edit dialog for **defaultConnector**. In the **Authentication** tab, wait for the key vault connector to be created. When it's finished, the **Key Vault Connection** dropdown automatically selects it.
246
-
1. Select **Next: Networking**.
247
-
1. Select **Save**. Wait until the **Update succeeded** notification appears.
258
+
1. You're back in the MySQL connector dialog. In the **Authentication** tab, wait for the key vault connector to be created. When it's finished, the **Key Vault Connection** dropdown automatically selects it.
259
+
1. Select **Review + Create**.
260
+
1. Select **Create**. Wait until the **Update succeeded** notification appears.
248
261
:::column-end:::
249
262
:::column:::
250
263
:::image type="content" source="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-6.png" alt-text="A screenshot showing the key vault connection selected in the defaultConnector." lightbox="./media/tutorial-php-mysql-app/azure-portal-secure-connection-secrets-6.png":::
@@ -359,10 +372,10 @@ In this step, you configure GitHub deployment using GitHub Actions. It's just on
359
372
1. Replace `DB_PASSWORD` (line 53) with `AZURE_MYSQL_PASSWORD`.
360
373
1. Replace `DB_PORT` (line 50) with `AZURE_MYSQL_PORT`.
361
374
1. Scroll to the Redis `cache` section and make the following changes:
362
-
1. Replace `REDIS_HOST` (line ) with `AZURE_REDIS_HOST`.
363
-
1. Replace `REDIS_PASSWORD` with `AZURE_REDIS_PASSWORD`.
364
-
1. Replace `REDIS_PORT` with `AZURE_REDIS_PORT`.
365
-
1. Replace `REDIS_CACHE_DB` with `AZURE_REDIS_DATABASE`.
375
+
1. Replace `REDIS_HOST` (line 142) with `AZURE_REDIS_HOST`.
376
+
1. Replace `REDIS_PASSWORD`(line 144) with `AZURE_REDIS_PASSWORD`.
377
+
1. Replace `REDIS_PORT`(line 145) with `AZURE_REDIS_PORT`.
378
+
1. Replace `REDIS_CACHE_DB`(line 146) with `AZURE_REDIS_DATABASE`.
366
379
1. In the same section, add a line with `'scheme' => 'tls',`. This configuration tells Laravel to use encryption to connect to Redis.
0 commit comments