Bot Framework Access Blocked by App Service IP Restrictions

Hari Krishna, Gudditi 0 Reputation points
2026-11-24T06:45:43.0933333+00:00

Hi Team,

Our chatbot is hosted on Azure App Service and integrated with Azure Bot Service using Direct Line.

As per company security policy, IP restrictions are enabled on the App Service, allowing only approved Cloudflare IPs. However, Bot Framework requests are coming from multiple IP addresses and are being blocked with 403 errors.

Could you please advise the recommended approach to allow Microsoft Bot Framework/Azure Bot Service to access the App Service while keeping IP restrictions enabled?

Thanks.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-24T06:46:51.0733333+00:00

    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^

    1. In Azure portal, open the App Service hosting the bot.
    2. Select Settings → Networking.
    3. Under Inbound traffic configuration, select Public network access.
    4. 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
    5. Retain the existing Cloudflare allow rules.
    6. Set unmatched traffic to Deny, or retain the implicit deny created by the allow-list.
    7. 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.Network resource 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:

    1. Integrate the App Service with a virtual network.
    2. Create a second subnet for the private endpoint.
    3. Open Azure Bot resource → Settings → Networking → Private access → Create a private endpoint.
    4. Select the Bot target sub-resource and the private-endpoint subnet.
    5. In App Service → Settings → Configuration, add:
      • Name: DirectLineExtensionABSEndpoint
      • Value: https://<your_azure_bot>.privatelink.directline.botframework.com/v3/extension
    6. Restart the App Service.
    7. Open https://<your-app_service>.azurewebsites.net/.bot from the private network and verify:
    {
      "v": "123",
      "k": true,
      "ib": true,
      "ob": true,
      "initialized": true
    }
    
    1. 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

    1. Azure service tags overview for virtual network security
    2. Set up Azure App Service access restrictions
    3. Issue with Whitelisting Azure IP Ranges for Bot Service - Microsoft Q&A
    4. Network isolation in Azure AI Bot Service
    5. Configure network isolation
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.