How to use the ACS samples in production on Azure?

Alex 0 Reputation points
2024-09-04T16:19:14.4333333+00:00

I'd like to ask a question please that's slightly related to this one: https://learn.microsoft.com/en-us/answers/questions/1650723/ivr-azure-communication-services-bot-deployment

I'm also using the same sample. It was easy enough to set up running locally in Visual Studio with DevTunnels.

It was also straightforward to publish to Azure (I think). It's running there as a web app and it can answer calls (via the trigger), but then it gets stuck.

It does answer the call, but then sticks on this line:

var answer_result = await answerCallResult.WaitForEventProcessorAsync();

I've enabled debugging/logging, but I seem to be able to do is confirm what I already know. It sticks on exactly this line.

Presumably there's some additional configuration I need to do on Azure? I've tried enabling all the relevant security/IAM options I can think of, but now I'm stuck. Please can anything give me some pointers to help?

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
1,239 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 19,301 Reputation points Moderator
    2024-09-04T21:15:36.65+00:00

    Hi @Alex I understand you're facing an issue with the Azure Communication Services (ACS) Bot sample code getting stuck on the line var answer_result = await answerCallResult.WaitForEventProcessorAsync(); after deploying it to Azure App Service. This seems related to the linked question about deploying an IVR bot using ACS.

    Firstly, the linked question was in relation to using Azure Functions. If you're deploying to a standard Web App in Azure App Service, there might be compatibility issues. Consider using Azure Functions for a more suitable environment for this type of bot.

    Secondly, from what you shared it seems like the code might be encountering a deadlock situation where the WaitForEventProcessorAsync() method is waiting for an event that never arrives. Review the code surrounding this line to see if there are any potential deadlocks. Ensure proper event handling and resource cleanup.

    Lastly, please double-check your Azure configuration for ACS Bot to make sure all required resources are provisioned correctly, including:

    • Azure Communication Services resource
    • Bot Channels registration (SMS, Phone Number)
    • Connection strings for accessing ACS resources
    • Verify that the bot has the necessary permissions (e.g., "Microsoft.Communication/services/read" and "Microsoft.Communication/users/readall") to access required resources.

    Hope that help.

    -Grace

    1 person found this answer helpful.
    0 comments No comments

Your answer

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