Microsoft Azure database integration gets stuck on await Task operations
Hey guys,
Recently our company decided to change our database work to work with Microsoft Azure, however having gone through most of their documentation and support chats nothing seems to be working.
The issue is this, we run our code and get the insert into the database, but the await never returns and our code is stuck after having done any database operation.
Here is the script:
void Start() { Task.Run(TestTableConnection); }
private async Task TestTableConnection()
{
var table = AzureMobileServiceClient.Client.GetTable<Categories>();
Debug.Log("Testing InsertAsync...");
await TestInsertAsync(table);
Debug.Log("Testing ToListAsync...");
await TestToListAsync(table);
Debug.Log("Testing DeleteAsync...");
//await TestDeleteAsync(table);
Debug.Log("All testing complete.");
}
private async Task TestInsertAsync(IMobileServiceTable<Categories> table)
{
try
{
//var allEntries = await TestToListAsync(table);
//var initialCount = allEntries.Count();
await table.InsertAsync(new Categories { categoryName = "NewTest" });
Debug.Log("I added stuff to the table"); // This part never gets printed to Unity but the insert happens to the database
//allEntries = await TestToListAsync(table);
//var newCount = allEntries.Count();
//Debug.Assert(newCount == initialCount + 1, "InsertAsync failed!");
}
catch (Exception)
{
throw;
}
}
}
I hope my question makes sense, otherwise just give me a heads up and I'll provide a more detailed explanation.
Answer by Kenned · Jan 18, 2018 at 01:49 PM
I'm just going to answer my own question here for anyone having issues getting this to work : ) I've found Microsofts own Azure setup guides and unfortunately I couldn't get those to work, most likely because of some dll file versions, threading in Unity or maybe something else. However, I did find another guide on how to set this up which I have tested and it seems to work just fine for our purposes : )
Here's a link to the github the other kind soul had created: https://github.com/Unity3dAzure
Best of luck! :D
Your answer

Follow this Question
Related Questions
Security with android 1 Answer
Unity make obj download as per login of user 0 Answers
Quiz Game Database 1 Answer
Promise from jslib to c# 0 Answers
Why is MySQL search query not returning each row in 1 index of an array? 0 Answers