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!
It won't come as a surprise to anybody that Azure AD B2C is on my list of Azure offerings that I ❤️. After all, I've written something like a 13 part article series 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, 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.
Speaking of Azure Functions - 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 - and have that sent as an incoming parameter? ✅
- Need to write to an Azure BLOB Storage? ✅
- Even write to SignalR clients? ✅ ✅ and ✅!
Check out all the bindings here.
With all of this power attached to other Azure services - Functions are an amazing way to power your mobile backend!
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 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 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!
You've probably seen the cool demos from the Cognitive Services Computer Vision API - 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.
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. 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.
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 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.
This is being designed in the open and the team is 100% open to community collaboration. Please, let them know what you think!
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!