Good day. The essence of the problem: there is an application on the Web Api, and there is a SQL base on Azure. if the application is launched locally, read and write operations to the database (deployed on the server) are obtained without errors. If you deploy the application to Azure, the data from the database is read, but any time you try to add a record, an error occurs. The database is initiated from the deployed application, the initiating records are added to the table. And after initiation - only reading. What could be the problem. and where to dig? PS Base is processed through Entity Framework 6

  • And what is configured in the SQL server firewall? Is access allowed for Azure Services? - Walter Nuss
  • in the SQL Server firewall, access from ip from 0.0.0.0 to 255.255.255.255 is allowed, access to Azure Services is allowed. The application can read information from this database, but cannot write - Vladislav Biletsky
  • Very strange case. Did you just try to create a new database and a new server? In my practice it was when just re-creating a resource in Azrue helped ... - Walter Nuss
  • Recreation of resources did not fix the problem. Still, the application can perform all actions from localhost, and only read, but not modify the database after it has been deployed to Azure. The database was created in Azure, the connection string does not change when moving from localhost to the sweep - Vladislav Biletsky
  • Did you generate the Connection String in the portal itself or did you choose it yourself? Try to get the generated ... Maybe something is not there ... - Walter Nuss

1 answer 1

The problem has been fixed. The whole thing was in the connection string key. In the connection string that was generated by MS Azure, you need to add the ApplicationIntent = ReadWrite parameter, after which the application can read and write.