Sdílet prostřednictvím


SqlAzureDacpacDeployment@1 - Azure SQL Database deployment v1 task

Use this task to deploy an Azure SQL database using DACPAC, or run scripts using SQLCMD.

Inputs

azureConnectionType - Azure Connection Type
Input alias: ConnectedServiceNameSelector. string. Allowed values: ConnectedServiceName (Azure Classic), ConnectedServiceNameARM (Azure Resource Manager). Default value: ConnectedServiceNameARM.


azureClassicSubscription - Azure Classic Subscription
Input alias: ConnectedServiceName. string. Required when ConnectedServiceNameSelector = ConnectedServiceName.

Specifies the target Azure classic subscription for deploying SQL files.


azureSubscription - Azure Subscription
Input alias: ConnectedServiceNameARM. string. Required when ConnectedServiceNameSelector = ConnectedServiceNameARM.

Specifies the target Azure Resource Manager subscription for deploying SQL files.


ServerName - Azure SQL Server Name
string. Required.

Specifies the Azure SQL Server name, like Fabrikam.database.windows.net,1433 or Fabrikam.database.windows.net.


DatabaseName - Database Name
string. Required.

Specifies the name of the Azure SQL database where the files are deployed.


SqlUsername - Server Admin Login
string.

Specifies the Azure SQL Server administrator login or Active Directory user name.


SqlPassword - Password
string.

Specifies the password for the Azure SQL Server administrator. Variables defined in the build or release pipelines as $(passwordVariable) are accepted. You can mark the variable type as secret to secure it.


DacpacFile - DACPAC File
string. Required when TaskNameSelector = DacpacTask.

Specifies the location of the DACPAC file on the automation agent or on a UNC path that's accessible to the automation agent, like \\BudgetIT\Web\Deploy\FabrikamDB.dacpac. Predefined system variables, like $(agent.releaseDirectory), can also be used.


SqlFile - SQL Script
string. Required when TaskNameSelector = SqlTask.

Specifies the location of the SQL script file on the automation agent or on a UNC path that's accessible to the automation agent, like \\BudgetIT\Web\Deploy\FabrikamDB.sql. Predefined system variables, like $(agent.releaseDirectory), can also be used.


SqlInline - Inline SQL Script
string. Required when TaskNameSelector = InlineSqlTask.

Specifies the SQL script to execute on the previously selected database.


PublishProfile - Publish Profile
string. Optional. Use when TaskNameSelector = DacpacTask.

Provides fine-grained control over Azure SQL database creation or upgrades.
Specifies the path to the publish profile XML file on the automation agent machine or on a UNC share. If the publish profile contains secrets, like credentials, upload it to the secure files library where it is securely stored with encryption. Next, use the Download secure file task at the start of your pipeline to download it to the agent machine when the pipeline runs. Delete it when the pipeline is complete. Predefined system variables, like $(agent.buildDirectory) or $(agent.releaseDirectory), can also be used.


AdditionalArguments - Additional SqlPackage.exe Arguments
string. Optional. Use when TaskNameSelector = DacpacTask.

Specifies the additional SqlPackage.exe arguments that will be applied when deploying the Azure SQL database if the DACPAC option is selected, like /p:IgnoreAnsiNulls=True /p:IgnoreComments=True. These arguments will override the settings in the publish profile XML file (if provided).


SqlAdditionalArguments - Additional Invoke-Sqlcmd Arguments
string. Optional. Use when TaskNameSelector = SqlTask.

Specifies the additional Invoke-Sqlcmd arguments that are applied when executing the given SQL query on the Azure SQL database, like -ConnectionTimeout 100 -OutputSqlErrors.


InlineAdditionalArguments - Additional Invoke-Sqlcmd Arguments
string. Optional. Use when TaskNameSelector = InlineSqlTask.

Specifies the additional Invoke-Sqlcmd arguments that are applied when executing the given SQL query on the Azure SQL Database, like -ConnectionTimeout 100 -OutputSqlErrors.


IpDetectionMethod - Specify Firewall Rules Using
string. Required. Allowed values: AutoDetect, IPAddressRange. Default value: AutoDetect.

For the task to run, the IP address of the automation agent must be added to the Allowed IP Addresses in the Azure SQL Server's firewall. Select auto-detect to automatically add the firewall exception for the range of the possible IP address of the automation agent, or specify the range explicitly.


StartIpAddress - Start IP Address
string. Required when IpDetectionMethod = IPAddressRange.

Specifies the starting IP address of the automation agent machine pool, like 196.21.30.50.


EndIpAddress - End IP Address
string. Required when IpDetectionMethod = IPAddressRange.

Specifies the ending IP address of the automation agent machine pool, like 196.21.30.65.


DeleteFirewallRule - Delete Rule After Task Ends
boolean. Default value: true.

If selected, after the task ends, the IP addresses specified here are deleted from the Allowed IP Addresses list in the Azure SQL Server's firewall.


TaskNameSelector - Type
string. Allowed values: DacpacTask (SQL DACPAC File), SqlTask (SQL Script File), InlineSqlTask (Inline SQL Script). Default value: DacpacTask.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

Use this task to deploy an Azure SQL database using a DACPAC, or run scripts using SQLCMD.

Important

This task is only supported in a Windows environment. If you are trying to use Azure Active Directory (Azure AD) integrated authentication, you must create a private agent. Azure AD integrated authentication is not supported for hosted agents.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: sqlpackage
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.103.0 or greater
Task category Deploy