title: How to enable SQL Authentication with ARM Template?
body: <p>I have an ARM template which deploys multiple Azure VMs with the following images:</p>
  
  <pre><code>    "SQL2008R2SP3-WS2008R2SP1",
      "SQL2012SP4-WS2012R2",
      "SQL2014SP2-WS2012R2",
      "SQL2016SP2-WS2016",
      "SQL2017-WS2016"
  </code></pre>
  
  <p>The SQLIaaS VM Extension is not leaving the SQL Server in SQL Authentication mode, and not creating the SQL Authentication account. Otherwise everything else works fine. Here's the snippet for the SQLIaaS part of the ARM template. Any ideas why SQL Auth is not being set up?</p>
  
  <pre><code>{
        "apiVersion": "2015-06-15",
        "type": "Microsoft.Compute/virtualMachines/extensions",
        "name": "[concat(parameters('virtualMachineName'), copyIndex(1), '/SqlIaasExtension')]",
        "location": "[parameters('location')]",
        "condition": "[parameters('deploySqlIaasExtension')]",
        "tags": {
          "displayName": "SQLIaas VM Extension"
        },
        "dependsOn": [
          "[concat(parameters('virtualMachineName'),copyIndex(1))]",    
          "[concat('Microsoft.Storage/storageAccounts','/', variables('storageNameSQLBackups'))]"
        ],
        "copy": {
          "name": "virtualMachineExtensionsGroup",
          "count": "[parameters('sqlServerCount')]"
        },
        "properties": {
          "type": "SqlIaaSAgent",
          "publisher": "Microsoft.SqlServer.Management",
          "typeHandlerVersion": "1.2",
          "autoUpgradeMinorVersion": "true",
          "settings": {
            "AutoTelemetrySettings": {
              "Region": "[parameters('location')]"
            },
            "AutoPatchingSettings": {
              "PatchCategory": "WindowsMandatoryUpdates",
              "Enable": true,
              "DayOfWeek": "Sunday",
              "MaintenanceWindowStartingHour": "0",
              "MaintenanceWindowDuration": "240"
            },
            "AutoBackupSettings": {
              "Enable": true,
              "RetentionPeriod": "[parameters('sqlAutobackupRetentionPeriod')]",
              "EnableEncryption": false,
              "BackupSystemDbs": "[parameters('backupSystemDbs')]"
            },
            "ServerConfigurationsManagementSettings": {
              "SQLConnectivityUpdateSettings": {
                "ConnectivityType": "Public",
                "Port": "[parameters('sqlPortNumber')]"
              },
              "SQLWorkloadTypeUpdateSettings": {
                "SQLWorkloadType": "General"
              },
              "AdditionalFeaturesServerConfigurations": {
                "IsRServicesEnabled": "false"
              }
            },
            "protectedSettings": {
              "SQLAuthUpdateUserName": "[parameters('sqlAuthenticationLogin')]",
              "SQLAuthUpdatePassword": "[parameters('sqlAuthenticationPassword')]"
            }
          }
        }
      }
  </code></pre>