9

I'm in the middle of migrating a database to Azure SQL Database. I was reading about the differences between Azure SQL Database and Azure Managed Instance and noticed that CLR functions are NOT supported in Azure SQL Database.

This surprised me as I've already loaded a test version of the database into Azure SQL Database and nobody complained about issues. I looked and sure enough, the CLR assembly is there and running queries that use the CLR functions work just fine.

So I went searching the web, and all the information I see is that CLR does not work with Azure SQL Database. Yet here I am, with a working CLR assembly in Azure SQL Database.

So now I'm wondering, do I tell the business we have to switch to use Managed Instance because that's the only place that CLR is supported? Or stick with Azure SQL Database because it's working fine? Or have I missed something? Did Microsoft re-enable CLR without telling anyone?

1

3 Answers 3

14

So I went searching the web, and all the information I see is that CLR does not work with Azure SQL Database.

The long and the short of it is... CLR technically works in Azure SQL DB, however it is generally disabled for tenants. It can be enabled but it's on a case by case basis and subject to whatever Microsoft decides - which could be that it is no longer going to selectively enable it.

The official stance is that it is not supported for Azure SQL Database, and you should use the official stance in your decision making.

Yet here I am, with a working CLR assembly in Azure SQL Database.

For now, it may not stay that way. Maybe your organization had enough pull to get Microsoft to enable it for you.

So now I'm wondering, do I tell the business we have to switch to use Managed Instance because that's the only place that CLR is supported?

If you need to use CLR then yes. You can also not use cloud and run your own database server. There are also many other cloud hosts out there which can run CLR which may be cheaper/faster than MI.

0
4

it should not be possible to just use a new random CLR on Azure SQL Database. The only supported possibility would be if this specific CLR was already allowed before by Microsoft. Something is odd here. If you have a contact at Microsoft it might be a good idea to inform them.

PS: I used to own the process for handling CLR assemblies in Azure SQL DB at Microsoft, but I obviously can't get into details on how this is done.

0
-4

"Not supported" is not the same as "doesn't work". It is, however, the same as "Microsoft reserves the right to pull this particular rug out from under you at any time, and if that happens and you were depending on said rug you have nobody but yourself to blame".

So yes, you need to use Managed Instance. Or you could bring your software into the current decade and drop SQLCLR support.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.