Skip to content

Commit 8a3cca4

Browse files
authored
Merge pull request #189543 from anthonychu/20220221-add-password-protection
[Static Web Apps] Add password protection
2 parents 9d51601 + ea64aaa commit 8a3cca4

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed

articles/static-web-apps/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
href: private-endpoint.md
8585
- name: Secure authentication secrets
8686
href: key-vault-secrets.md
87+
- name: Set up password protection
88+
href: password-protection.md
8789
- name: Set up local development
8890
href: local-development.md
8991
- name: Configure app settings
13.9 KB
Loading
176 KB
Loading
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Enable password protection for Azure Static Web Apps
3+
description: Prevent unauthorized access to your static web app with a password.
4+
services: static-web-apps
5+
author: craigshoemaker
6+
ms.service: static-web-apps
7+
ms.topic: how-to
8+
ms.date: 03/13/2022
9+
ms.author: cshoe
10+
---
11+
12+
# Configure password protection
13+
14+
You can use a password to protect your app's pre-production environments or all environments. Scenarios when password protection is useful include:
15+
16+
- Limiting access to your static web app to people who have the password
17+
- Protecting your static web app's staging environments
18+
19+
Password protection is a lightweight feature that offers a limited level of security. To secure your app using an identity provider, use the integrated [Static Web Apps authentication](authentication-authorization.md). You can also restrict access to your app using [IP restrictions](configuration.md#networking) or a [private endpoint](private-endpoint.md).
20+
21+
## Prerequisites
22+
23+
An existing static web app in the Standard plan.
24+
25+
## Enable password protection
26+
27+
1. Open your static web app in the Azure portal.
28+
29+
1. Under *Settings* menu, select **Configuration**.
30+
31+
1. Select the **General settings** tab.
32+
33+
1. In the *Password protection* section, select **Protect staging environments only** to protect only your app's pre-production environments or select **Protect both production and staging environments** to protect all environments.
34+
35+
:::image type="content" source="media/password-protection/portal-enable.png" alt-text="Screenshot of enabling password protection":::
36+
37+
1. Enter a password in **Visitor password**. Passwords must be at least eight characters long and contain a capital letter, a lowercase letter, a number, and a symbol.
38+
39+
1. Enter the same password in **Confirm visitor password**.
40+
41+
1. Select the **Save** button.
42+
43+
When visitors first navigate to a protected environment, they're prompted to enter the password before they can view the site.
44+
45+
:::image type="content" source="media/password-protection/password-prompt.png" alt-text="Password prompt":::
46+
47+
## Next steps
48+
49+
> [!div class="nextstepaction"]
50+
> [Authentication and authorization](./authentication-authorization.md)

0 commit comments

Comments
 (0)