How To Create An Azure Back-End For A Xamarin.Forms Application

Introduction

 
A modern application should have a cloud back-end to perform actions such as storing data into a database and being accessible from all the devices owned by the user.
If we want to give it this kind of function, we can use Microsoft Azure.
 
In this article, part one, we will see how to Work on Azure to create a back-end for a mobile application (built with Xamarin.Forms).
 
You can read the Part Two here.
 
Specifically, we will see how to create,
  • Resource Group
  • App Web
  • Azure SQL Database
  • Azure Server 
In the next article, part two, we'll see how to create a basic Xamarin.Forms application and connect it to this back-end. 
 
Prerequisites
  • A Microsoft Azure Subscription (If you don't have one yet, see the Azure Portal for a free subscription).
  • Microsoft Visual Studio 2019 (all versions).
Step 1
 
Login into the Azure Portal with your credentials,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Step  2 - Create a Resource Group
 
A Resorce Group is a container that holds all the resources for an Azure Solution (see Azure Resource Group).
 
Mouse over Resource Group and then click on "Create":
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Now type the name of the Resource Group
 
How To Create An Azure Back-End For A Xamarin.Forms Application
 
Click on Review and Create and then Create,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
We've created our own Resource Group,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
Step 3 - Create a Web App
 
This WebApp will be the back-end for our own Mobile Application.
 
In the Azure Portal Home Page, click on "Create a resource", choose "Web" and then "Web App":
 
How To Create An Azure Back-End For A Xamarin.Forms ApplicationHow To Create An Azure Back-End For A Xamarin.Forms Application
 
Compile the fields with the data shown in the images, choosing the correct resource geographic area, then click on "Review and Create" and "Create":
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
How To Create An Azure Back-End For A Xamarin.Forms Application 
How To Create An Azure Back-End For A Xamarin.Forms Application 
  
We've created a Web App,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
Now we'll prepare it to be a Mobile Application back-end. Click on the Application Name beside the "Microsoft.Web/sites" label,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
Click on "Configuration" and then on "New Application Setting",
 
How To Create An Azure Back-End For A Xamarin.Forms Application
 
Now compile the fields with the data shown in the image below, confirm with "Ok" and then save the changes,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
How To Create An Azure Back-End For A Xamarin.Forms Application
 
Step 4 - Create an Azure SQL Database with related Server
 
This database will save the data from our Mobile Application.
 
In the Azure Portal Home Page, click on "Create a resource", choose "Database", type into the search bar "Azure SQL" and confirm the choise,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
Click on  "SQL Database",
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
Now, compile the fields with the data shown below, choosing the correct Resource Group,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
Create a Server for the Database, choosing the correct resource geographic area,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
How To Create An Azure Back-End For A Xamarin.Forms Application
  
How To Create An Azure Back-End For A Xamarin.Forms Application
 
Click on "Review and Create" and "Create"; We've created the database and the related server.
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
How To Create An Azure Back-End For A Xamarin.Forms Application
Step 5 - Verify if the Application Service works correctly
 
In the Azure Portal Home Page, click on " All resources", then on the name of the application beside the "App Service" label:
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
Click on the URL shown on the top right corner of the page:
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
...and if we've worked well, we'll see this page,
 
How To Create An Azure Back-End For A Xamarin.Forms Application
 
Important Note
To avoid unintended costs, remember to delete the Resource Group after the end of the test, clicking on its name and following the procedure shown in the images below,
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
Click on "Delete Resource Group",
 
How To Create An Azure Back-End For A Xamarin.Forms Application 
 
Confirm the action typing the name of the "Resource Group",
 
How To Create An Azure Back-End For A Xamarin.Forms Application
 
Success. We've deleted our own Resource Group (and all the related resources in it). 
 

Conclusion

 
In this article, we've seen how to create, in Microsoft Azure,
  • Resource Group
  • App Web
  • Azure SQL Database
  • Azure Server
with the purpose of creating a back-end for the mobile application that we'll build in the second part of this tutorial.
 
Stay tuned for the next part and thank you so much for your attention.


Similar Articles