2
votes

Requirement : Create a API app in Azure with OAuth2.0 authorization, which will communicate with Azure Service Bus to push message into Service bus queue based on incoming calls.

Problem: I have developed a Azure API app in VSTS and deployed in Azure, configured it using Azure Active Directory to do App registration and used API Management Service to implement OAuth2.0 on my API. When I am trying to communicate my Azure Service Bus to push message using queueclient.SendAsync(message), my message is getting into Service Bus but the SendAsync method does not returns and my code hangs on that line.

Then I searched some posts in google and I found that it is some kind of issue and I need to use .net core type project to overcome the sendasync thread problem. So I developed a .net core web application( template API) and deployed it to Azure and it is communicating with the bus properly. But the app service deployed in Azure is of type Web app but not API app. So now I cannot use this Web app to be configure under API Management Service for OAuth2.0 as it supports only API app type.

Query : 1. Can I use .net core web application to develop my API's and deploy in Azure as API app type. or 2. How to use .NET Framework web application to develop my API which can communicate with Service bus properly without hanging in SendAsync method.

1

1 Answers

0
votes

There is no noticeable difference between a Web APP and an API App so the answer is yes, you can use .net core web application to develop your API and deploy it as an API App.

I can't answer your Question 2 without seeing your code, maybe you missed an await?