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
> Azure Spring Apps is the new name for the Azure Spring Cloud service. Although the service has a new name, you'll see the old name in some places for a while as we work to update assets such as screenshots, videos, and diagrams.
This article shows you how to deploy your static files to Azure Spring Apps Enterprise tier using the Tanzu Web Servers buildpack. This approach is useful if you have applications that are purely for holding static files like HTML, CSS, or front-end applications built with the JavaScript framework of your choice. You can directly deploy these applications with an automatically configured web server (HTTPD and NGINX) to serve those assets.
21
21
@@ -24,19 +24,20 @@ This article shows you how to deploy your static files to Azure Spring Apps Ente
24
24
- An already provisioned Azure Spring Apps Enterprise tier instance. For more information, see [Quickstart: Build and deploy apps to Azure Spring Apps using the Enterprise tier](quickstart-deploy-apps-enterprise.md).
25
25
- One or more applications running in Azure Spring Apps. For more information on creating apps, see [How to Deploy Spring Boot applications from Azure CLI](./how-to-launch-from-source.md).
26
26
-[Azure CLI](/cli/azure/install-azure-cli), version 2.45.0 or higher.
27
-
- Your static files or dynamic front-end application.
27
+
- Your static files or dynamic front-end application - for example, a React app.
28
28
29
29
## Deploy your static files
30
30
31
31
You can deploy static files to Azure Spring Apps using NGINX or HTTPD web servers in the following ways:
32
32
33
33
- You can deploy static files directly. Azure Spring Apps automatically configures the specified web server to serve the static files.
34
-
- You can create your front-end application in the JavaScript framework of your choice, and then deploy your dynamic front-end application as static content.
35
-
- You can create a server configuration file to customize the web server.
34
+
- You can create your front-end application in the JavaScript framework of your choice, and then deploy your dynamic front-end application from source code. Azure Spring Apps builds your app into static content and uses your configured web server to serve the static files.
35
+
36
+
You can also create a server configuration file to customize the web server.
36
37
37
38
### Deploy static files directly
38
39
39
-
Use the following command to deploy static files directly using an auto-generated default server configuration file.
40
+
Use the following command to deploy static files directly using an autogenerated default server configuration file.
40
41
41
42
```azurecli
42
43
az spring app deploy
@@ -47,11 +48,11 @@ az spring app deploy
47
48
--build-env BP_WEB_SERVER=nginx
48
49
```
49
50
50
-
For more information, see the [Configure an auto-generated server configuration file](#configure-an-auto-generated-server-configuration-file) section of this article.
51
+
For more information, see the [Configure an autogenerated server configuration file](#configure-an-autogenerated-server-configuration-file) section of this article.
51
52
52
53
### Deploy your front-end application as static content
53
54
54
-
Use the following command to deploy a dynamic front-end application as static content.
55
+
Use the following command to deploy a dynamic front-end application from source code.
55
56
56
57
```azurecli
57
58
az spring app deploy
@@ -84,20 +85,20 @@ For more information, see the [Using a customized server configuration file](#us
84
85
The [Paketo buildpacks samples](https://github.com/paketo-buildpacks/samples/tree/main/web-servers) demonstrate common use cases for several different application types, including the following use cases:
85
86
86
87
- Serving static files with a default server configuration file using `BP_WEB_SERVER` to select either [HTTPD](https://github.com/paketo-buildpacks/samples/blob/main/web-servers/no-config-file-sample/HTTPD.md) or [NGINX](https://github.com/paketo-buildpacks/samples/blob/main/web-servers/no-config-file-sample/NGINX.md).
87
-
- Using Node Package Manager to build a [React app](https://github.com/paketo-buildpacks/samples/tree/main/web-servers/javascript-frontend-sample) into static files that can be served by a web server. Use the following steps:
88
+
- Using Node Package Manager to build a [React app](https://github.com/paketo-buildpacks/samples/tree/main/web-servers/javascript-frontend-sample) into static files that a web server can serve. Use the following steps:
88
89
1. Define a script under the `scripts` property of the *package.json* file that builds your production-ready static assets. For React, it's `build`.
89
90
1. Find out where static assets are stored after the build script runs. For React, static assets are stored in `./build` by default.
90
91
1. Set `BP_NODE_RUN_SCRIPTS` to the name of the build script.
91
92
1. Set `BP_WEB_SERVER_ROOT` to the build output directory.
92
93
- Serving static files with your own server configuration file, using either [HTTPD](https://github.com/paketo-buildpacks/samples/tree/main/web-servers/httpd-sample) or [NGINX](https://github.com/paketo-buildpacks/samples/tree/main/web-servers/nginx-sample).
93
94
94
-
## Configure an auto-generated server configuration file
95
+
## Configure an autogenerated server configuration file
95
96
96
-
You can use environment variables to modify the auto-generated server configuration file. The following table shows supported environment variables.
97
+
You can use environment variables to modify the autogenerated server configuration file. The following table shows supported environment variables.
97
98
98
99
| Environment Variable | Supported Value | Description |
|`BP_WEB_SERVER`|*nginx* or *httpd*| Specifies the web server type, either *nginx* for Nginx or *httpd* for Apache HTTP server. Required when using the auto-generated server configuration file. |
101
+
|`BP_WEB_SERVER`|*nginx* or *httpd*| Specifies the web server type, either *nginx* for Nginx or *httpd* for Apache HTTP server. Required when using the autogenerated server configuration file. |
101
102
|`BP_WEB_SERVER_ROOT`| An absolute file path or a file path relative to */workspace*. | Sets the root directory for the static files. The default is `public`. |
102
103
|`BP_WEB_SERVER_ENABLE_PUSH_STATE`|*true* or *false*| Enables push state routing for your application. Regardless of the route that is requested, *index.html* is always served. Useful for single-page web applications. |
103
104
|`BP_WEB_SERVER_FORCE_HTTPS`|*true* or *false*| Enforces HTTPS for server connections by redirecting all requests to use the HTTPS protocol. |
0 commit comments