An Azure Functions app that sends SMS court date reminders via Twilio.
- Install uv
- Install dependencies & Create local.settings.json (For details, se "setup" in repo top-level
Makefile):make setup
- Install Azure Functions Core Tools:
Alternatively, follow the official instructions.
npm i -g azure-functions-core-tools@4
- Start Azurite storage emulator:
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite azurite --disableTelemetry
- Start the Azure Function:
make run
- Trigger the function:
curl -X POST http://localhost:7071/api/twilioHandler --data '{"name": "World"}'
Unit tests (no credentials needed):
make testIntegration tests hit real external services and require credentials.
| Command | What it does |
|---|---|
make test |
Unit tests only (default) |
make test-twilio |
Twilio SMS integration tests |
make test-azure |
Azure Functions integration tests |
make test-integration |
All integration tests |
make test-all |
Unit + integration tests |
Twilio SMS setup — sends actual SMS messages to a test number:
- Copy
.template.envto.envand fill in your Twilio credentials - Run
make test-twilio
Set the repo Actions secret: AZURE_FUNCTIONAPP_PUBLISH_PROFILE (found in Azure portal > Function App > "Get Publish Profile")
Note, this is likely already set in Repo > Settings > Secrets and Variables > Actions. Including this section so we explicitly call it out for future maintainers
Deployment is handled by the GitHub Action deploy_to_azure_functions.yml
- Go to Storage Account "chooseyourownadventure" > Security + Networking > Access Keys
- Copy one of the "Connection String" values (either for key1 or key2)
- Save into the app settings in Azure, under
AzureWebJobsStorage- You can access this in the VS Code Azure extension > Function App > choose-your-own-adventure-demo-flex-eus > Application Settings
Once the Azure function is deployed, here is how to get the Invoke URL (used below in "Example cURL request against deployed app"):
func azure functionapp list-functions choose-your-own-adventure-demo-flex-eus --show-keysNote, in the URL below, replace <redacted> with actual value from Invoke URL
curl -L "https://choose-your-own-adventure-demo-flex-eus-dpaedjd2evcxhcd5.eastus-01.azurewebsites.net/api/twiliohandler?code=<redacted>" \
-H "Content-Type: application/json" \
--data '{"name": "World"}'Expected response:
Hello, World. This HTTP triggered function executed successfully.