6
votes

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

  1. Web Apps
  2. Mobile Apps
  3. 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.

  1. 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.

  2. How can I share a single API host with mobile client (With Mobile back end feature) and Web client?

  3. 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?

1
1.Yes 2. Yes. 3.Yes & No depending on the packages you install. I suggest you go with a full blown asp core web api. Notifications can be handled via the pushapp library github.com/Redth/PushSharpMichael Mburu
@MichaelIchangai Thank you !Thabo

1 Answers

5
votes

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: