Introduction
Welcome to the second part of the article on "How to create an Azure Back-End for a Xamarin.Forms Application".
In the first part of the article, we've seen how to create:
- Resource Group
- Web App
- Azure SQL Database
- Azure Server
You can read the first part here.
In this second part, we'll see how to,
- Deploy the SDK for .NET solutions to Azure.
- Connect a basic ToDo application built with Xamarin.Forms to the Azure Back-End and the Azure SQL Database.
For simplicity, we'll use the code shared in the related GitHub repository by Microsoft.
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 - Add the connection string to the Web App.
First of all, we have to add the Azure SQL Database connection string to the Web App.
- Login into the Azure Portal with your credentials.
- Click on the name of the Web App (Type App Service)

- Click on Configuration in the left-hand column.

- Click on New connection string

- Compile the fields with the correct data and then click on save.

Step 2 - Deploy the SDK for .NET to Azure.
First, download the SDK for .NET, and the sample application from the related GitHub Repository.
- https://github.com/Azure/azure-mobile-apps-quickstarts
Now, we'll work on Visual Studio:
- Launch the IDE and select the folder we downloaded in the previous step.

- In Solution Explorer, expand the tree, as shown in the following picture.

- Open the ZUMOAPPNAME.sln solution and build it.
- Right-click on ZUMOAPPNAMEService and select Publish.

- Click on Start, then select App Service - Select Existing - Advanced.


- Insert the Connection String under MS_TableConnectionString, check Update database and save.

- Now select the Web App created on Azure.

- We'll see something like in the following picture.

- Now, click on +Add in the Dependencies line, select Azure SQL Database and then click on next.


- Compile the fields with the correct data and then click on finish.

- We'll see something like the following.

- Click on Publish to deploy the SDK for .NET to Azure.

Step 3 - Deploy the Xamarin.Forms Application.
Now we'll work on the Xamarin.Forms application.
- In Solution Explorer, expand the tree as shown in the following picture.

- Open the ZUMOAPPNAME.sln solution.
- Open the Contents.cs file.
- Replace the string after the @ with the WebApp URL we created on Azure.



- Verify the build configuration for Android and iOS.


- Finally, launch the application (Ctrl + F5).
- Add a task to the Android or iOS application, then pull to refresh both the emulators and we'll see the added task in both the lists.


SUCCESS!!! We've created an Azure back-end for our own Xamarin.Forms application.
Conclusion
In this article, we've seen how to:
- Deploy the SDK for .NET solutions on Azure.
- Connect a basic ToDo application built with Xamarin.Forms to the Azure Back-End and the Azure SQL Database.
How you have seen, we used the ready-to-use solutions from the GitHub Repository by Microsoft without modifying it, just for simplicity.
Of course, this is the base for your own future projects where you want to create an Azure back-end for your Xamarin.Forms application, and
you can modify the code to do it (please, read the LICENSE.txt file).
Don't forget to delete the Resource Group from Azure when your test is completed to avoid unwanted costs (the procedure to do it is at the end of Part One of this article).
Sources
- Microsoft Official Documentation,
https://docs.microsoft.com/it-it/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started
- Related GitHub Repository
https://github.com/Azure/azure-mobile-apps-quickstarts
Thank you for your time and your attention.

Waseef kPosted Sep 6, 2021, 8:12 AM
Hi Alain, Can't able to find the Zumoappnameservice sample in github in the Provided link, can you please guide me from where can i get the Proper sample?
Paco DosoPosted Dec 22, 2020, 5:23 PM
I'm not able to "Publish" the ZUMOAPPNAMEService from Visual Studio for Mac: I don't have the option. However, I can build and deploy the app locally. Is this normal?
Jacobo MenaPosted Nov 23, 2020, 2:30 AM
Hi, my table was created, the items are saving when i click on +, but the items are not displaying. Please help me :(
Bernardo FloresPosted Oct 27, 2020, 2:29 AM
Hello, I followed the steps carefully and is a match with https://docs.microsoft.com/en-us/previous-versions/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started, I get all the screens ok, however, there is no table created on the DB hence App stores nothing. What could be wrong? I am using an Azure for Students suscription btw but all was created ok on Azure
Elias GeorgiouPosted Jun 20, 2020, 5:22 AM
Wanted to ask some stupid questions.
Elias GeorgiouPosted Jun 20, 2020, 5:21 AM
Hello, thank you for this guide, it worked.
Cary BaerPosted May 8, 2020, 2:46 PM
Thanks for posting this. Don't you have to create a table in the database? I followed Part 2, but since there is no ToDo table, it doesn't work.
Boni IvanePosted Apr 13, 2020, 7:29 AM
Thank you Natalini your solution worked wonderfully. Currently, I am fighting with the client side I have an error: Assembly 'Xamarin.Android.Support.CustomTabs' is using '[assembly: Android.IncludeAndroidResourcesFromAttribute]', which is no longer supported. Use a newer version of this NuGet package or notify the library author.ZUMOAPPNAME.Droid. I tried to update the nuget packet but nothing
Boni IvanePosted Apr 9, 2020, 7:47 PM
Thank you for the second part, I am a beginner in xamarin and your tutorial brings me a plus. I downloaded the sample application from the associated GitHub repository.https://github.com/Azure/azure-mobile-apps-quickstarts and open on Visual Studio 19, I am currently unable to build the code because Visual Studio is showing me errors. An example of the mistakes I am facing: Error CS1061 'TodoItem' does not contain a definition for 'Id' and no accessible extension method 'Id' accepting a first argument of type 'TodoItem' was not found (a using directive or an assembly reference is- missing?) ZUMOAPPNAMEService C: \ Users \ HP \ Downloads \ Compressed \ azure-mobile-apps-quickstarts-master \ azure-mobile-apps-quickstarts-master \ backend \ dotnet \ Quickstart \ ZUMOAPPNAMEService \ Controllers \ TodoItemController.cs 43 Active