I use Azure Mobile Services with my applications without any problems, but today, when I tried to disconnect from the service, I get this error:
Exception = System.Data.SqlClient.SqlException (0x80131904): Cannot open the master database requested by login. Login failed. Login failed for user "JVlSvKwDpdLogin_ ***** ".
I never had this problem, and I only connect to my mobile service in code as follows:
public static MobileServiceClient MobileService = new MobileServiceClient( "https://<webservicename>.azure-mobile.net/", "<YOUR-API-KEY-HERE>" );
Before this error occurred, I never provided a username or password. I saw some solutions in which they created a user for the database, but I do not want to create it right now, since we are still testing, and now I would prefer to use this service without it. Is this a problem with the mobile service or a problem with the database?
UPDATE
As suggested by Matt below, I found MS_ConnectionString on the Azure portal. Then I connected to the "master" database on my Azure SQL server and searched for the login above. I changed the password to the one found in the connection string using
ALTER LOGIN <login> WITH password='<password-found-in-connection-string>';
But now I get this error:
Exception = System.Data.Entity.Core.ProviderIncompatibleException: An error occurred while accessing the database. This usually means that the connection to the database failed. Ensure that the connection string is correct and that the appropriate DbContext constructor is used to specify or search the application configuration file. See http://go.microsoft.com/fwlink/?LinkId=386386 for information on DbContext and connections. See Internal Exception for failure details. ---> System.Data.Entity.Core.ProviderIncompatibleException: the provider did not return the ProviderManifestToken string. ---> System.Data.SqlClient.SqlException: Login failed for user: "JVlSvKwDpdLogin_ ******* ".
I am not changing anything using the connection string or the web.config file for my AzureMobileService project.
web.config:
<connectionStrings> <add name="MS_TableConnectionString" connectionString="Data Source= (localdb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-CoverageTool.AzureMobileService-20140910083006.mdf;Initial Catalog=aspnet-CoverageTool.AzureMobileService-20140910083006;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" /> </connectionStrings>
MobileContext:
private const string connectionStringName = "Name=MS_TableConnectionString"; public MobileServiceContext() : base(connectionStringName) { }
Connection string
Data Source = ***** .database.windows.net; Start Directory = sbpconsulting_db; User ID = ******* Login_sbpconsulting; Password = *** *********** ; Asynchronous Processing = True; TrustServerCertificate = False;