Research and generate Azure deployment guide with EasyAuth (Google + Facebook) and CosmosDB...
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.
OAuth credentials are stored in backend/.env:
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETFACEBOOK_APP_ID / FACEBOOK_APP_SECRETCOSMOS_DB_ENDPOINT / COSMOS_DB_KEYReference these when configuring EasyAuth instead of creating new credentials.
Use this skill when:
Search for the latest setup procedures:
Azure App Service Authentication (EasyAuth)
Google OAuth Configuration
Facebook Login Configuration
Azure CosmosDB Setup
Azure CLI Commands
After research, write the guide to .docs/azure-setup-guide.md with:
After writing the guide:
Use this as the foundation, updating with researched information:
Stack: App Service + EasyAuth + Google/Facebook Login + CosmosDB Tier: Free (F1) - suitable for development and testing
az login)Verify Azure login:
az account show --query "{Name:name, SubscriptionId:id}" -o table
az group create --name finans-rg --location norwayeast
az appservice plan create \
--name finans-plan \
--resource-group finans-rg \
--location norwayeast \
--sku F1 \
--is-linux
Free Tier Limits:
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
az cosmosdb create \
--name finans-cosmos \
--resource-group finans-rg \
--locations regionName=norwayeast \
--capabilities EnableServerless \
--default-consistency-level Session
az cosmosdb sql database create \
--account-name finans-cosmos \
--resource-group finans-rg \
--name finans-db
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
az cosmosdb keys list \
--name finans-cosmos \
--resource-group finans-rg \
--type connection-strings \
--query "connectionStrings[0].connectionString" \
-o tsv
[RESEARCH CURRENT STEPS - Google Cloud Console menu structure may have changed]
https://finans.azurewebsites.net/.auth/login/google/callback[RESEARCH CURRENT STEPS - Facebook Developer Portal menu structure may have changed]
https://finans.azurewebsites.nethttps://finans.azurewebsites.net/.auth/login/facebook/callback# Enable authentication
az webapp auth update \
--name finans \
--resource-group finans-rg \
--enabled true \
--unauthenticated-client-action RedirectToLoginPage \
--token-store true
# Add Google provider
az webapp auth google update \
--name finans \
--resource-group finans-rg \
--client-id {GOOGLE_CLIENT_ID} \
--client-secret {GOOGLE_CLIENT_SECRET} \
--yes
# Add Facebook provider
az webapp auth facebook update \
--name finans \
--resource-group finans-rg \
--app-id {FACEBOOK_APP_ID} \
--app-secret {FACEBOOK_APP_SECRET} \
--yes
[RESEARCH CURRENT PORTAL PATH - Azure Portal UI may have changed]
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"
pnpm --filter frontend build
pnpm --filter backend build
az webapp deploy \
--name finans \
--resource-group finans-rg \
--src-path deploy.zip \
--type zip
Test URLs:
https://finans.azurewebsites.nethttps://finans.azurewebsites.net/.auth/login/googlehttps://finans.azurewebsites.net/.auth/login/facebookhttps://finans.azurewebsites.net/.auth/mehttps://finans.azurewebsites.net/.auth/logout"Reply URL does not match"
"/.auth/me returns null"
Facebook app not working
az webapp log tail --name finans --resource-group finans-rg
Delete all resources:
az group delete --name finans-rg --yes --no-wait
After completing research and compilation:
.docs/ directory if needed.docs/azure-setup-guide.md