Site does not connect to database after published

Asked

Viewed 38 times

0

I published a WEB application (developed in C#) in Azure using a database, it turns out that when I try to run it through the domain provided by Azure, it gives me the following error:

"Server Error in '/' Application."
"Login failed for user '{my name}'".

From what I understand the error has to do with access to data.

When I test the connection in Visual Studio, before making the publication, it does not give me any error. I can also access the server through Server Object Explorer without any problem. I’ve done a lot of research and tried a lot of things, but nothing seems to work.

In my project I use Entity Framework Code First Migrations.

  • Is this database on the Azure server or is it local on your machine? You tried to publish your application on the local IIS to test.

  • The database is on the Azure servers. No, I posted to Azure without testing on IIS

  • Your problem and user permission, you do not have access permission with that server user who is accessed

  • This link may help you set up user permission. http://stackoverflow.com/questions/37297944/server-error-in-application-login-failed-for-user

1 answer

0


You must configure your database to be accessed from App Services - in your case, a Webapp.

  1. Access your database’s firewall rules.

inserir a descrição da imagem aqui

  1. From access permission by Azure Services.

inserir a descrição da imagem aqui

I believe that this should solve the problem.

See here to learn more about create and manage firewall rules in Azure.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.