Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Add an Allow access-restriction rule using the AzureBotService service tag ahead of the existing deny rule; this permits Azure Bot Service traffic without maintaining changing Bot Framework IP addresses.
Add the App Service rule
The AzureBotService service tag supports inbound traffic, and App Service access restrictions support publicly available service tags.^1^^2^
- In Azure portal, open the App Service hosting the bot.
- Select Settings → Networking.
- Under Inbound traffic configuration, select Public network access.
- On Access Restrictions, select Add and configure:
- Action:
Allow - Name:
Allow-AzureBotService - Priority: A lower number than the deny/unmatched rule, such as
100 - Type:
Service Tag - Service Tag:
AzureBotService
- Action:
- Retain the existing Cloudflare allow rules.
- Set unmatched traffic to Deny, or retain the implicit deny created by the allow-list.
- Select Save, then test a new Direct Line conversation.
Rules are evaluated in priority order. Requests that match neither Cloudflare nor AzureBotService remain blocked; an unmatched request receives HTTP 403 before reaching the App Service worker.^2^
Do not replace this with manually copied Bot Framework IP ranges. Bot Framework services run across Azure datacenters, and their addresses can change, making a static IP allow-list fragile.^3^
Validate the result
After saving the rule:
- Send a message through Direct Line and confirm the bot’s messaging endpoint no longer returns 403.
- Review the App Service HTTP logs to distinguish an App Service access-restriction response from an application-generated 403.
- Confirm ordinary requests that bypass both Cloudflare and Azure Bot Service still receive 403.
- If the service tag is not available in the portal selector, verify that the subscription has the
Microsoft.Networkresource provider registered and that the operator has subscription-level read access. These are required for portal or CLI service-tag selection and validation.^2^
Stronger isolation option
If company policy does not permit any direct public ingress—even ingress limited by AzureBotService—the supported Direct Line design is the Direct Line App Service extension with virtual-network integration and private endpoints. In that design, the extension is colocated with the bot endpoint, and message traffic remains local to the virtual network rather than being sent to the bot endpoint through public Bot Framework services.^4^
This alternative applies only when the prerequisites are met:
- Direct Line App Service extension is enabled.
- Bot Framework SDK for C# or JavaScript is version 4.16 or later.
- Named pipes are enabled.
- A Web Chat client uses the extension’s Direct Line endpoint.^5^
The high-level configuration is:
- Integrate the App Service with a virtual network.
- Create a second subnet for the private endpoint.
- Open Azure Bot resource → Settings → Networking → Private access → Create a private endpoint.
- Select the
Bottarget sub-resource and the private-endpoint subnet. - In App Service → Settings → Configuration, add:
- Name:
DirectLineExtensionABSEndpoint - Value:
https://<your_azure_bot>.privatelink.directline.botframework.com/v3/extension
- Name:
- Restart the App Service.
- Open
https://<your-app_service>.azurewebsites.net/.botfrom the private network and verify:
{
"v": "123",
"k": true,
"ib": true,
"ob": true,
"initialized": true
}
- After private connectivity is confirmed, disable public network access.^5^
Disabling public access under this design affects channel management: Teams channels are unconfigured, and channels other than Direct Line cannot be configured or updated in the portal. Use this option only for a Direct Line-focused isolated deployment.^5^
References