Skip to content

Commit 2095a69

Browse files
committed
add missing images
1 parent f7467d7 commit 2095a69

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed
106 KB
Loading
147 KB
Loading
244 KB
Loading

articles/app-service/tutorial-php-mysql-app.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.custom: mvc, cli-validate, devdivchpfy22, AppServiceConnectivity
1212

1313
# Tutorial: Deploy a PHP, MySQL, and Redis app to Azure App Service
1414

15-
This tutorial shows how to create a secure PHP app in Azure App Service that's connected to a MySQL database (using Azure Database for MySQL Flexible Server). You'll also deploy an Azure Cache for Redis to enable the caching code in your application. Azure App Service is a highly scalable, self-patching, web-hosting service that can easily deploy apps on Windows or Linux. When you're finished, you'll have a Laravel app running on Azure App Service on Linux.
15+
This tutorial shows how to create a secure PHP app in Azure App Service connects to a MySQL database (using Azure Database for MySQL Flexible Server). You'll also deploy an Azure Cache for Redis to enable the caching code in your application. Azure App Service is a highly scalable, self-patching, web-hosting service that can easily deploy apps on Windows or Linux. When you're finished, you'll have a Laravel app running on Azure App Service on Linux.
1616

1717
:::image type="content" source="./media/tutorial-php-mysql-app/azure-portal-browse-app-2.png" alt-text="Screenshot of the Azure app example titled Task List showing new tasks added.":::
1818

@@ -540,31 +540,33 @@ In this step, you create the Azure resources and deploy a sample app to App Serv
540540

541541
The GitHub codespace already has the [Azure Developer CLI](/azure/developer/azure-developer-cli/install-azd) (AZD).
542542

543+
1. Generate a Laravel encryption key with `php artisan key:generate --show`:
544+
545+
```bash
546+
php artisan key:generate --show
547+
```
548+
543549
1. Sign into Azure by running the `azd auth login` command and following the prompt:
544550

545551
```bash
546552
azd auth login
547553
```
548554

549-
1. From the repository root, run `azd init`.
555+
1. Create the necessary Azure resources and deploy the app code with the `azd up` command. Follow the prompt to select the desired subscription and location for the Azure resources.
550556

551557
```bash
552-
azd init --template tomcat-app-service-mysql-infra
553-
```
558+
azd up
559+
```
554560

555561
1. When prompted, give the following answers:
556562

557563
|Question |Answer |
558564
|---------|---------|
559-
|The current directory is not empty. Would you like to initialize a project here in '\<your-directory>'? | **Y** |
560-
|What would you like to do with these files? | **Keep my existing files unchanged** |
561565
|Enter a new environment name | Type a unique name. The AZD template uses this name as part of the DNS name of your web app in Azure (`<app-name>-<hash>.azurewebsites.net`). Alphanumeric characters and hyphens are allowed. |
562-
563-
1. Create the necessary Azure resources and deploy the app code with the `azd up` command. Follow the prompt to select the desired subscription and location for the Azure resources.
564-
565-
```bash
566-
azd up
567-
```
566+
|Select an Azure Subscription to use| Select your subscription. |
567+
|Select an Azure location to use| Select a location. |
568+
|Enter a value for the 'appKey' infrastructure secured parameter| Use the output of `php artisan key:generate --show` here. The AZD template creates a Key Vault secret for it that you can use in your app. |
569+
|Enter a value for the 'databasePassword' infrastructure secured parameter| Database password for MySQL. It must be at least 8 characters long and contain uppercase letters, lowercase letters, numbers, and special characters.|
568570

569571
The `azd up` command takes about 15 minutes to complete (the Redis cache takes the most time). It also compiles and deploys your application code, but you modify your code later to work with App Service. While it's running, the command provides messages about the provisioning and deployment process, including a link to the deployment in Azure. When it finishes, the command also displays a link to the deploy application.
570572
@@ -581,8 +583,6 @@ The GitHub codespace already has the [Azure Developer CLI](/azure/developer/azur
581583
- **Log Analytics workspace**: Acts as the target container for your app to ship its logs, where you can also query the logs.
582584
- **Key vault**: Used to keep your database password the same when you redeploy with AZD.
583585
584-
Once the command finishes creating resources and deploying the application code the first time, the deployed sample app doesn't work yet because you must make small changes to make it connect to the database in Azure.
585-
586586
Having issues? Check the [Troubleshooting section](#troubleshooting).
587587
588588
## 3. Use Azure connection strings in application code
@@ -707,9 +707,7 @@ With the MySQL database protected by the virtual network, the easiest way to run
707707
php artisan migrate --force
708708
```
709709
710-
If it succeeds, App Service is [connecting successfully to the database](#i-get-an-error-when-running-database-migrations).
711-
712-
:::image type="content" source="./media/tutorial-php-mysql-app/azure-portal-check-config-in-ssh-2.png" alt-text="A screenshot showing the commands to run in the SSH shell and their output.":::
710+
If it succeeds, App Service is [connecting successfully to the database](#i-get-the-error-during-database-migrations-php_network_getaddresses-getaddrinfo-for-mysqldb-failed-no-address-associated-with-hostname).
713711
714712
> [!NOTE]
715713
> Only changes to files in `/home` can persist beyond app restarts.
@@ -768,6 +766,10 @@ azd down
768766
769767
It indicates that MySQL connection variables are not properly configured. Verify that the `AZURE_MYSQL_` app settings are properly configured in [3. Use Azure connection strings in application code](#3-use-azure-connection-strings-in-application-code).
770768
769+
#### I get a blank page in the browser.
770+
771+
It indicates that App Service can't find the PHP start files in */public*. Follow the steps in [4. Configure Laravel settings in web app](#4-configure-laravel-settings-in-web-app).
772+
771773
#### I get a debug page in the browser saying `Unsupported cipher or incorrect key length.`
772774

773775
It indicates that the `APP_KEY` setting is set to an invalid key. When you run `azd up`, make sure you set `appKey` to the output of `php artisan key:generate --show`.

0 commit comments

Comments
 (0)