Azure SQL MI: CLR Assemblies are marked as SAFE or EXTERNAL_ACCESS are considered UNSAFE

Santhamoorthy M 161 Reputation points
2021-12-23T12:37:45.953+00:00

hi,

I have assessed my on premise sql server DBs using DMA and it is showing this unsupported features 'CLR Assemblies are marked as SAFE or EXTERNAL_ACCESS are considered UNSAFE'.

I could able to migrate the DB with assemblies and i dont see any issues in the migration but im not sure why this unsupported feature was showing in the assessment report. Could someone please confirm if I need to do some changes in the assemblies after the migration?

sql version 2012

160020-image.png

Target Azure Managed Instance post migration:
160121-image.png

Thanks,
Santha

Azure Database Migration service
Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
772 questions
SQL Server Migration Assistant
SQL Server Migration Assistant
A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.
568 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YufeiShao-msft 7,146 Reputation points
    2021-12-24T03:08:51.853+00:00

    Hi @Santhamoorthy M ,

    When upgrading a server, the feature is turned off for backward compatibility in SQL Server, 'CLR strict security' will be set to 0, but it is not recommended.

    running the following command:

    SELECT * FROM sys.configurations WHERE name LIKE 'clr strict security';  
    

    the value of 1 means that the CLR strict security is switched on

    To set the value to 1:

    EXEC sp_configure 'clr strict security',1;  
    GO  
    RECONFIGURE;  
    GO  
    

    you can add the CLR strict security feature to Microsoft SQL Server from KB4018930

    Additional:
    https://stackoverflow.com/questions/44083098/clr-strict-security-on-sql-server-2017#:~:text=Beginning%20with%20SQL%20Server%202017%2C%20an%20sp_configure%20option,EXTERNAL_ACCESS%20assemblies%20as%20if%20they%20were%20marked%20UNSAFE.
    https://www.sqlshack.com/impact-clr-strict-security-configuration-setting-sql-server-2017/

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.