Phone Number Setup
📞 Phone Number Setup Guide¶
After deploying the infrastructure, you need to configure an Azure Communication Services (ACS) phone number for inbound and outbound voice calls.
Quick Overview¶
| Method | Best For | Time |
|---|---|---|
| Azure Portal | First-time setup | ~5 min |
| Azure CLI | Automation/scripting | ~2 min |
| Post-provision Script | During deployment | Automatic |
Option 1: Azure Portal (Recommended)¶
Step 1: Navigate to Phone Numbers¶
- Go to the Azure Portal
- Find your Azure Communication Services resource (named
acs-<environment>-<token>) - In the left navigation, select Telephony and SMS → Phone numbers

Step 2: Get a Phone Number¶
- Click + Get in the top toolbar
- Select your country/region (e.g., United States)
- Choose number type:
- Toll-free (recommended for demos) - No geographic restrictions
- Local/Geographic - Tied to a specific area code
- Select features:
- ✅ Make calls - Required for outbound
- ✅ Receive calls - Required for inbound
- ✅ Send SMS (optional)
- Click Search to find available numbers
- Select a number and click Purchase
Processing Time
Phone number provisioning typically takes 1-2 minutes.
Step 3: Update App Configuration¶
Once you have your phone number (e.g., +18001234567), update it in Azure App Configuration:
- Go to your App Configuration resource (named
appconfig-<environment>-<token>) - Select Configuration explorer in the left navigation
- Click + Create → Key-value
- Enter:
- Key:
azure/acs/source-phone-number - Label: Your environment name (e.g.,
contoso) - Value: Your phone number in E.164 format (e.g.,
+18001234567) - Click Apply
Step 4: Trigger Configuration Refresh¶
To have running applications pick up the new phone number without restart:
# Update the sentinel key to trigger refresh
az appconfig kv set \
--endpoint "https://appconfig-<env>-<token>.azconfig.io" \
--key "app/sentinel" \
--value "v$(date +%s)" \
--label "<environment>" \
--yes
Or in the Azure Portal:
- Find the key
app/sentinelin Configuration explorer - Edit its value to any new value (e.g.,
v2) - Click Apply
Option 2: Azure CLI¶
Purchase and Configure in One Command¶
# Set your variables
ACS_NAME="acs-<environment>-<token>"
RESOURCE_GROUP="rg-<environment>-<token>"
APPCONFIG_ENDPOINT="https://appconfig-<environment>-<token>.azconfig.io"
LABEL="<environment>"
# Purchase a toll-free number
PHONE_NUMBER=$(az communication phonenumber purchase \
--name $ACS_NAME \
--resource-group $RESOURCE_GROUP \
--phone-number-type tollFree \
--country-code US \
--capabilities calling \
--query phoneNumber -o tsv)
echo "Purchased: $PHONE_NUMBER"
# Update App Configuration
az appconfig kv set \
--endpoint $APPCONFIG_ENDPOINT \
--key "azure/acs/source-phone-number" \
--value "$PHONE_NUMBER" \
--label $LABEL \
--yes
# Trigger refresh
az appconfig kv set \
--endpoint $APPCONFIG_ENDPOINT \
--key "app/sentinel" \
--value "v$(date +%s)" \
--label $LABEL \
--yes
echo "✅ Phone number configured in App Config"
Option 3: Post-provision Script¶
During azd up deployment, the post-provision script offers interactive phone number configuration:
Phone number options:
1) Enter existing phone number
2) Provision new from Azure
3) Skip
Choice (1-3):
If you select option 1, enter your phone number in E.164 format (+1234567890).
Verifying the Configuration¶
Check App Configuration¶
# List all ACS-related keys
az appconfig kv list \
--endpoint $APPCONFIG_ENDPOINT \
--label $LABEL \
--key "azure/acs/*" \
--output table
Expected output:
Key Value
------------------------------- ----------------
azure/acs/endpoint https://acs-xxx.communication.azure.com
azure/acs/immutable-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
azure/acs/source-phone-number +18001234567
Test Outbound Call¶
BACKEND_URL=$(azd env get-value BACKEND_CONTAINER_APP_URL)
curl -X POST "$BACKEND_URL/api/v1/calls/outbound" \
-H "Content-Type: application/json" \
-d '{"target_phone_number": "+1YOUR_PHONE"}'
Troubleshooting¶
"Phone number not configured" Error¶
The application reads the phone number from App Configuration at startup. If you see this error:
- Verify the key exists:
azure/acs/source-phone-number - Verify the label matches your environment
- Trigger a config refresh (update
app/sentinel) - Restart the backend container if dynamic refresh is disabled
"Phone number not verified" Error¶
ACS requires phone numbers to be verified for certain countries. Go to Phone numbers in your ACS resource and check the verification status.
Number Format Issues¶
Always use E.164 format:
- ✅ Correct:
+18001234567 - ❌ Wrong:
800-123-4567,1-800-123-4567,(800) 123-4567
Next Steps¶
After configuring your phone number:
- Configure inbound webhook - See Deployment Guide
- Test voice calls - Use the frontend UI or API
- Monitor call logs - Check Application Insights
Local Development
For local development with dev tunnels, ensure your webhook URL is updated in the ACS Event Grid subscription.