Skip to content

Commit bdb3230

Browse files
committed
updates
1 parent 43417c4 commit bdb3230

File tree

1 file changed

+26
-41
lines changed

1 file changed

+26
-41
lines changed

articles/app-service/quickstart-php.md

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,63 +24,53 @@ You create and deploy the web app using [Azure CLI](/cli/azure/get-started-with-
2424

2525
You can follow the steps here using a Mac, Windows, or Linux machine. Once the prerequisites are installed, it takes about five minutes to complete the steps.
2626

27-
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
27+
To complete this quickstart, you need:
2828

29-
## Set up your initial environment
29+
1. An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/).
30+
1. <a href="https://git-scm.com/" target="_blank">Git</a>
31+
1. <a href="https://php.net/manual/install.php" target="_blank">PHP</a>
32+
1. <a href="/cli/azure/install-azure-cli" target="_blank">Azure CLI</a> to run commands in any shell to provision and configure Azure resources.
3033

31-
- Have an Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/).
32-
- <a href="https://git-scm.com/" target="_blank">Install Git</a>
33-
- <a href="https://php.net/manual/install.php" target="_blank">Install PHP</a>
34-
- Install <a href="/cli/azure/install-azure-cli" target="_blank">Azure CLI</a>, with which you run commands in any shell to provision and configure Azure resources.
35-
36-
## Download the sample locally
34+
## 1 - Sample application
3735

3836
1. In a terminal window, run the following commands. It will clone the sample application to your local machine, and navigate to the directory containing the sample code.
3937

4038
```bash
4139
git clone https://github.com/Azure-Samples/php-docs-hello-world
4240
cd php-docs-hello-world
4341
```
44-
45-
1. Make sure the default branch is `main`.
46-
47-
```bash
48-
git branch -m main
49-
```
50-
51-
> [!TIP]
52-
> The branch name change isn't required by App Service. However, since many repositories are changing their default branch to `main`, this quickstart also shows you how to deploy a repository from `main`.
53-
54-
## Run the app locally
5542

56-
1. Run the application locally so that you see how it should look when you deploy it to Azure. Open a terminal window and use the `php` command to launch the built-in PHP web server.
43+
1. To run the application locally, use the `php` command to launch the built-in PHP web server.
5744

5845
```bash
5946
php -S localhost:8080
6047
```
6148

62-
1. Open a web browser, and navigate to the sample app at `http://localhost:8080`.
63-
64-
You see the **Hello World!** message from the sample app displayed in the page.
49+
1. Browse to the sample application at `http://localhost:8080` in a web browser.
6550

6651
![Sample app running locally](media/quickstart-php/localhost-hello-world-in-browser.png)
6752

6853
1. In your terminal window, press **Ctrl+C** to exit the web server.
6954

70-
## Deploy to Azure
55+
## 2 - Deploy your application code to Azure
56+
57+
Azure CLI has a command [`az webapp up`](/cli/azure/webapp#az_webapp_up) that will create the necessary resources and deploy your application in a single step.
7158

7259
In the terminal, deploy the code in your local folder using the [`az webapp up`](/cli/azure/webapp#az_webapp_up) command:
7360

7461
```azurecli
75-
az webapp up --sku F1 --name <app-name>
76-
```
62+
az webapp up \
63+
--sku F1 \
64+
--logs
65+
```
7766

7867
- If the `az` command isn't recognized, be sure you have the Azure CLI installed as described in [Set up your initial environment](#set-up-your-initial-environment).
79-
- Replace `<app_name>` with a name that's unique across all of Azure (*valid characters are `a-z`, `0-9`, and `-`*). A good pattern is to use a combination of your company name and an app identifier.
68+
8069
- The `--sku F1` argument creates the web app on the Free pricing tier, which incurs a no cost.
70+
- The `--logs` flag configures default logging required to enable viewing the log stream immediately after launching the webapp.
71+
- You can optionally specify a name with the argument `--name <app-name>`. If you don't provide one, then a name will be automatically generated.
8172
- You can optionally include the argument `--location <location-name>` where `<location_name>` is an available Azure region. You can retrieve a list of allowable regions for your Azure account by running the [`az account list-locations`](/cli/azure/appservice#az_appservice_list_locations) command.
82-
- The command creates a Linux app for Node.js by default. To create a Windows app instead, use the `--os-type` argument.
83-
- If you see the error, "Could not auto-detect the runtime stack of your app," make sure you're running the command in the *myExpressApp* directory (See [Troubleshooting auto-detect issues with az webapp up](https://github.com/Azure/app-service-linux-docs/blob/master/AzWebAppUP/runtime_detection.md)).
73+
- If you see the error, "Could not auto-detect the runtime stack of your app," make sure you're running the command in the code directory (See [Troubleshooting auto-detect issues with az webapp up](https://github.com/Azure/app-service-linux-docs/blob/master/AzWebAppUP/runtime_detection.md)).
8474
8575
The command may take a few minutes to complete. While running, it provides messages about creating the resource group, the App Service plan, and the app resource, configuring logging, and doing ZIP deployment. It then gives the message, "You can launch the app at http://&lt;app-name&gt;.azurewebsites.net", which is the app's URL on Azure.
8676

@@ -101,29 +91,24 @@ You can launch the app at http://&lt;app-name>.azurewebsites.net
10191
"appserviceplan": "&lt;app-service-plan-name>",
10292
"location": "centralus",
10393
"name": "&lt;app-name>",
104-
"os": "&lt;os-type>",
94+
"os": "linux",
10595
"resourcegroup": "&lt;group-name>",
106-
"runtime_version": "node|10.14",
96+
"runtime_version": "php|8.0",
10797
"runtime_version_detected": "0.0",
10898
"sku": "FREE",
109-
"src_path": "//home//cephas//myExpressApp"
99+
"src_path": "//home//msangapu//myPhpApp"
110100
}
111101
</pre>
112102
113103
[!include [az webapp up command note](../../includes/app-service-web-az-webapp-up-note.md)]
114104
105+
## 3 - Browse to the app
115106
116-
1. Browse to your newly created web app. Replace _&lt;app-name>_ with your unique app name created in the prior step.
117-
118-
```bash
119-
http://<app-name>.azurewebsites.net
120-
```
121-
122-
Here's what your new web app should look like:
107+
Browse to the deployed application in your web browser at the URL `http://<app-name>.azurewebsites.net`.
123108
124-
![Empty web app page](media/quickstart-php/app-service-web-service-created.png)
109+
![Empty web app page](media/quickstart-php/app-service-web-service-created.png)
125110
126-
## Redeploy updates
111+
## 4 - Redeploy updates
127112
128113
1. Using a local text editor, open the `index.php` file within the PHP app, and make a small change to the text within the string next to `echo`:
129114

0 commit comments

Comments
 (0)