Skip to content

Commit 4e28952

Browse files
Merge branch 'marmalade-app-settings' of https://github.com/craigshoemaker/azure-docs-pr into marmalade-app-settings
2 parents b41a051 + 6b80270 commit 4e28952

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

articles/static-apps/environment-variables.md renamed to articles/static-apps/app-settings.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Configure environment variables for Azure Static Web Apps
2+
title: Configure application settings for Azure Static Web Apps
33
description: #Required; article description that is displayed in search results.
44
services: static-web-apps
55
author: burkeholland
@@ -9,31 +9,36 @@ ms.date: 05/08/2020
99
ms.author: buhollan
1010
---
1111

12-
# Configure environment variables for Azure Static Web Apps
12+
# Configure application settings for Azure Static Web Apps
1313

14-
Environment variables hold configuration settings for values that may change, such as database connection strings. Adding environment variables allows you to modify the configuration input to your app, without having to change application code.
14+
Application settings hold configuration settings for values that may change, such as database connection strings. Adding application settings allows you to modify the configuration input to your app, without having to change application code.
1515

16-
Environment variables are:
16+
Application settings are:
1717

1818
- Encrypted at rest
1919
- Copied to [staging](review-publish-pull-requests.md) and production environments
2020

21-
Environment variables are also sometimes referred to as application settings.
21+
Application settings are also sometimes referred to as environment variables.
22+
23+
> [!IMPORTANT]
24+
> The application settings described in this article only apply to the backend API of an Azure Static Web App.
25+
>
26+
> For information on using environment variables with your frontend web application, see the docs for your [JavaScript framework](#javascript-frameworks-and-libraries) or [Static site generator](#static-site-generators).
2227
2328
## Prerequisites
2429

2530
- An Azure Static Web Apps application
2631
- [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest)
2732

28-
## Types of environment variables
33+
## Types of application settings
2934

3035
There are typically two aspects to an Azure Static Web Apps application. The first is the web application, or static content, which is represented by HTML, CSS, JavaScript, and images. The second is the back-end API, which is powered by an Azure Functions application.
3136

32-
This article demonstrates how to manage environment variables for the back-end API in Azure Functions.
37+
This article demonstrates how to manage application settings for the back-end API in Azure Functions.
3338

34-
Many front-end frameworks and static site generators allow the use of environment variables during development. At build time, these variables are replaced by their values in the generated HTML or JavaScript. Since data in HTML and JavaScript is easily discoverable by site visitor, you want to avoid putting sensitive information in the front-end application. Settings that hold sensitive data are best located in API app.
39+
The application settings described in this article cannot be used or referenced in static web applications. However, many front-end frameworks and static site generators allow the use of environment variables during development. At build time, these variables are replaced by their values in the generated HTML or JavaScript. Since data in HTML and JavaScript is easily discoverable by site visitor, you want to avoid putting sensitive information in the front-end application. Settings that hold sensitive data are best located in the API portion of your application.
3540

36-
For more information about how to use environment variables with your JavaScript framework or library, refer to the following articles for more detail.
41+
For information about how to use environment variables with your JavaScript framework or library, refer to the following articles for more detail.
3742

3843
### JavaScript frameworks and libraries
3944

@@ -48,9 +53,9 @@ For more information about how to use environment variables with your JavaScript
4853
- [Hugo](https://gohugo.io/getting-started/configuration/)
4954
- [Jekyll](https://jekyllrb.com/docs/configuration/environments/)
5055

51-
## About environment variables
56+
## About API App settings
5257

53-
APIs in Azure Static Web Apps are powered by Azure Functions, which allows you to define environment variables in the _local.settings.json_ file. This file defines environment variables in the `Values` property of the configuration.
58+
APIs in Azure Static Web Apps are powered by Azure Functions, which allows you to define application settings in the _local.settings.json_ file. This file defines application settings in the `Values` property of the configuration.
5459

5560
The following sample _local.settings.json_ shows how to add a value for the `DATABASE_CONNECTION_STRING`.
5661

@@ -75,9 +80,9 @@ The `local.settings.json` file is not tracked by the GitHub repository because s
7580

7681
Generally, uploading your settings is done infrequently, and isn't required with every build.
7782

78-
## Upload settings
83+
## Uploading App settings
7984

80-
You can upload settings via the Azure Portal or with the Azure CLI.
85+
You can configure application settings via the Azure Portal or with the Azure CLI.
8186

8287
### Using the Azure Portal
8388

@@ -89,17 +94,19 @@ The Azure Portal provides an interface for creating, updating and deleting App S
8994

9095
1. Click on the **Configuration** option in the sidebar.
9196

97+
1. Select the environment that you want to apply the application settings to. Staging environments are automatically created when a pull request is generated, and are promoted into production once the pull request is merged. You can set application settings per environment.
98+
9299
1. Click on the **Add Button** to add a new app setting.
93100

94-
:::image type="content" source="media/environment-variables/configuration-env-variables.png" alt-text="Azure Static Web Apps configuration view":::
101+
:::image type="content" source="media/app-settings/configuration-app-settings.png" alt-text="Azure Static Web Apps configuration view":::
95102

96103
1. Enter a **Name** and **Value**
97104

98105
1. Click **OK**
99106

100107
### Using the Azure CLI
101108

102-
You can use the `az rest` command to do bulk uploads of your settings to Azure. The command accepts environment variables as JSON objects in a parent property called `properties`.
109+
You can use the `az rest` command to do bulk uploads of your settings to Azure. The command accepts application settings as JSON objects in a parent property called `properties`.
103110

104111
The easiest way to create a JSON file with the appropriate values is to create a modified version of your _local.settings.json_ file.
105112

@@ -111,7 +118,7 @@ The easiest way to create a JSON file with the appropriate values is to create a
111118

112119
2. Next, make a copy of your _local.settings.json_ file and name it _local.settings.properties.json_.
113120

114-
3. Inside the new file, remove all other data from the file except for the environment variables and rename `Values` to `properties`.
121+
3. Inside the new file, remove all other data from the file except for the application settings and rename `Values` to `properties`.
115122

116123
Your file should now look similar to the following example:
117124

@@ -140,7 +147,7 @@ The Azure CLI command requires a number of values specific to your account to ru
140147
> [!IMPORTANT]
141148
> The "local.settings.properties.json" file must be in the same directory where this command is run. This file can be named anything you like. The name is not significant.
142149
143-
### View environment variables with the Azure CLI
150+
### View application settings with the Azure CLI
144151

145152
Environment variables are available to view through the Azure CLI.
146153

@@ -153,4 +160,4 @@ Environment variables are available to view through the Azure CLI.
153160
## Next steps
154161

155162
> [!div class="nextstepaction"]
156-
> [Setup local development](local-development.md)
163+
> [setup local development](local-development.md)
133 KB
Loading

0 commit comments

Comments
 (0)