Hello,
I have an web api application which is working perfectly when i run the application. But getting error when deploy it in IIS.
Error: The maximum number of retries (6) was exceeded while executing database operations with 'SqlServerRetryingExecutionStrategy'. See the inner exception for the most recent failure.
Don't konw why I am getting this error. Can anyone help?

Amit MohantyRank #112 · 20K reputationPosted Nov 23, 2022, 5:10 AM EST
Don't know it will work for you or not. If 'NT AUTHORITY\SYSTEM' is not set to sysadmin role will cause some inner exception because in your local it's working but in IIS not. So run the below query and try. This may help you.
EXEC master..sp_addsrvrolemember @loginame = N'NT AUTHORITY\SYSTEM', @rolename = N'sysadmin'Deepak MRank #6,212 · 273 reputationPosted Nov 22, 2022, 5:51 AM EST
@Naresh, I am using Sql Server database not Cosmos. And already go through the provided link.
Deepak MRank #6,212 · 273 reputationPosted Nov 23, 2022, 9:27 AM EST
It worked. Thank you @Amit
Naresh BeniwalRank #365 · 6.8K reputationPosted Nov 22, 2022, 4:57 AM EST
https://stackoverflow.com/questions/58454224/maximum-number-of-retries-6-exceeded-while-executing-database-operations-with