question

ThomasWierman-5514 avatar image
0 Votes"
ThomasWierman-5514 asked OuryBa-MSFT commented

Xamarin Forms using Azure SQL Database

I am trying to find a current tutorial on how to get a Xamarin Forms app to communicate with an Azure SQL Database.

On the Azure portal I clicked on "Create a Xamarin.Forms app with Azure". It takes me to a web page that has "We're no longer updating this content regularly." on top. The links to the quickstart Git pages give a 404 error.

I started this about 6 months ago, and had no luck getting it to work (using a Git that I got back then). I gave it another try this week and still no luck.

Is there a current tutorial available? The ones I have been able to see in my searching do not have the current Azure UI, and are very hard to follow.

dotnet-xamarinformsazure-sql-database
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ThomasWierman-5514 Thank you for posting your question. Are you looking to create a Xamarin.Forms app with Azure or to build a Xamarin .Forms app with Azure Mobile App.



Regards,
Oury

0 Votes 0 ·
AlbertoMorillo avatar image
0 Votes"
AlbertoMorillo answered OuryBa-MSFT commented

If you are trying to find a tutorial of a mobile app that consumes data sources directly, for example Azure SQL Database, then you won't find many as that scenario is not considered a good practice. You need to abstract that by creating an Azure API, the Xamarin app will use this REST API to interact with the database. If you don't use the API and you later want to change the data source of your application, then you will have to change many things to adapt to a new data source.

Here you will find a sample app and a walkthrough that shows how to create an Azure API App, connect it to an Azure SQL Database and how to have the mobile app communicate with the REST API.

This readme document will guide you step-by-step. It shows how to spin up an API in Azure and contains the source code communicating between an API and a Xamarin app.

Any questions you have, you can contact the author on Twitter, and he will be glad to assist you as he is a Developer Advocate at Microsoft.



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ThomasWierman-5514 Haven't heard back from you . Checking if the above answer from @AlbertoMorillo Helped. Please mark as accepted answer id the above was helpful. Otherwise let us know how we ca better assist.

Regards,
Oury

0 Votes 0 ·

Hi @ThomasWierman-5514 Haven't heard back from you . Checking if the above answer helped. Please mark as accepted answer id the above was helpful. Otherwise let us know how we ca better assist.

Regards,
Oury

0 Votes 0 ·
ThomasWierman-5514 avatar image
0 Votes"
ThomasWierman-5514 answered OuryBa-MSFT commented

Hi. I'm sorry it's taken a long time, this is kind of a hobby. I followed the readme on the XamList solution from GitHub. The connections are good. I got it to run, but nothing works.

I does not get past the SQLIte db part. It never finds the TableMapping to ContactModel. Then it seems to succeed in the Init() Task (I get two table mappings, one with the correct columns and one with two columns.

Then I try and add an entry, the isSaveSuccessful is false and the program bombs.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please contact the author with the link I provided on Twitter, you won't find anybody more willing to help about Xamarin

0 Votes 0 ·

@ThomasWierman-5514 Could you please open a Git hub issue so we can work closely on this issue.

Regards,
Oury

0 Votes 0 ·

@ThomasWierman-5514 Could you please open a Git hub issue so we can work closely on this issue.

Regards,
Oury

0 Votes 0 ·