SQLDacApplication [SPFSDK][VMROLE]
Applies To: Windows Azure Pack
The SQLDacApplication object provides settings to install SQL Server data-tier applications (DACs) when a Windows-based virtual machine is provisioned.
{
"DeploymentName": "string",
"ScriptCommands": [
<Script>
],
"SQLScriptCommands": [
{
"DatabaseName": "string",
"DeploymentOrder": integer,
"EncryptConnection": boolean,
"ExecutionTimeoutSeconds": integer,
"LoginTimeoutSeconds": integer,
"OutputFilePath": "string",
"SQLAuthenticationType": "string",
"CommandParameters": "string",
"SQLScriptApplicationPayloadId": "string",
"ScriptCredential": credential string,
"ScriptType": "string",
}
],
"ApplicationPayloadId": "string",
"BlockOnChanges": boolean,
"DacInstance": "string",
"IgnoreDataLoss": boolean,
"RollbackOnFailure": boolean,
"SQLAuthenticationType": "string",
"SQLDeploymentCredential": credential string,
"SQLInstance": "string",
"SkipPolicyValidation": boolean,
"UninstallMode": "string",
}
Name | Type | Required | Default value | Description |
|---|---|---|---|---|
DeploymentName | String | Yes | None | The name of the deployment. |
ScriptCommands | Array of Script [SPFSDK][VMROLE] | No | null | Scripts to run during provisioning. The only valid values for the Script.ScriptType property are:
|
SQLScriptCommands | Array of SQLScriptCommand | No | null | Transact SQL script commands that run with the installation of the SQL Server data-tier application. |
ApplicationPayloadId | String | Yes | None | The identifier of an ApplicationProfile.ApplicationPayload item. This payload must point to a Transact-SQL script .sql file. |
BlockOnChanges | Boolean | No | None | If true, indicates that the SQL Server data-tier application upgrade should fail if there is a database drift. For more information, seehttp://go.microsoft.com/fwlink/?LinkID=307133. |
DacInstance | String | Yes | None | The SQL Server data-tier application name of the instance of SQL Server. |
IgnoreDataLoss | Boolean | No | None | If true, indicates that a data loss error should be ignored on a SQL Server data-tier application upgrade. For more information, seehttp://go.microsoft.com/fwlink/?LinkID=307133. |
RollbackOnFailure | Boolean | Yes | None | If true, indicates that the database should be rolled back if there is an upgrade failure. For more information, seehttp://go.microsoft.com/fwlink/?LinkID=307133. |
SQLAuthenticationType | String | Yes | None | The type of authentication that is used to deploy the SQL Server data-tier application. Valid values are:
|
SQLDeploymentCredential | String | Yes | None | The credential to use during the installation of the SQL Server data-tier application, in a domain\username:password format. |
SQLInstance | String | No | MSSQLSERVER | The name of the instance of SQL Server to which the SQL Server data-tier application is to be deployed. |
SkipPolicyValidation | Boolean | Yes | None | If true, indicates that the SQL Server policy validation should be skipped when a SQL Server data-tier application is upgraded. For more information, seehttp://go.microsoft.com/fwlink/?LinkID=307133. |
UninstallMode | String | Yes | None | The uninstall behavior of the SQL Server data-tier application regarding the database. Valid values are:
For more information, seehttp://go.microsoft.com/fwlink/?LinkID=307135. |
For more information about the Virtual Machine ManagerWindows PowerShell script that is used by this section, see http://go.microsoft.com/fwlink/?LinkID=218391.
Name | Type | Required | Default value | Description |
|---|---|---|---|---|
DatabaseName | String | Yes | None | The name of the database against which this script command is run. |
DeploymentOrder | Int | Yes | None | The order in which to run this script command. |
EncryptConnection | Boolean | No | False | If true, indicates the encryption of the connection to the instance of SQL Server. |
ExecutionTimeoutSeconds | Int | Yes | None | The time-out for the script command, in seconds. |
LoginTimeoutSeconds | Yes | Yes | None | The time-out to establish a connection to the instance of SQL Server, in seconds. |
OutputFilePath | String | No | None | The log file path to capture all output. |
SQLAuthenticationType | String | Yes | None | The type of authentication that is used to deploy the SQL Server data-tier application. Valid values are:
|
CommandParameters | String | No | null | Name-value pairs of command parameters to use with the SQL command. For more information, see the -v switch of the Sqlcmd tool documentation at http://go.microsoft.com/fwlink/?LinkID=154481. |
SQLScriptApplicationPayloadId | String | Yes | None | The identifier of an ApplicationProfile.ApplicationPayload item. This payload must point to a Transact SQL script .sql file. |
ScriptCredential | String | Yes | None | The credential that is used to run the script, in a domain\username:password format. |
ScriptType | String | Yes | None | The specification for when the script should be run. Valid values are:
|
The following code example provides a sample SQLDacApplication object.
{
"DeploymentName": "SQL App 1",
"ScriptCommands": [
{
"AlwaysReboot": false,
"ApplicationPayloadId": null,
"ErrorPolicy": "FailOnMatch",
"ExecutableAndParams": null,
"ExitCodeRegex": "[1-9][0-9]*",
"MaxOutputSize": 1048576,
"RebootExitCodeRegex": "{1641}|{3010}|{3011}",
"RestartOnRetry": false,
"ScriptBlock": "rem some script that needs to run before sqldac package is installed",
"ScriptCredential": {
"Password": "mypassword4",
"UserName": "dcmanagerlab\\esdcvsec4"
},
"ScriptType": "PreInstall",
"StandardErrorPath": "c:\\err.txt",
"StandardErrorRegex": ".+",
"StandardInput": null,
"StandardOutputPath": "c:\\out.txt",
"StandardOutputRegex": null,
"TimeoutInSeconds": 900,
"WorkingDirectory": null
}
],
"SQLScriptCommands": [
{
"DatabaseName": "[Param.SharepointDB]",
"DeploymentOrder": 1,
"EncryptConnection": false,
"ExecutionTimeoutSeconds": 500,
"LoginTimeoutSeconds": 50,
"OutputFilePath": "c:\\sharepointDB.sql.log",
"SQLAuthenticationType": "WindowsAuthentication",
"CommandParameters" : "VAR1=42 VAR2=\"Example String\"",
"SQLScriptApplicationPayloadId": "db04416b-d0a8-44d5-b0ee-d5739378a98d",
"ScriptCredential": "[Param.SQLScriptCommandCredential]",
"ScriptType": "PostInstall"
}
],
"ApplicationPayloadId": "5b064b6a-d6d0-48f0-8979-9aafc676a9e5",
"BlockOnChanges": false,
"DacInstance": "[Param.SharepointDB]",
"IgnoreDataLoss": false,
"RollbackOnFailure": true,
"SQLAuthenticationType": "WindowsAuthentication",
"SQLDeploymentCredential": "[param.SQLDeploymentCredential]",
"SQLInstance": "[Param.SQLInstance]",
"SkipPolicyValidation": true,
"UninstallMode": "DropDatabase"
}