How to wrap an asp.net WebApi project with azure API management? - azure

I am having a Web API project in asp.net and this project is hosted on Azure web app services .Azure endpoint of the api works . How can i wrap this api under azure api management ?
Current setup
Asp.net web Api project > Hosted in azure web app services
I tried to add the api in API management via blank and open api specification.
I would expect the Azure API Management could connect to my web app service where my asp.net web api project is hosted.

Deploy your Web API to Azure App Service API App instead of App Service Web App. You will be able to import the API's directly from the UI. Here is the doc.

Alternative to Ketan's approach is to configure API manually using "Blank API" option. where you'll need to specify your App's base URL. You will be required later on to create all operations manually.

Related

Swagger not working from azure API management service

Steps to enable swagger. From code it is enabled. From API App it is working. But not when I place my API app behind API management

How to change the URL of Web API service

An Azure App Service Web API using .NET Core was successfully deployed using the Visual Studio 2017 Publish function but now the URL needs to change. How can I do that?
You could map custom DNS name to Azure App Service
Go to the App Service blade.
On the blade, find the Custom domains or bind the SSL settings.
Then you could follow the Tutorial: Map an existing custom DNS name to Azure App Service and the Tutorial: Bind an existing custom SSL certificate to Azure App Service.
As both API Apps and Web Apps share the same underlying infrastructure.
Hope it helps.

Sharepoint Provider Hosted app with Odata Web API

We have a requirement to build a SharePoint Provider hosted app, which needs to call to a ASP.NET Web API built with Odata. I could't find a exact solution for this. Any help to perform this would be highly approciated
It should be like any other web application as the provider hosted App is totally independent from SharePoint.
IF you are building the app using asp.net, then you can just add a reference to the odata endpoint, ex: http://yourservice/odata/$metadata
Visual Studio will generate a proxy to all entities in the odata service.
If you are building the app using other technology, then deal with the service as a normal REST service and call it using any HTTP client, from browser or a backend.

Azure API App how to use single hosted api for both Mobile and Web

This question is related to following questions but not the same question
How can i integrate Azure Mobile App win Azure API app
How to combine azure AppServices API, Mobile and Web apps
I have been trying to setup an API to use with my mobile app(Xamarin) and Web app(Angular or ASP.NET MVC). I wanted to use "Azure App Service".
As i understand there are three things in Azure app service
Web Apps
Mobile Apps
API Apps
I wanted to select the "API APPS" as i wanted to use my Existing ASP.Net Web Api and wanted to expose the Api to swagger. Also I wanted to share this api with Mobile app as well as Web App.
Based on the documentation "API APPS" can be consumed by Mobile and Web clients.Web client is OK but i need to use Azure Mobile features(such as Single Authentications,Notifications,Offline Sync with Sql lite and etc ) to make things easy in Mobile app.
As per answers for above questions and the documentation, i can install mobile app back-end packages to ASP.Web API and host it as "Mobile APPS". So i can use all the features related to mobile.
My problem if i install the mobile back-end, can i use the same API
for Web Front end? Because I am hosting it as "Mobile APPS" service
not the "API APPS" service.
How can I share a single API host with mobile client (With Mobile back end feature) and Web client?
Is it possible to install the Mobile back-end packages and host the
API as "API APPS" , then use Mobile SDK in Xamarin app and the HTTP client or other client in Web APP to consume the same API?
If you want to use the Azure Mobile client SDK, especially features like offline sync, then you need to use the Azure Mobile server SDK. It's a set of NuGet packages that simply extend ASP.NET Web API.
If you want to roll your own mobile client, or just use the authentication feature, then you don't need to use the Azure Mobile server SDK and you can use just Web API.
If you do want to use the server SDK, we have samples that show how to consume this TableController API from a web client:
https://github.com/azure-appservice-samples/contosomoments
Azure App Service field engineer sample with web admin portal and offline-sync-enabled Xamarin.Forms client

Azure - Making an API App available to a Logic App

I've created a web application API with a swagger interface that I've deployed as an API App to Azure.
When creating a Logic App I can find my API App but whenever I try to use it I get the following error:
Failed to fetch swagger. Ensure you have CORS enabled on the endpoint
and are calling an HTTPS endpoint.
I'm using the default https url for the API definition in the API App:
https://microsoft-SOME-LONG-MS-INTERNAL-ID.azurewebsites.net/swagger/docs/v1
The swagger docs have been provided in my C# web API application through Swashbuckle.
For CORS I've set a single * item.
This didn't seem sufficient for the Logic App to access the API App I then configured Authentication / Authorization for the API App to use Azure Active Directory (express), creating an AD Azure App.
I believe the issue will be one of configuring security which is all pretty new to me in Azure. I'd like to make the API App inaccessible externally, but available to Web Apps and Logic Apps within my Azure subscription.
I've not added any authentication mechanism to the ASP.NET web application itself as I figured the web application would effectively be sitting in a private network on Azure. Perhaps this is a bad assumption and I need to add authentication to allow Azure AD to work?
Any pointers / suggestions?
Turns out I needed to update the Azure SDK for Visual Studio. I had an older version that was deploying a preview Api App which resulted in a "Api app host" type being deployed rather that an "API app" type.
Everything works after the update and I've found some documentation for securing the API App and making it available in the Logic App - https://azure.microsoft.com/en-us/documentation/articles/app-service-logic-custom-hosted-api/

Resources