5 Azure Offerings I ❤️ for Xamarin Development
Tags: cloud, tips, xamarin, mobile
Published: 2019-04-02 17:03:27

---
title: 5 Azure Offerings I ❤️ for Xamarin Development
published: true
description: There are a ton of Azure offerings that are useful for mobile development. In this article find out the Five Azure offerings that I ❤️ the most for Xamarin Development!
tags: cloud,tips,xamarin,mobile
---

I'll admit it... I ❤️ Xamarin and I ❤️ Azure. So I thought what better way to spread some ❤️for Xamarin, than to talk about five Azure offerings that I ❤️ when doing Xamarin development!

And give all of these offerings a spin by signing up for a [free Azure account](https://azure.microsoft.com/en-us/free/?WT.mc_id=fiveazureforxamarin-devto-masoucou)!

## Azure AD B2C

It won't come as a surprise to anybody that [Azure AD B2C](https://docs.microsoft.com/en-us/azure/active-directory-b2c?WT.mc_id=fiveazureforxamarin-devto-masoucou) is on my list of Azure offerings that I ❤️. After all, I've written something like a [13 part article series](https://codemilltech.com/tag/azure-ad-b2c/) on it, instructed a Xamarin University guest lecture, not to mention given several conference talks too.

But why do I like it so much?

First and foremost, when combined with [MSAL.NET](https://docs.microsoft.com/en-us/azure/active-directory/develop/reference-v2-libraries?WT.mc_id=fiveazureforxamarin-devto-masoucou), it allows for a pretty simple way to allow users to create accounts and sign in to your app. And not only that, the users can sign up using existing social accounts they may already have, like Twitter or Facebook. So they don't have to create and remember yet another account.

Then once you have accounts created, an entire world of authentication and authorization opens up to you.

Plus, it integrates seamlessly with other Azure services. You want to lock down your Azure Functions? It's straight-forward to do so with Azure AD B2C and the Functions portal.

## Azure Functions

Speaking of [Azure Functions](https://docs.microsoft.com/en-us/azure/azure-functions/?WT.mc_id=fiveazureforxamarin-devto-masoucou) - that's number two on my list. Functions are not something that get consumed by an SDK hosted within your Xamarin application. Rather they will generally get invoked by an HTTP call.

But what make these amazing is that they allow you to create a backend for your app without having to spin up an entire ASP.NET WebAPI or Node.js backend which will sit idle most of the time waiting for a request to come in. With Azure Functions, you create a ... well, function ... and that singular function is the endpoint. You don't have to worry about the rest of the overhead that goes with hosting a web-based API. (This is where the term serverless comes in.)

But what sets Functions apart is that they have bindings to other Azure services. 

* Need to have a particular query run and the dataset populated from [Azure Cosmos DB](https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2?WT.mc_id=fiveazureforxamarin-devto-masoucou) - and have that sent as an incoming parameter? ✅
* Need to write to an [Azure BLOB Storage](https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob?WT.mc_id=fiveazureforxamarin-devto-masoucou)? ✅
* Even [write to SignalR clients](https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-signalr-service?WT.mc_id=fiveazureforxamarin-devto-masoucou)? ✅ ✅ and ✅!

Check out [all the bindings here](https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings?WT.mc_id=fiveazureforxamarin-devto-masoucou).

With all of this power attached to other Azure services - Functions are an amazing way to power your mobile backend!

## Azure Key Vault

Now this next one is a little tricky.

First let me lay out a scenario...

Let's say that you've been given the chance by your boss to develop the app that you've been talking about for the last 2 years. 

You have 2 months to put it together. So you move as fast as possible and hardcode database connection strings, Twitter keys, and anything else that needs a secret right into a config file (but at least you didn't push it to GitHub!)

> Hey, you got to get it done!

You do a tremendous job! So good in fact, that you get 3 more developers! But an issue quickly starts to arise - how do you distribute your app's secrets? And what happens when your teams grows even more? And even worse, what happens when Steve - and it's always Steve - is at a coffee shop and somebody snaps a photo of his laptop screen with your database connection string exposed?

This is where [Azure Key Vault](https://docs.microsoft.com/en-us/azure/key-vault?WT.mc_id=fiveazureforxamarin-devto-masoucou) comes in handy! It's a vault - that stores your keys - in Azure. By having a single point of where all of your secrets can be, it allows you to quickly cycle, or version, keys should a breach occur.

All you need to do is tell Key Vault - hey, give me this key ... and it'll send the secret value down to you!

But here's the tricky part. You really shouldn't ever have a secret on-device, even in a transient state. What you should do is request an access token, pass that token to a web service, and once that service verifies that you have access it grabs the key and does what it need to do.

The web service, by virtue of being hosted in Azure, [will have access](https://docs.microsoft.com/en-us/azure/key-vault/key-vault-secure-your-key-vault?WT.mc_id=fiveazureforxamarin-devto-masoucou) to Key Vault (after some config is done).

So Key Vault - it's a great place to store your app's secrets. And there is a .NET SDK should you choose to access them on-device. But you should really consider authenticating, and passing a token to a web service (which uses the Key Vault SDK), and have that service grab whatever info it can based on the secret key.

Still, use Key Vault whenever you can to store your secrets!

## Azure Custom Vision API

You've probably seen the cool demos from the [Cognitive Services Computer Vision API](https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/home?WT.mc_id=fiveazureforxamarin-devto-masoucou) - where it tells you that it's looking at an "orange on a table".

Yeah - that's cool and all. But there's something even better. There's an Azure service out there that let's you train up your own vision model... which is Machine Learning talk for telling the computer exactly what types of things you want it to recognize.

And that service is the [Azure Custom Vision API](https://docs.microsoft.com/en-us/azure/cognitive-services/custom-vision-service/home?WT.mc_id=fiveazureforxamarin-devto-masoucou).

Let's say you want to identify individual varieties of plants by taking a photo of them.

If you used the Cognitive Services Computer Vision API - all it would tell you is that it sees a plant.

However, the Custom Vision API would tell you it found a Fiddlehead Fern!

Now, all of this in-depth info does not come without its [share of work](https://docs.microsoft.com/en-us/azure/cognitive-services/custom-vision-service/getting-started-build-a-classifier?WT.mc_id=fiveazureforxamarin-devto-masoucou). In order for it to distinguish the species of plant, you first have to load in many different photos of that plant. Then _label_ each photo - or tell the machine what it is. After that, you train it. So it starts to learn how to identify which plants are which.

It might take more initial work, but what you get in the long run is a more specific and tailored vision model that Cognitive Services and provide you out of the box.

Oh! And you **DO NOT** have to call a web api to use these! You can download a TensorFlow, CoreML, or even an Onnx (for Windows) model on device and run them that way! And that means fast, fast, fast! Always good for mobile development.

## App Center

Here I'm not going to talk about the existing [App Center](https://docs.microsoft.com/en-us/appcenter?WT.mc_id=fiveazureforxamarin-devto-masoucou) functionality of [Build](https://msou.co/bq1), [Test](https://docs.microsoft.com/en-us/appcenter/test-cloud?WT.mc_id=fiveazureforxamarin-devto-masoucou), [Deploy](https://msou.co/bq3), [Crash](https://docs.microsoft.com/en-us/appcenter/diagnostics?WT.mc_id=fiveazureforxamarin-devto-masoucou)-a-[ltyics](https://docs.microsoft.com/en-us/appcenter/analytics?WT.mc_id=fiveazureforxamarin-devto-masoucou), and [Push](https://docs.microsoft.com/en-us/appcenter/push?WT.mc_id=fiveazureforxamarin-devto-masoucou).

Rather, I'm going to talk about the future of App Center. And this is a future that's going to make a lot of Xamarin developers very, very happy!

You see, the App Center team has released a [roadmap for the first 6 months](https://msou.co/bq7) of their 2019 development.

And one of the items on that roadmap is: creating next generation Azure mobile services.

> App Center is going to create the next generation of Azure mobile services!
> 

And here's the best thing - they're going to do all of their planning and design in the open! You can follow along [here](https://msou.co/bq8).

More to the point, start leaving your comments so you can influence the design on upcoming changes to [Identity](https://msou.co/bq9), a [Cosmos DB storage backend](https://msou.co/bra), and more!

This is being designed in the open and the team is 100% open to community collaboration. Please, let them know what you think!

## Summing It Up!

There you have it - five great Azure services that I ❤️ and make life easier for Xamarin developers.

Azure AD B2C for all of your user's account needs. Azure Functions for a full on backend without you having to do all the work. Azure Key Vault - keep those secrets safe! Azure Custom Vision API - detect highly specific vision models. 

And of course - the all new App Center - go ahead and help determine the future of mobile development in Azure!

So give these services a whirl with that [free Azure account](https://azure.microsoft.com/en-us/free/?WT.mc_id=fiveazureforxamarin-devto-masoucou)!