SQL Server 2016 Always Encrypted Timeout at IIS

Always Encrypted is a feature designed by the Microsoft in SQL Server 2016 to protect sensitive data, such as credit card numbers or national identification numbers (SSN). It allows clients to encrypt sensitive data inside client applications.

When you work with Always Encrypted in development environment, it will be works fine because it requires certificate keys, which will be already installed on Dev machine. But when you moved to production environment it will not work. The Certificate needs to install on that server to run the web application. Without it encryption will not work. You will get database timed out error or encryption error while run the application.

For example:
Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

To resolve this error, you need to install the certificate on the server for specific user. After that you have to defined, selected user in application pool advanced properties. Which user you need to enabled the “Load user profile” property too under “Process Model”.

iis-load-user-profile

The provided anti-forgery token was meant for user “”, but the current user is “user@example.com”

While working with Asp.net MVC, I got HttpAntiForgeryException exception (The provided anti-forgery token was meant for user “”, but the current user is “user@example.com”) at login page. It happens when user login with valid credentials and re-directed to inner page ofr the application. At inner pages he press the browser back button and will show login page again. He entered the valid credentials again that time, this exception will generate and display on the browser.

To fix this exception: Need to add [OutputCache(NoStore=true, Duration = 0, VaryByParam= “None”)] line to your login get method.

[AllowAnonymous]
[HttpGet]
[OutputCache(NoStore=true, Duration = 0, VaryByParam= "None")]
public ActionResult Login(string returnUrl)
{
ViewBag.ReturnUrl = returnUrl;
return View();
}

How to fix apache drill startup error on windows-10

Apache Drill can be downloaded from here. It will works fine on windows 7 but it is giving error when you install it as embedded mode on Windows-10. Error is something like that after running the command:

sqlline.bat -u “jdbc:drill:zk=local”

Error during udf area creation [/C:/Users/<user>/drill/udf/registry] on file system [file:///] (state=,code=0)

After googling I found this is related to ownership and missing folder on users directory. To resolve it we need to manually create the folders and update the ownership of them. Below are the commands which we need to run before start.

mkdir “%userprofile%\drill”
mkdir “%userprofile%\drill\udf”
mkdir “%userprofile%\drill\udf\registry”
mkdir “%userprofile%\drill\udf\tmp”
mkdir “%userprofile%\drill\udf\staging”

takeown /R /F “%userprofile%\drill