Reputation: 1
Our problem is follow:
We have an Azure App Service and Azure SQL Database. Recently, we have a problem of data missing from the SQL Database. The App Service was running and the users could create and retrieve the records from App Service. However, when we did a select statement using SSMS, the record could not be found. The next day, record cannot be seen via App Service as well.
We also have Azure Function App which was running during the same problematic period, but there was no issues with the updating. All records were updated into the database successfully.
Does anyone having similar problem? Any advice is greatly appreciated.
Best regards, Ben
Upvotes: 0
Views: 79
Reputation: 4552
The issue seems like with User permission for Azure SQL Server user. If the user is able to update it looks like he has only updating permission in the schema. I suggest you to cross-check the User permission on table(s) and schema for better clarity.
Refer below example to create Login
, User
and GRANT
permission:
CREATE LOGIN utkarsh WITH PASSWORD = 'Uuxwp7Mcxo7Khy';
USE AdventureWorks;
CREATE USER utkarsh FOR LOGIN utkarsh;
GO
Grant Select permission:
GRANT SELECT TO utkarsh
Refer: GRANT Database Permissions (Transact-SQL)
You can add a database user to a database role using the following query:
EXEC sp_addrolemember N'db_datareader', N'userName'
Upvotes: 0