How to resolve “Windows Principal functionality is not supported on this platform” in Azure App function
Introduction
I have
designed an azure app function to process azure service bus queues and topics.
The handlers in azure app function are aimed to process service bus messages
into SQL database records through handlers. Whereas app functions are built on
top of the code-first approach entity framework core 3.1. whenever I post
message to Service bus topics I got “Windows principal functionality is not
supported on this platform”. Let me explain you how I resolved this problem in
this article
Problem
SQL Server
comes handy with Mixed mode authentication where you can use either windows
authentication or SQL Server authentication. I have created azure app function
from .NET Core 3.1 and entity framework core 3.1.1 and provided local settings connection
string with windows authentication mode.
“Server=myserver;Database=mydatabase;integrated security=true;”
In my case
handlers can receive the message and processing it. While comes to saving point
in database context it is throwing error while saving anything to this context.
Solution
I tried multiple
ways to resolve this issue like reinstalling azure app functions related
packages and reinstalling SQL Server, nothing helps. Finally, I have changed
window authentication to SQL Server authentication. It’s works for me
“Server=yourserver;Database=yourdatabase;user id= yourid;password
= yourpassword ;”
Conclusion
After the
connection string changes from windows authentication mode to SQL server authentication
mode, I can easily process the messages through handlers and database context
saved the data successfully.
Comments
Post a Comment