Azure SQL database - login failed - azure-sql-database

I have two web apps in azure plus one SQL database. One of them connects to the db withouth any problem. However the other web app isn't able to connect. I get the error:
Login failed for user 'xxxxxx'.
This session has been assigned a tracing ID of 'a632c957-78dc-4f13-b07f-ff646b04895c'.
I already copied and pasted the connection string from the working web app to the other one with no luck.
Is there any configuration to maybe "allow connections" from a specific web app?
Thanks

Related

Connecting to SQL Server on same domain, but getting "Untrusted Domain" error?

We have multiple IIS web applications running on multiple web servers that connect to a SQL Server on a separate machine on the same domain.
Everything was running smoothly for over a year, then we had some major network issues. There was a problem with the replication between the primary and secondary domain controllers. There was an issue with Distributed File System services, Event ID 14530 ("DFS could not access its private data from the Active Directory.").
We got the network issues sorted out apparently, except now, none of the IIS web applications can connect to the SQL Server. We are using Windows Authentication. The error message is "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication." This is weird because we have verified that both the web servers and the SQL Server are in fact on the domain.
To make things weirder, the Network Admin removed the SQL Server from the domain and rejoined it, and the websites worked again... but only for a few minutes. Then the same error started occurring again!
The Network Admin and I have been working on this issue for several days. Any ideas would be appreciated.
Edit:
We can connect using SSMS. Also, applications that do not use IIS can connect. For example, we have a developer with some Fox and Cloud applications that use connection strings that can connect.
We have tried removing and re-adding the web servers to the domain.
The errors in the SQL Server log are as follows:
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
Error: 18452, Severity: 14, State: 1.
SSPI handshake failed with error code 0x80090311 while establishing a connection with integrated security; the connection has been closed.
Error: 17806, Severity: 20, State: 2.
Edit 2:
The system log on one of the web servers contained this error this morning:
This computer could not authenticate with [domain controller], a Windows domain controller for domain [domain name], and therefore this computer might deny logon requests. This inability to authenticate might be caused by another computer on the same network using the same name or the password for this computer account is not recognized. If this message appears again, contact your system administrator.
Edit 3:
I have tried pretty much everything suggested in this thread, including making sure the user was not locked out, the password was not expired, and the hosts file did not contain an invalid entry for localhost.

Can't interact with database when published to azure

Below is the steps i have took to publish my Website to Azure. I have two data connections the "defaultconnection" for users tables log in register etc. The other is a connection to an Azure Sql Database.
On Azure i created a new app service.
In Visual Studio i click on project and select publish.
In the publish Web window that pops up i select Microsoft Azure Web Apps.
In the following window i select the app service i created in Azure.
In the settings window it shows the two connection database connections.
They both have the same connection string which is the Azure hosted Database. I am not sure what to change the connection string to for the users table. I created a SQL database in azure and connected that to the app service then used that connection string for the "defaultconnection". The string is below
Server=tcp:userauthen.database.windows.net,1433;Data Source=userauthen.database.windows.net;Initial Catalog=USERAUTH;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
I published to azure and am able to go through the pages but as soon as i try to interact with the database i get an internal server error 500.
I tried publishing the website without userlogin so i could see if it connected to the Azure sql database but i still get the internal server error 500. I am really stuck at this point and any assistance would be helpful.
So i changed the firewall settings to allow certain IP address and it worked. I can access both my databases.

Sql Exception when connecting to Azure Mobile Service database

I'm using .net backend for Azure mobile services. I've published the service on the cloud with the publishing profile downloaded from Azure portal.The service gets published successfully. But I'm unable to connect to the service with my windows phone client. I get 500 response from the service. The logs on the portal shows this error
"Exception=System.InvalidOperationException: This operation requires a connection to the 'master' database. Unable to create a connection to the 'master' database because the original database connection has been opened and credentials have been removed from the connection string. Supply an unopened connection. ---> System.Data.SqlClient.SqlException: Login failed for user 'KqRUJJyDGlLogin'."
I'm using web.config transforms and in the Web.Release.config , the connectionstring with name , "MS_TableConnectionString" is pointing to the cloud db.
Is something that I'm missing over here.
Please help.
Thanks
It seems to be a problem with droping and recreating the db.
If you have something like this:
public class MyInitializer: DropCreateDatabaseIfModelChanges<MyContex>
in your WebApiConfig.cs change it to CreateDatabaseIfNotExists...
If you want to change your model, manually drop the tables of your db.
That might not be a perfect solution, but it works for me.

How to setup a WebForms authentication web app to connect to SSAS?

I'm trying to connect a web forms application to an SSAS Cube. The app is using web forms authentication and it is using web roles in Azure. The SSAS cube is on a Virtual Machine within Azure. There is no domain installed. The web app is using GrapeCity's Active Analysis control. When running the app i get the error "An existing connection was forcibly closed by the remote host". While profiling on the server I get an "Anonymous Logon" attempt.
How can I set this up?
SSAS uses Windows authentication only, so either:
1) You somehow get your web app's application pool to run under a windows account that can access the cube box (Sounds unlikely).
2) You have your application pool run under a windows account and create a windows account with the same username/password on the cube box, and assign it the permissions (Used to work, I think it still does).
3) You allow Anonymous Logon read permissions to your cube. I know you can do this at the server level (Dev enviroments..), I haven't tried it at the cube role level.
These are the ones I know of, best of luck.
EDIT: Sorry, thought I'd forgotten one, there is basic authentication if you add IIS as an extra layer, you have to set it up to go via the MSDMPump.dll, full explanation here: http://msdn.microsoft.com/en-us/library/gg492140.aspx

Running into an SQL Error with an MVC Application deployed on IIS

So I am new to working on web projects in general. I am working on an MVC application in Visual Studio 2008. I have generated an SQL database within VS, and I have deployed my application on IIS. However when I try to do anything in the application which will spark an SQL query, I get the following error:
"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed."
I have hit google on this problem, and people have suggested a number of solutions but I am unsure how many of them are relevant to me doing this when I'm doing this in VS2008,. I have tried a few simple things suggested like setting the trust level to full, and setting the Load User Profile to true in IIS, but no luck yet.
What edition of SQL are you running where you deployed the application to? If it is not SQL Express, you will need to remove "User Instance=True" from the connection string.