-1

I've been stuck for days with this problem. I'm trying to create a mobile service in .NET backend and publish it to Azure.

I've followed this tutorial mobile-services-dotnet-backend-how-to-use-code-first-migrations to setup code first migration on the mobile service project.

It works fine when I deploy locally, but when I publish to Azure, it gives me this frowny service unhealthy

Service Unhealthy Azure Mobile Services

and I see this error in the logs

Information Changed service health to 'Critical' (Service is unhealthy. Please check the service logs to determine the issue and how to correct it.) from previous state 'Healthy' (The service is considered to be in a healthy state.). App.HealthReporter 20/06/2014 06:00:03

Error Boot strapping failed: executing 'WebApiConfig.Register' caused an exception: 'Windows logins are not supported in this version of SQL Server.'. App.Hosting 20/06/2014 06:00:03

This matches the symptoms in this blog Code-First Migration problem with AMS, but I can't apply his solution. He mentions that he grants control to the generated user

GRANT CONTROL ON SCHEMA::[dbo] TO [The Generated User Login]

But I have no idea where that is applied, where do I get the generated user login, etc. The database I'm using will be dedicated to that mobile services project, won't have tables from any other project.

More importantly, is there a better way of doing this ? as in this problem with naming seems too wrong to just work-around, is there a better of way setting up the database for an azure mobile service .net backend project ?

Please help

Mohamed Heiba
  • 1,813
  • 4
  • 38
  • 67

1 Answers1

1

The issue seems to be the connection string that your deployed service is using -- it seems to be trying to log in with windows credentials but that won't work against SQL Azure.

Are you working with the DB that AMS set up for you or did you set one up yourself?

To see which connection string the deployed service is working with (including the user, etc.) you can go to this site and inspect the application settings and connection strings for the application:

http://{yoursite}.scm.azure-mobile.net

After logging in check under Environment and look for the connection string called MS_TableConnectionString. In there you will find the user and password that EF tries to connect with.

Hope this helps,

Henrik

Henrik Frystyk Nielsen
  • 3,092
  • 1
  • 19
  • 17
  • You're right, in the connecting string I had Integrated Security=True;, when I removed it now I get a different error. I'll investigate and get back to you – Mohamed Heiba Jun 21 '14 at 05:11
  • Thanks a lot for your help on this. Any chance you can help me on this error http://stackoverflow.com/questions/24354139/not-found-error-in-azure-mobile-services-net-backend – Mohamed Heiba Jun 22 '14 at 18:09
  • should this be different than the connection string name I specified while writing the service? MS_TableConnectionString does not show up anywhere in my code... – Matt Aug 06 '15 at 02:44