简体   繁体   English

重新部署Azure SQL 服务器VM报错整理

[英]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.在使用 SQL 服务器标准版重新部署 Azure SQL 虚拟机时,我遇到了一个奇怪的问题。 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.部署的 VM 工作正常,服务器具有正确的排序规则。 When I comment out the collation in Bicep, the deployment succeeds.当我注释掉 Bicep 中的排序规则时,部署成功。

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 . • 您遇到此错误是因为Azure SQL VM 提供程序不提供通过在创建相同资源时重新运行部署服务器排序规则来指定 SQL 服务器排序规则的功能 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 . 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 . 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 .创建后,需要为这两个 ID 分配“sysadmin”服务器角色并添加到“Security - Login”组中。

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://social.technet.microsoft.com/wiki/contents/articles/52483.sql-server-on-azure-vm-troubleshooting-can-t-access-the-sql-server-configuration-page-from-门户网站.aspx

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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