I'm Andrew Hoefling, and I work for FileOnQ as a Lead Software Engineer building mobile technologies for Government, Financial and First Responders using Xamarin. 

 

AppCenter: Data, Auth and Push


At Microsoft Build this week (May 6th) the App Center Team announced new features that allow you to use App Center to manage your Authentication and Data. As well a more complete Push Notification story if your App outgrows the capabilities of App Center. AppCenter is trying to be your 1 stop for everything Mobile and with the addition of these new features they are doing a great job!

You can read all about it in the blog Visual Studio App Center Preview: Welcoming Auth and Data to the Portfolio by James White. Prior to this announcement the App Center Team did their due diligence to reach out to community leaders and get feedback from the users of their product.

I have always had a good relationship with the App Center Team and PMs as I would get phone calls about different Xamarin Apps I have built and how AppCenter has helped. In the beginning of 2019 I started receiving more and more requests for meeting with the AppCenter team as I got a first look at what is coming and helped provide valuable feedback on direction of the new features.

The AppCenter Team is a phenomenal group and have been developing these specifications out in the open

The GitHub Repository was where the team defined the Minimal Viable Product (MVP) for some of the new features and took feedback from community members. I always love seeing when the community can participate in some of these discussions. Such as the Offline Sync Story as I had concerns about the MVP not supporting Relational Databases.

Kudos to the App Center Team for all the hard work

New Features in Preview

There are really 2 new features that I am excited about and some enhancements on a 3rd feature

  • Data
  • Auth
  • Push - Noteworthy Enhancements

Prior to Microsoft Build 2019 you would build you App with a custom backend system which included a database and a custom authentication provider. It was very common to start having all of these connected services add up making your overall Application Architecture a nightmare to keep track of.

Now App Center can be a 1 stop portal for managing your Data and Authentication including Offline Sync.

Easy to Use

In typical App Center fashion all of these features are really easy to use with a robust Web API to trigger any advanced scenario you can think of. Just create your new project in App Center and select the workflow you want to configure. You will get an easy to configure screen such as this for App Center Authentication

Authentication

App Center Auth uses Azure AD B2C, which stands for Azure Active Directory Business 2 Consumer. There are 3 main types of Azure AD and it is important to understand the differences between them

  • Azure AD
  • Azure AD B2B
  • Azure AD B2C

When I was first trying to understand the differences between them I found this blog Azure AD, B2B, B2C Puzzled Out – What Makes The Difference? by Tomasz Onyszko which I found very helpful.

My simple explanation on the 3 types

  • Azure AD - Enterprise AD typically used for 100% internal traffic and Office 365
  • Azure AD B2B - Enterprise AD used when 2 or more Enterprises need to integrate their technologoies together
  • Azure AD B2C - Consumer First Authentication that provides a Business a way to authenticate users (consumers) of their products. When I am building out a website or app that is selling a product for users to sign-on I will recommend Azure AD B2C.

Auth Providers

A common authentication scenario I have implemented several times before is using Facebook or Google authentication. That way users don't need to create yet another username and password for your app. This is a supported technology inside of Azure AD B2C and the Docs explain how all of this works and the flow of data to the different layers.

App Center provides an easy to use wrapper to Azure AD B2C

Getting Started

To get started with App Center Auth you will need an Azure account and don't worry about configuring it as the Docs are very detailed. When I first configured my own Azure AD B2C Auth for something last year I found this to be a difficult process. The App Center team has really documented the process and made an easy workflow in the portal to get you up and running quickly.

Data

When creating a database for your mobile app you have many options

  • Local SQLite Database
  • Remote Backend Server
  • NoSQL using Cosmos DB or similar

Once you add in the Offline Sync scenario the implementation gets tricky. Do you use a Caching Library such as Monkey Cache or do you go full blown OData Offline Sync ASP.NET Backend Server where Adrian Hall has an entire e-book dedicated to documenting how to use it. Historically I would recommend the OData based Azure Mobile Apps (commonly referred to as ZUMO), but I was constantly running into problems with it in the field. OData just couldn't handle the requests App Developers wanted to send. It masked a problem where good database normalization doesn't always work nicely with mobile apps and sending the data between the Mobile App and Server. If you want to learn more about Azure Mobile Apps I check out my blog about it:

Cosmos DB

App Center Data is built on top of Cosmos DB and targets offline first. Something Matthew Soucoup a Cloud Developer Advocate at Microsoft has been really pushing for Offline Sync Capabilities with Cosmos DB. App Center provides a mobile friendly offline capable API that is a wrapper for Cosmos DB and allows mobile app developers to work with these powerful technologies faster than they have evern been able to.

Getting Started

Check out the App Center Data Docs as they will be able to get you connected to your Azure Resources to start integrating Cosmos DB with your Mobile App. The App Center portal provides an easy wizard for configuring.

Relational Databases and On-Prem

I really love that Cosmos DB is being integrated with App Center but I would like more love with Relational Databases or on-premise Databases. A lot of clients still aren't ready to make a switch from Relational Database to NoSQL and the fact the Cosmos DB can only be hosted in the cloud can make things difficult. As mentioned in the initial Pull Request for App Center Data they plan to handle Relational Databases in the future.

Push

App Center Push is a technology I have been using this it was first released. I really love it how easy it is to configure and get going with Push Notifications in Xamarin or any Mobile Apps. If you want to learn more about how to use it check out my blog series on it

The trend in AppCenter is making a 1 place stop for everything Mobile and make it easy to integrate with. There is no special feature in Data, Auth or Push in App Center that you can't implement yourself. The App Center Team has created powerful wrappers around the difficult to configure technology to make it easier for you to build your apps. 

App Center Push is no different and is built on top of Azure Notification Hub. As your mobile app uses too many push notifications you be required to migrate your solution to Azure, but the NuGets and library integration will remain exactly the same.

Summary

The App Center Team is doing an amazing job listening to the community to build a product that is truly the best all-in-one DevOps App Building Portal. I am very excited to experiment with the brand new features and have everything all in one place


Share

Tags

AppCenterdataAuthenticationPushXamarinOffline SyncMicrosoft BuildMicrosoft Build 2019Cosmos DBAzure ADAzure AD B2C