azure-setup-guide
andersnygaard/ettsted2
研究並編寫使用 EasyAuth(Google + Facebook)和 CosmosDB 的 Azure 部署指南。此技能會搜尋現有文件和螢幕截圖,以在 .docs/azure-setup-guide.md 處產出最新的設定指南。
...展開全部關於azure-setup-guide
「azure-setup-guide 」技能旨在針對 Azure 上的 finans 應用程式進行研究,並生成一份全面且最新的部署指南。此技能會主動搜尋並整合來自 Azure Portal、Google Cloud Console、Facebook Developer Portal 以及 CosmosDB 的最新文件、最佳實務與螢幕截圖,確保部署說明始終保持最新狀態。 透過自動化建立設定指南,此技能可簡化在 Azure 上部署 finans 應用程式的流程,並協助開發人員掌握雲端環境的最新變動。
此技能涵蓋多項 Azure 元件,例如 Azure App Service、用於 Google 和 Facebook 登入驗證的 EasyAuth,以及用於 NoSQL 資料庫管理的 Azure CosmosDB。它會擷取最新的 Azure CLI 指令語法、Azure 入口網站中的選單路徑,以及 Google 和 Facebook 的 OAuth 憑證設定。 研究階段完成後,此技能會將設定步驟彙整至 .docs/azure-setup-guide.md 中的 Markdown 檔案,開發人員可依照該檔案進行應用程式的設定與部署。
此技能適用於多種使用情境,包括為 finans 應用程式設定新環境、更新部署指南以反映 Azure 使用者介面的變更、驗證現有設定配置,以及透過逐步部署指南協助新開發人員上手。
常見問題
如何使用這項技能?
要使用此技能,只需執行它即可查詢在 Azure 上部署 finans 應用程式的現行設定程序。它會搜尋最新文件,然後在 .docs/azure-setup-guide.md 中產生一份設定指南。
使用此技能有哪些先決條件?
您需要具備「貢獻者」權限的 Azure 訂閱、已安裝的 Azure CLI、Google Cloud Console 及 Facebook 開發者帳戶,並已安裝 Node.js 20.x LTS。
此技能能否處理 Azure 入口網站的更新?
是的,此技能專門設計用於追蹤 Azure 入口網站使用者介面的變更,並據此更新部署指南。
此技能會配置哪些元件?
此技能會配置 Azure App Service、用於 Google 和 Facebook 驗證的 EasyAuth、Google OAuth、Facebook 登入,以及 Azure CosmosDB。
我能否將此技能用於其他應用程式?
雖然此技能是為「finans」應用程式設計的,但您仍可將其調整用於其他使用類似 Azure 元件的應用程式,不過某些步驟可能需要進行修改。
Azure Setup Guide Skill
This skill researches and generates a comprehensive Azure deployment guide for the finans application. It actively searches for the latest documentation to ensure instructions are current.
Stack Components
- Azure App Service (Free F1 tier preferred)
- EasyAuth (Azure App Service Authentication)
- Google OAuth login
- Facebook Login
- Azure CosmosDB (NoSQL database)
Credentials Location
OAuth credentials are stored in backend/.env:
GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRETFACEBOOK_APP_ID/FACEBOOK_APP_SECRETCOSMOS_DB_ENDPOINT/COSMOS_DB_KEY
Reference these when configuring EasyAuth instead of creating new credentials.
When to Use
Use this skill when:
- Setting up a new Azure environment for finans
- Updating deployment documentation after Azure Portal changes
- Verifying current setup steps against latest Azure UI
- Onboarding new developers who need deployment guidance
Workflow
Phase 1: Research Current Documentation
Search for the latest setup procedures:
Azure App Service Authentication (EasyAuth)
- Search: "Azure App Service authentication 2024 2025 configure Google Facebook"
- Search: "Azure EasyAuth setup guide latest"
- Look for Azure Portal UI screenshots and current menu paths
Google OAuth Configuration
- Search: "Google Cloud Console OAuth setup 2024 2025"
- Search: "Google OAuth web application redirect URI Azure"
- Verify current Google Cloud Console menu structure
Facebook Login Configuration
- Search: "Facebook Developer Portal app setup 2024 2025"
- Search: "Facebook Login OAuth redirect URI configuration"
- Verify current Facebook Developer Portal menu structure
Azure CosmosDB Setup
- Search: "Azure CosmosDB create database container 2024 2025"
- Search: "CosmosDB Node.js SDK connection setup"
- Verify current Portal paths and CLI commands
Azure CLI Commands
- Search: "az webapp auth update syntax 2024"
- Search: "az cosmosdb create CLI 2024"
- Verify command flags haven't changed
Phase 2: Compile Guide
After research, write the guide to .docs/azure-setup-guide.md with:
- Prerequisites section - Azure CLI, accounts needed
- Resource Group creation
- App Service Plan - Free F1 tier
- Web App creation
- CosmosDB setup - Account, database, containers (users, portfolios)
- Google OAuth setup - Step-by-step with current menu paths
- Facebook Login setup - Step-by-step with current menu paths
- EasyAuth configuration - CLI and Portal methods
- Environment variables - Connection strings, secrets
- Deployment steps - Build, package, deploy
- Testing section - Verify auth URLs work
- Troubleshooting - Common issues and fixes
- Cleanup commands - Delete resources when done
Phase 3: Verification
After writing the guide:
- Confirm all CLI commands use current syntax
- Verify Portal menu paths match latest Azure UI
- Include both CLI and Portal alternatives where possible
- Note any recent changes from previous guide versions
Base Template
Use this as the foundation, updating with researched information:
Finans App - Azure Deployment Guide
Stack: App Service + EasyAuth + Google/Facebook Login + CosmosDBTier: Free (F1) - suitable for development and testing
Prerequisites
- Azure CLI installed and logged in (
az login) - Azure subscription with Contributor access
- Google Cloud Console account
- Facebook Developer account
- Node.js 20.x LTS
Verify Azure login:
az account show --query "{Name:name, SubscriptionId:id}" -o tableStep 1: Create Resource Group
az group create --name finans-rg --location norwayeast
Step 2: Create App Service Plan (Free Tier)
az appservice plan create \ --name finans-plan \ --resource-group finans-rg \ --location norwayeast \ --sku F1 \ --is-linux
Free Tier Limits:
- 1 GB storage
- Shared compute
- No custom domains or SSL
- Good for development/testing
Step 3: Create Web App
az webapp create \ --name finans \ --resource-group finans-rg \ --plan finans-plan \ --runtime "NODE|20-lts"Get app URL:
az webapp show --name finans --resource-group finans-rg --query defaultHostName -o tsv
Step 4: Create CosmosDB Account
4.1 Create Account (Serverless - Cost Effective)
az cosmosdb create \ --name finans-cosmos \ --resource-group finans-rg \ --locations regionName=norwayeast \ --capabilities EnableServerless \ --default-consistency-level Session
4.2 Create Database
az cosmosdb sql database create \ --account-name finans-cosmos \ --resource-group finans-rg \ --name finans-db
4.3 Create Containers
Users container (partition key: /id):
az cosmosdb sql container create \ --account-name finans-cosmos \ --resource-group finans-rg \ --database-name finans-db \ --name users \ --partition-key-path /id
Portfolios container (partition key: /userId):
az cosmosdb sql container create \ --account-name finans-cosmos \ --resource-group finans-rg \ --database-name finans-db \ --name portfolios \ --partition-key-path /userId
4.4 Get Connection String
az cosmosdb keys list \ --name finans-cosmos \ --resource-group finans-rg \ --type connection-strings \ --query "connectionStrings[0].connectionString" \ -o tsvStep 5: Configure Google OAuth
[RESEARCH CURRENT STEPS - Google Cloud Console menu structure may have changed]
- Navigate to Google Cloud Console → APIs & Services → Credentials
- Create OAuth consent screen (External, app name: finans)
- Create OAuth 2.0 Client ID:
- Type: Web application
- Redirect URI:
https://finans.azurewebsites.net/.auth/login/google/callback
- Save Client ID and Client Secret
Step 6: Configure Facebook Login
[RESEARCH CURRENT STEPS - Facebook Developer Portal menu structure may have changed]
- Navigate to developers.facebook.com → My Apps → Create App
- Select app type: Consumer
- Add Facebook Login product
- Configure:
- Site URL:
https://finans.azurewebsites.net - Valid OAuth Redirect URI:
https://finans.azurewebsites.net/.auth/login/facebook/callback
- Site URL:
- Set Privacy Policy URL
- Switch app to Live mode
- Save App ID and App Secret
Step 7: Enable EasyAuth
CLI Method
# Enable authenticationaz webapp auth update \ --name finans \ --resource-group finans-rg \ --enabled true \ --unauthenticated-client-action RedirectToLoginPage \ --token-store true# Add Google provideraz webapp auth google update \ --name finans \ --resource-group finans-rg \ --client-id {GOOGLE_CLIENT_ID} \ --client-secret {GOOGLE_CLIENT_SECRET} \ --yes# Add Facebook provideraz webapp auth facebook update \ --name finans \ --resource-group finans-rg \ --app-id {FACEBOOK_APP_ID} \ --app-secret {FACEBOOK_APP_SECRET} \ --yes
Portal Method
[RESEARCH CURRENT PORTAL PATH - Azure Portal UI may have changed]
- Azure Portal → App Services → finans → Authentication
- Add identity provider → Google
- Add identity provider → Facebook
- Configure unauthenticated access
Step 8: Configure App Settings
az webapp config appsettings set \ --name finans \ --resource-group finans-rg \ --settings \ COSMOS_DB_ENDPOINT="https://finans-cosmos.documents.azure.com:443/" \ COSMOS_DB_KEY="{PRIMARY_KEY}" \ COSMOS_DB_DATABASE="finans-db" \ NODE_ENV="production"
Step 9: Deploy Application
Build & Package
pnpm --filter frontend buildpnpm --filter backend build
Deploy
az webapp deploy \ --name finans \ --resource-group finans-rg \ --src-path deploy.zip \ --type zip
Step 10: Verify Deployment
Test URLs:
- App:
https://finans.azurewebsites.net - Google login:
https://finans.azurewebsites.net/.auth/login/google - Facebook login:
https://finans.azurewebsites.net/.auth/login/facebook - User info:
https://finans.azurewebsites.net/.auth/me - Logout:
https://finans.azurewebsites.net/.auth/logout
Troubleshooting
Common Issues
"Reply URL does not match"
- Check redirect URI matches exactly including trailing slash
"/.auth/me returns null"
- User not logged in or session expired
- Check AppServiceAuthSession cookie
Facebook app not working
- Ensure app is in Live mode (not Development)
- Privacy Policy URL must be accessible
View Logs
az webapp log tail --name finans --resource-group finans-rg
Cleanup
Delete all resources:
az group delete --name finans-rg --yes --no-wait
Output Requirements
After completing research and compilation:
- Create
.docs/directory if needed - Write complete guide to
.docs/azure-setup-guide.md - Report any steps that couldn't be verified
- Note any significant changes from previous documentation
- Confirm file creation with path
Notes
- Always prefer free tier options where available
- Include both CLI and Portal methods
- Use norwayeast region for GDPR compliance
- Serverless CosmosDB for cost efficiency





首頁
