Skip to content

Commit 2ae3d95

Browse files
Pivot back to environment variables
1 parent 97b8b48 commit 2ae3d95

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

articles/static-apps/TOC.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
href: local-development.md
3030
- name: Add an API
3131
href: add-api.md
32-
- name: Configure app settings
33-
href: app-settings.md
32+
- name: Configure environment variables
33+
href: environment-variables.md
3434
- name: Tutorials
3535
items:
3636
- name: Publish from a static site generator

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

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Configure application settings for Azure Static Web Apps
2+
title: Configure environment variables 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,24 +9,22 @@ ms.date: 05/08/2020
99
ms.author: buhollan
1010
---
1111

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

14-
Application settings hold configuration settings for values that may change, such as database connection strings. Adding application settings allow you to modify the configuration input to your app, without having to change application code.
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.
1515

16-
Application settings are also sometimes referred to as environment variables.
16+
Environment variables are also sometimes referred to as application settings.
1717

1818
## Prerequisites
1919

2020
- An Azure Static Web Apps application
2121
- [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest)
22-
- [Node.js and npm](https://nodejs.org/en/download/), the Node.js package manager.
23-
- This requirement is used only to run the simple upload solution. It is not needed if the Azure CLI `rest` command is used to sync application settings to Azure.
2422

25-
## Types of application settings
23+
## Types of environment variables
2624

2725
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.
2826

29-
This article demonstrates how to manage application settings for the back-end API in Azure Functions.
27+
This article demonstrates how to manage environment variables for the back-end API in Azure Functions.
3028

3129
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.
3230

@@ -45,11 +43,11 @@ For more information about how to use environment variables with your JavaScript
4543
- [Hugo](https://gohugo.io/getting-started/configuration/)
4644
- [Jekyll](https://jekyllrb.com/docs/configuration/environments/)
4745

48-
## About application settings
46+
## About environment variables
4947

50-
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.
48+
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.
5149

52-
The following sample _local.settings.json_ shows how to add an application setting for the `DATABASE_CONNECTION_STRING`.
50+
The following sample _local.settings.json_ shows how to add a value for the `DATABASE_CONNECTION_STRING`.
5351

5452
```json
5553
{
@@ -96,7 +94,7 @@ The Azure Portal provides an interface for creating, updating and deleting App S
9694

9795
### Using the Azure CLI
9896

99-
You can use the `az rest` command to upload your settings to Azure. The command accepts application settings as JSON objects in a parent property called `properties`.
97+
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`.
10098

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

@@ -108,7 +106,7 @@ The easiest way to create a JSON file with the appropriate values is to create a
108106

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

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

113111
Your file should now look similar to the following example:
114112

@@ -137,9 +135,9 @@ The Azure CLI command requires a number of values specific to your account to ru
137135
> [!IMPORTANT]
138136
> 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.
139137
140-
### Viewing app settings with the Azure CLI
138+
### View environment variables with the Azure CLI
141139

142-
Application settings are available to view through the Azure CLI.
140+
Environment variables are available to view through the Azure CLI.
143141

144142
1. From a terminal or command line, execute the following command. Make sure to replace the placeholders `<YOUR_SUBSCRIPTION_ID>`, `<YOUR_RESOURCE_GROUP_NAME>`, `<YOUR_STATIC_SITE_NAME>` with your values.
145143

@@ -149,4 +147,5 @@ Application settings are available to view through the Azure CLI.
149147

150148
## Next steps
151149

152-
> [!div class="nextstepaction"][setup local development for azure static web apps](local-development.md)
150+
> [!div class="nextstepaction"]
151+
> [Setup local development](local-development.md)

0 commit comments

Comments
 (0)