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/quickstart-php.md
+26-41Lines changed: 26 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,63 +24,53 @@ You create and deploy the web app using [Azure CLI](/cli/azure/get-started-with-
24
24
25
25
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.
- Install <ahref="/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
37
35
38
36
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.
> 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
55
42
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.
57
44
58
45
```bash
59
46
php -S localhost:8080
60
47
```
61
48
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.
1. In your terminal window, press **Ctrl+C** to exit the web server.
69
54
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.
71
58
72
59
In the terminal, deploy the code in your local folder using the [`az webapp up`](/cli/azure/webapp#az_webapp_up) command:
73
60
74
61
```azurecli
75
-
az webapp up --sku F1 --name <app-name>
76
-
```
62
+
az webapp up \
63
+
--sku F1 \
64
+
--logs
65
+
```
77
66
78
67
- 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
+
80
69
- 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.
81
72
- 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 commandin 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)).
84
74
85
75
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://<app-name>.azurewebsites.net", which is the app's URL on Azure.
86
76
@@ -101,29 +91,24 @@ You can launch the app at http://<app-name>.azurewebsites.net
101
91
"appserviceplan": "<app-service-plan-name>",
102
92
"location": "centralus",
103
93
"name": "<app-name>",
104
-
"os": "<os-type>",
94
+
"os": "linux",
105
95
"resourcegroup": "<group-name>",
106
-
"runtime_version": "node|10.14",
96
+
"runtime_version": "php|8.0",
107
97
"runtime_version_detected": "0.0",
108
98
"sku": "FREE",
109
-
"src_path": "//home//cephas//myExpressApp"
99
+
"src_path": "//home//msangapu//myPhpApp"
110
100
}
111
101
</pre>
112
102
113
103
[!include [az webapp up command note](../../includes/app-service-web-az-webapp-up-note.md)]
114
104
105
+
## 3 - Browse to the app
115
106
116
-
1. Browse to your newly created web app. Replace _<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`.
123
108
124
-

109
+

125
110
126
-
## Redeploy updates
111
+
## 4 - Redeploy updates
127
112
128
113
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`:
0 commit comments