I use Azure to deploy my database. I'm having trouble using the Azure platform and don't know how to fix it. When my backend code tries to connect to db, I get the same error like that
"2021-01-01T18:27:13.198490+00:00 app[web.1]: fail: Microsoft.EntityFrameworkCore.Database.Connection 2021-01-01T18:27:13.198500+00:00 app[web.1]: An error occurred using the connection to database 'DB_NAME' on server 'tcp:SERVER_NAME.database.windows.net,1433'.
2021-01-01T18:27:13.206639+00:00 app[web.1]: fail: Microsoft.EntityFrameworkCore.Query
2021-01-01T18:27:13.206642+00:00 app[web.1]: An exception occurred while iterating over the results of a query for context type 'BackendService.Context.ApplicationDbContext'.
2021-01-01T18:27:13.206706+00:00 app[web.1]: Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open server 'SERVER_NAME' requested by the login. Client with IP address '184.108.40.206' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect.
When I enter this IP address into my db's firewall on the AZURE platform, the error goes away, but I have to enter a new IP address several times a day. How can I solve this problem, please help !
User contributions licensed under CC BY-SA 3.0