首页 > 解决方案 > 如何使用 SqlIaasExtension 扩展启用 SQL 身份验证

问题描述

我正在尝试配置 SqlIaasExtension 扩展以发布配置 SQL Server VM 以使用 SQL 身份验证,同时还指定 sqlUser 和 sqlPassword。扩展部署成功,但从未启用 SQL 身份验证方法。我似乎找不到可以帮助告诉我我缺少什么的资源管理器文档。似乎另一个人也有类似的问题,但问题自己解决了(我的没有)。

如何使用 ARM 模板启用 SQL 身份验证?

{
          "apiVersion": "2015-06-15",
          "type": "extensions",
          "name": "SqlIaasExtension",
          "location": "[resourceGroup().location]",
          "condition": "[parameters('deployVMs')]",
          "tags": {
            "displayName": "SQLIaas VM Extension"
          },
          "dependsOn": [
            "[concat('vm-ssis-', parameters('environment.prefix'))]"
          ],
          "properties": {
            "type": "SqlIaaSAgent",
            "publisher": "Microsoft.SqlServer.Management",
            "typeHandlerVersion": "1.2",
            "autoUpgradeMinorVersion": "true",
            "settings": {
              "AutoTelemetrySettings": {
                "Region": "[resourceGroup().location]"
              },
              "AutoPatchingSettings": {
                "PatchCategory": "WindowsMandatoryUpdates",
                "Enable": true,
                "DayOfWeek": "Sunday",
                "MaintenanceWindowStartingHour": "0",
                "MaintenanceWindowDuration": "240"
              },
              "ServerConfigurationsManagementSettings": {
                "SQLConnectivityUpdateSettings": {
                  "ConnectivityType": "Private",
                  "Port": "1433",
                  "SQLAuthUpdateUserName": "[parameters('admin.username')]",
                  "SQLAuthUpdatePassword": "[parameters('admin.password')]"
                },
                "SQLWorkloadTypeUpdateSettings": {
                  "SQLWorkloadType": "General"
                },
                "AdditionalFeaturesServerConfigurations": {
                  "IsRServicesEnabled": "false"
                }
              },
              "protectedSettings": {
                "SQLAuthUpdateUserName": "[parameters('admin.username')]",
                "SQLAuthUpdatePassword": "[parameters('admin.password')]"
              }
            }
          }
        }

标签: sql-serverarm-template

解决方案


有同样的问题,因为我将“protectedSettings”部分放在错误的位置。“protectedSettings”部分是“设置”部分的兄弟,而不是子部分。

{
   ...
   "properties": {
       ...
       "settings": {
           ...
       },
       "protectedSettings": {
           "SQLAuthUpdateUserName": "[parameters('admin.username')]",
           "SQLAuthUpdatePassword": "[parameters('admin.password')]"
       }
   }
}

推荐阅读