This Azure Functions project handles scheduled data fetching and processing for the Stock Charts application.
Note: For general development setup, see the main project README.
For local development, Azure Functions reads configuration from:
local.settings.json- Functions-specific settings (gitignored, template atlocal.settings.example.json)- Environment variables - System or shell environment
- Azure Key Vault - Production secret management (when
KEY_VAULT_URLconfigured)
The Functions project fetches real-time stock quotes from the Alpaca Markets API. These credentials are optional — the application falls back to backup quote data when they are absent.
Copy local.settings.example.json to local.settings.json and fill in your credentials:
cp server/Functions/local.settings.example.json server/Functions/local.settings.jsonThen edit server/Functions/local.settings.json and set ALPACA_KEY and ALPACA_SECRET:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"KEY_VAULT_URL": "",
"FUNCTIONS_RUN_ON_STARTUP_ENABLED": "true",
"ALPACA_KEY": "your-alpaca-api-key-here",
"ALPACA_SECRET": "your-alpaca-secret-here"
}
}The start-functions.js script creates local.settings.json automatically from the example file if it doesn't exist, so you can also just copy and edit it manually.
For dev containers, devcontainer.json uses containerEnv to inject credentials from the host shell at container creation time. Export the variables in your host shell before opening the container:
export ALPACA_KEY=your-alpaca-api-key-here
export ALPACA_SECRET=your-alpaca-secret-here
code . # then "Reopen in Container"- Sign up at alpaca.markets
- Navigate to Paper Trading API keys
- Generate new API key and secret
- Functions start successfully with a warning log
- Quote updates are skipped
- WebAPI automatically serves backup quote data
- Full application functionality is available for demo purposes
Azure storage: The project uses Azurite for local development, installed via npm (azurite package). Start with pnpm run azure:start or VS Code task "Run: Azure Storage".
azurite.azurite). It conflicts with the npm-based emulator by trying to use the same port (10000). Use the Azure Storage extension (ms-azuretools.vscode-azurestorage) to view storage data.
For our demo, we'll generally cache QQQ and SPY daily quotes every minute
during extended market hours 8am-6pm M-F U.S. eastern time with CRON "0 */1 08-18 * * 1-5".
To enable use of eastern time zone CRON values, we have configured our Azure Functions to override the default UTC timezone; which is okay for our purposes.
Azure App Service server app settings on Linux servers:
TZ:America/New_Yorkfor Linux instance.
This is often documented for Windows instances servers as:
WEBSITE_TIME_ZONE:Eastern Standard Time
In Azure App Service, the time zone is configured via the WEBSITE_TIME_ZONE app setting (not in local settings).
- Windows: use Windows time-zone names (e.g. “Pacific Standard Time”).
- Linux: use IANA names (e.g. “America/Los_Angeles”).
- Note: Linux Consumption/Flex Function Apps may not support this setting.
- Main Project Setup - Complete development environment setup
- Environment Configuration - Additional configuration details
- Azure Key Vault Setup - Secure secret management
Last updated: August 15, 2025