2
0

AzureのStatic Web AppsにIP制限をかける方法

Last updated at Posted at 2023-11-02

やりたいこと

Next.jsで開発したWebアプリにIP制限をかけたい

事前準備

その1. 構築するStatic Web AppsはStandardプランである必要があります。無料プランだとできないので、注意。
スクリーンショット 2023-11-02 17.16.36.png

その2. pipelineを作成済みであること。
Pipelineを作成されてない方は↓で構築してください。

方法

1. プロジェクトに設定ファイルを作成

プロジェクトのルートにstaticwebapp.config.jsonを作成

2. jsonファイル内を記載

staticwebapp.config.json
{
    "networking": {
      "allowedIpRanges": [
        "<ここにipアドレスを記載>",
      ]
    }
  }

3. commitして実行

おそらく再デプロイが走って、IP制限がかかっていると思います。

staticwebapp.config.jsonでその他設定できること

その他にはグローバルヘッダーの設定や、ルートごとのアクセス権なども設定することができます。

2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0