简体   繁体   中英

Redeployment of Azure SQL server VM complains about collation

I face a strange issue with redeployment of an Azure SQL virtual machine with SQL server standard edition. I use Bicep for the deployment.

First deployment and even a few consecutive deployments work fine, no errors at all, everything works ("provisioning status is succeeded" for all resources).

Then, suddenly, I get this error when redeploying (with no changes to the templates:):

{
    "status": "Failed",
    "error": {
        "code": "SqlServerSettingCollationNotAllowedToUpdate",
        "message": "SQL Server collation is not allowed to be updated in manageability."
    }
}

But I did NOT change the collation. The related resource definition still looks like this:

sqlInstanceSettings: {
        maxDop: 0
        isOptimizeForAdHocWorkloadsEnabled: false
        collation: 'Latin1_General_CI_AS'
        minServerMemoryMB: 0
        maxServerMemoryMB: 2147483647
        isLpimEnabled: false
        isIfiEnabled: false
}

The deployed VM works and the server has correct collation. When I comment out the collation in Bicep, the deployment succeeds.

I cannot afford to comment out the collation, because when creating a new environment, it would create the VM with wrong one.

Any ideas what may cause this or how to get rid of the error?

• You are encountering this error because the Azure SQL VM provider doesn't provide the capability to specify the SQL Server collation when the resource is created by rerunning the same deployment . Thus, when you are rerunning the Azure SQL VM deployment through the specified bicep template, the necessary SQL instance specific login IDs are removed after rerunning the SQL Server installation, thus effectively moving the SQL VM in an unmanaged state .

Also, the two SQL instance specific login IDs required for resolving this issue are 'NT Service\SQLTelemetry' and 'NT Service\SqlIaaSExtensionQuery' which are needed to be created through Windows login in the SQL Server by restarting the SQL Server in single user mode . Once created, then these two IDs need to be assigned the 'sysadmin' server role and added in the 'Security - Login' group .

Kindly refer the below technet documentation link for detailed information regarding this and refer the given below link by Tao Yang which describes the scenario: -

https://social.technet.microsoft.com/wiki/contents/articles/52483.sql-server-on-azure-vm-troubleshooting-can-t-access-the-sql-server-configuration-page-from-the-portal.aspx

https://blog.tyang.org/2022/01/13/azure-sql-vm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM