tSQLt tests from Visual Studio with Azure SQL

catalogdbcatalogdb Posts: 16 New member
Hi I followed the tutorial and it seems this is not applicable for Azure SQL because Azure SQL doesn't support/allow CLR assemblies. I get below errors while setting up the tests project. First while attempting to enabling clr and second while attempting to import test cases from development db by clicking refresh.

Error1:
EXEC sp_configure 'clr enabled', 1;
RECONFIGURE;

Error: Msg 40510, Level 16, State 1, Line 24
Statement 'CONFIG' is not supported in this version of SQL Server

(when I comment/remove the code the shadow db fails. So I handled it by adding a condition. However it fails during refreshing the project with below error message.)

Error2:
Msg 10343, Level 14, State 1, Server XXXXX\LOCALDB#969D222D, Line 1
CREATE or ALTER ASSEMBLY for assembly 'tSQLtCLR' with the SAFE or EXTERNAL_ACCESS option failed because the 'clr strict security' option of sp_configure is set to 1. Microsoft recommends that you sign the assembly with a certificate or asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission. Alternatively, you can trust the assembly using sp_add_trusted_assembly.

I wonder if I need to do any other steps for working with Azure SQL. Please help.
Tagged:

Best Answer

Sign In or Register to comment.