I would like to ask about 405 error of web api in azure? recently I create some httpput/ httppost web api services which use stored procedure (fromSqlRaw) and they are deployed to my azure web api path. But all faced 405 error e.g. (https://datingbirdapi.azurewebsites.net/Password/97777777/abcd1234)
Did azure not support restful service that use stored procedure for data manipulation? Below are two api service for password update and login:
[Route("{Contact_No}/{Password}")]
[HttpPut]
public ActionResult<List<passwordDTO>> UpdatePassword(string Contact_No, String Password)
{
var mobileNo = new SqlParameter("pMobileNo", Contact_No);
var password = new SqlParameter("pPassword", Password);
var passwordReturn = _context.Customer.FromSqlRaw("EXECUTE dbo.uspPasswordSalt @pMobileNo,@pPassword", mobileNo, password).ToList();
return passwordReturn;
}
[HttpGet]
public ActionResult<List<Login>> Login(String Contact_No, String Password)
{
var mobileNo = new SqlParameter("pMobileNo", Contact_No);
var password = new SqlParameter("pPassword", Password);
var LoginDetails = _context.Customer.FromSqlRaw("EXECUTE dbo.uspLogin @pMobileNo,@pPassword", mobileNo, password).ToList();
if (LoginDetails == null)
{
return NotFound();
}
return LoginDetails;
}
