Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Static Web App の使い方
Search
Hajime
December 30, 2023
Technology
2.8k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Static Web App の使い方
Hajime
December 30, 2023
More Decks by Hajime
See All by Hajime
Azure API Management の使い方
hajimes
0
4k
Azure App Configuration と Key Vault の連携
hajimes
0
840
Azure Functions で SQL Database のデータを操作する API を作成する手順
hajimes
0
1k
Other Decks in Technology
See All in Technology
Don't write the architecture only in the prompt.
neohsu
0
310
AIがGISを代替する日:〜すべてをAIが創る時代に、私たちがFOSS4Gに関わる意味〜
lehupa
0
210
[re:Invent2026事前勉強会(有志開催)]続きは、ラスベガスの廊下で / continue-in-the-vegas-hallway
sh_fk2
0
500
eBPF 簡介 2026 版
shunghsiyu
0
170
Oracle Database Security 詳細解説
oracle4engineer
PRO
1
250
PostgreSQL オプティマイザ統計の秘密
nori_shinoda
0
300
企画からFlutter実装まで、1つの機能を一貫して開発したプロセスと成果物
khiroyuki1003
0
140
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
120
推論基盤と Scale-Up Interconnect の現状と制約から俯瞰する技術動向
markunet
2
800
AI時代、つくる力を自分たちの手に。 ──電通×KAG、アジャイルとAI駆動開発で挑む開発の変革
yuukiyo
3
470
リアクションエンジニア ― 小さなリアクションから、話しかけやすい組織をつくる ―
ryuguyana
1
120
慶應義塾大学 AI実践05 論文執筆の仕組み化
keio_smilab
PRO
6
3.6k
Featured
See All Featured
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
560
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
390
Darren the Foodie - Storyboard
khoart
PRO
4
4.1k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
340
Amusing Abliteration
ianozsvald
1
380
Raft: Consensus for Rubyists
vanstee
143
7.8k
So, you think you're a good person
axbom
PRO
2
2.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Facilitating Awesome Meetings
lara
57
7.2k
How to Talk to Developers About Accessibility
jct
2
610
Transcript
Static Web Apps の使い⽅ (c) 2023 uraniwai
Static Web App とは • 2020 年 5 ⽉に発表された静的な Web
サイト向け App Service の ホスティング⽅法の⼀種 • Hugo や Jekyll, Hexo などの静的サイトのジェネレータだけでなく React や Vue, Angular といったシングル・ページ・アプリケーショ ン(SPA)のホスティングを想定 • Azure Functions を Static Web Apps 内部でマネージすることもで き、また、外部の API へルーティングすることもできる • デプロイ⽅法として CI/CD パイプラインが前提 (c) 2023 uraniwai App Service で使⽤できる Static Web Apps シングル ページ ホスティング オプションのプレビューの開始 https://azure.microsoft.com/ja-jp/updates/static-web-apps-single-page-hosting-option-available-in-app-service-now-in-preview/
Static Web Apps の主な機能 • コンテンツ配信 • GitHub Actions や
Azure Pipelines など CI/CD パイプライン からデプロイ • 単に静的サイトとしてホスティング するだけでなく App Service の EasyAuth などの機能が利⽤できる • リバースプロキシ • 特定のパス配下 (例えば /api) のリ クエストをバックエンドへ転送 • 静的サイトと同じ FQDN になるた め、 CORS の設定が不要 (c) 2023 uraniwai
Static Web Apps へのコンテンツのデプロイ⽅法 • Static Web Apps では GitHub
や Azure DevOps との接続が必須 • 現在、提供しているデプロイ⽅法は3種類 • Visual Studio Code の拡張機能でデプロイ • Azure ポータルでデプロイ • Azure CLI でデプロイ • デプロイ時に設定する内容 • リソースグループ • リソース名 • 課⾦レベル • リージョン (組み込み Functions) • リポジトリの情報 (c) 2023 uraniwai
Static Web Apps へのコンテンツのデプロイ⼿順 (c) 2023 uraniwai Azure ポータル Azure
CLI Visual Studio Code # 1. Azure にログイン $ az login # 2. リソースグループ作成 $ az group create --name my-swa-group --location ”japaneast” # 3. Static Web App 作成 $ az staticwebapp create --name my-first- static-web-app --resource-group my-swa- group --source “https://github.com/$GITHUB_USER_NAME/ my-first-static-web-app” --location “japaneast" --branch main --app-location "src" --login-with-github # 4. URL の取得 $ az staticwebapp show --name my-first- static-web-app --query "defaultHostname" 1. VSCode で「Azure Static Web Apps」拡張 機能をインストール 2. Azure メニューを選択してログイン 3. Static Web App を右クリックして「Create New Static Web App」を選択 4. 「The extension 'Azure Static Web Apps' wants to sign in using GitHub.」と表⽰され るので「allow」を選択 5. ブラウザが開きアクセス権を要求されるので 「Confirm」を選択 6. VSCode に戻って必要な項⽬を⼊⼒しt実⾏
GitHub Actions のパイプライン (React 向け) • Static Web Apps へ設置
• Azure/static-web-apps- deploy モジュールを利⽤ • フロントエンドや組み込み Function のパスを指定して 設置元を伝える • ビルド処理はパイプライン に記述せず package.json 内に記述 (c) 2023 uraniwai ・・・ jobs: build_and_deploy_job: steps: ・・・ - name: Build And Deploy id: builddeploy uses: Azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ secrets.STATIC_WEB_APPS_API_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }} action: 'upload’ app_location: '/’ api_location: ’’ output_location: 'build’ production_branch: 'master’ env: SKIP_DEPLOY_ON_MISSING_SECRETS: true ・・・ パラメータ名 役割 例 app_location リポジトリ内のフロントエンドアプリのパス “/” api_location リポジトリ内の組み込み Functions のパス “/api” output_location フロントエンドアプリのビルド出⼒パス “build” production_branch リポジトリの対象ブランチ “master”
その他 (c) 2023 uraniwai
プランと価格 (c) 2023 uraniwai Free Standard 料⾦ $0 $9/month (730h)
帯域幅 100GB / Subscription 100GB / Subscription 帯域幅の超過 不可 $0.20/GB/Subscription カスタムドメイン 2 / app 5 / app SSL 証明書 無料 無料 サービス定義認証 可能 可能 カスタム認証 不可 可能 ストレージ容量 (アプリ全体) 0.50GB 2.00GB ストレージ容量 (デプロイ単位) 0.25GB 0.50GB API ホスティング 組み込み Functions のみ 独⾃ Functions や 他の Azure サービスも可能 エンタープライズグレードエッジ 不可 $17.52/month/app データベース接続 無料※GA後に課⾦の可能性あり 無料※GA後に課⾦の可能性あり SLA 設定なし 99.95%
リファレンスアーキテクチャ (外部向け Web サイト) • アプリケーションの構成 • SPA で構築された Web
サイトは Static Web Apps に GitHub からデプロイ • API からデータやファイルを取得する際、 API Management を経由して Function にアクセス • ログ情報は Monitor で⼀元的に収集 (c) 2023 uraniwai サービス名 概要 Static Web Apps SPA (例: React) API Management API をホスティングするサービス Functions API の処理の実体 Cosmos DB NoSQL データベース Blob Storage ファイル Monitor ログの収集 GitHub ソースコード管理とデプロイの実⾏環境
(c) 2023 uraniwai