Muokkaa

Jaa


AzureMysqlDeployment@1 - Azure Database for MySQL deployment v1 task

Use this task to run your scripts and make changes to your database in Azure Database for MySQL. The Azure Database for MySQL Deployment task only works with Azure Database for MySQL Single Server.

Syntax

# Azure Database for MySQL deployment v1
# Run your scripts and make changes to your Azure Database for MySQL.
- task: AzureMysqlDeployment@1
  inputs:
    azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure Subscription. 
  # DB Details
    ServerName: # string. Required. Host Name. 
    #DatabaseName: # string. Database Name. 
    SqlUsername: # string. Required. Server Admin Login. 
    SqlPassword: # string. Required. Password. 
  # Deployment Package
    #TaskNameSelector: 'SqlTaskFile' # 'SqlTaskFile' | 'InlineSqlTask'. Type. Default: SqlTaskFile.
    SqlFile: # string. Required when TaskNameSelector = SqlTaskFile. MySQL Script. 
    #SqlInline: # string. Required when TaskNameSelector = InlineSqlTask. Inline MySQL Script. 
    #SqlAdditionalArguments: # string. Additional MySQL Arguments. 
  # Firewall
    IpDetectionMethod: 'AutoDetect' # 'AutoDetect' | 'IPAddressRange'. Required. Specify Firewall Rules Using. Default: AutoDetect.
    #StartIpAddress: # string. Required when IpDetectionMethod = IPAddressRange. Start IP Address. 
    #EndIpAddress: # string. Required when IpDetectionMethod = IPAddressRange. End IP Address. 
    #DeleteFirewallRule: true # boolean. Delete Rule After Task Ends. Default: true.
# Azure Database for MySQL Deployment v1
# Run your scripts and make changes to your Azure Database for MySQL.
- task: AzureMysqlDeployment@1
  inputs:
    azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure Subscription. 
  # DB Details
    ServerName: # string. Required. Host Name. 
    #DatabaseName: # string. Database Name. 
    SqlUsername: # string. Required. Server Admin Login. 
    SqlPassword: # string. Required. Password. 
  # Deployment Package
    #TaskNameSelector: 'SqlTaskFile' # 'SqlTaskFile' | 'InlineSqlTask'. Type. Default: SqlTaskFile.
    SqlFile: # string. Required when TaskNameSelector = SqlTaskFile. MySQL Script. 
    #SqlInline: # string. Required when TaskNameSelector = InlineSqlTask. Inline MySQL Script. 
    #SqlAdditionalArguments: # string. Additional MySQL Arguments. 
  # Firewall
    IpDetectionMethod: 'AutoDetect' # 'AutoDetect' | 'IPAddressRange'. Required. Specify Firewall Rules Using. Default: AutoDetect.
    #StartIpAddress: # string. Required when IpDetectionMethod = IPAddressRange. Start IP Address. 
    #EndIpAddress: # string. Required when IpDetectionMethod = IPAddressRange. End IP Address. 
    #DeleteFirewallRule: true # boolean. Delete Rule After Task Ends. Default: true.

Inputs

azureSubscription - Azure Subscription
Input alias: ConnectedServiceName. string. Required.

This is needed to connect to your Azure account.

To configure a new service connection, select the Azure subscription from the list and click Authorize.

If your subscription is not listed or if you want to use an existing Service Principal, you can setup an Azure service connection using the Add or Manage buttons.


ServerName - Host Name
string. Required.

The name of your Azure Database for MySQL server.

Example: fabrikam.mysql.database.azure.com

The server name is provided in the Azure portal on the 'Overview' blade of your Azure Database for MySQL server resource.

When you connect using MySQL Workbench, this is the same value that is used for Hostname in Parameters.


DatabaseName - Database Name
string.

Optional. The name of the database. The script will create a database name if one does not exist.

If not specified, ensure that the database is referenced in the supplied SQL file or inline SQL, where needed.

Note: MySQL database names are case-sensitive.


SqlUsername - Server Admin Login
string. Required.

The Azure Database for MySQL server supports native MySQL authentication. You can connect and authenticate to a server with the server's admin login. Example: bbo1@fabrikam.

When you connect using MySQL Workbench, this is the same value that is used for Username in Parameters.


SqlPassword - Password
string. Required.

The administrator password for Azure Database for MySQL. In case you don’t recall the password, you can change the password from Azure portal.

This string can be defined with a variable in the pipeline. Example: $(password).

Also, you may mark the variable type as secret to secure it.


TaskNameSelector - Type
string. Allowed values: SqlTaskFile (MySQL Script File), InlineSqlTask (Inline MySQL Script). Default value: SqlTaskFile.

Optional. Selects one of the options between Script File & Inline Script.

  • SqlTaskFile (default), for use with the SqlFile argument
  • InlineSqlTask, for use with the SqlInline argument.

Note: these values are case-sensitive.


SqlFile - MySQL Script
string. Required when TaskNameSelector = SqlTaskFile.

The full path of the script file on the automation agent or on a UNC path accessible to the automation agent. For example: \BudgetIT\DeployBuilds\script.sql.

Predefined system variables, such as $(agent.releaseDirectory), and files containing SQL statements can be used here.​

Note: The MySQL client prefers Unix style paths, so from version 1.183.0 on, the task will convert Windows style paths to Unix style paths. Example: from c:\foo\bar\myscript.sql to c:/foo/bar/myscript.sql.

When the task is used on Linux platforms, paths remain unchanged. There is no need to escape special characters in paths.


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

Enters the MySQL script to execute on the database selected above.


SqlAdditionalArguments - Additional MySQL Arguments
string.

Optional. The additional options supported by the MySQL client. These options are applied when executing the given file on the Azure Database for MySQL.​

Example: You can change to the default tab separated output format, to HTML, or even to the XML format. Other examples include:

  • --comments to strip comments sent from the client to the server.
  • --quick to prevent result caching.
  • --xml to output results as XML.

All available options are described in the MySQL client documentation.


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

For the successful execution of the task, we need to enable administrators to access the Azure Database for MySQL Server from the IP Address of the automation agent.

By selecting auto-detect, you can automatically add a firewall exception for the range of possible IP addresses of automation agents, ​or you can explicitly specify the range.

Accepted values:

  • AutoDetect to auto-detect the automation agent's public IP address.
  • IPAddressRange to explicitly specify the IP address range to configure. Set the IP address range using the StartIpAddress and EndIpAddress parameters.

Note: These values are case-sensitive.


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

The starting IP Address of the automation agent machine pool. For example: 196.21.30.50.


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

The ending IP Address of the automation agent machine pool. For example: 196.21.30.65.


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

Optional. If selected, the added exception for the IP addresses of the automation agent will be removed for the corresponding Azure Database for MySQL.


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 run your scripts and make changes to your database in Azure Database for MySQL. Note that this is a preview version. The Azure Database for MySQL Deployment task only works with Azure Database for MySQL Single Server.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.100.0 or greater
Task category Deploy