6.2 Deploying Your Changes via Azure DevOps

Tip: These YAML pipelines read from the Flyway project to know the locations of the target databases! When provisioning your databases, we updated the connections in Flyway Desktop to point to the newly created databases. If the pipeline encounters issues finding a database, double-check that your Flyway project has the correct and working connections to these databases. Refer back to Provisioning your Databases for more details and troubleshooting tips.

Remeber: If you need a trial key for Flyway Enterprise, you're in luck! You can easily get a free trial to explore the full range of features, onboard your team, or understand our offerings better via Flyway AutoPilot. Simply visit here to start your free trial today. If you have a contact at Redgate, you can also request a trial key for Flyway AutoPilot directly from them. Alternatively, you can reach out to the AutoPilot team at flywayap@red-gate.com for a license.

Step 1: Set Up an Azure DevOps Project (If Not Already Done)

If you haven't already set up an Azure DevOps project or imported your repository, head back to the Getting Your Repository Ready steps to ensure everything is configured properly.

Step 2: Setting Up an Azure DevOps Agent

  1. Provision an Agent:
    • To run the pipeline, you need an Azure DevOps Agent that can access the databases you provisioned earlier. The Agent must have connectivity to these databases, whether they are on localhost, a VM, or another server.
    • For more details on setting up an agent, refer to the official Azure DevOps agent documentation.

Step 3: Configure the Pipeline

  1. Edit the Azure DevOps YAML Pipeline:

    • Go to your Azure DevOps repository, open the Azure DevOps folder, and find the YAML file correct for you, you will find several YAML scripts clearly labeled with an OS suffix based on the operating system of your self-hosted runner (e.g., windows.yml, linux.yml)..
    • The file contains important parameters for deployment. Ensure that the following are correctly set:

    Key Parameters to Review:

    1. Connection Strings:
      • Your pipeline will use the 'Environment' parameters to pass connection strings from your Flyway Desktop project. No need to manually enter JDBC URLs — just ensure that the Flyway environment placeholders are accurate and have been pushed to your repository.
        Head to Provisioning Your Databases to see how this can be done!
    2. Flyway License Key:
      • In the YAML file, you'll see a placeholder for the FLYWAY_LICENSE_KEY. For quick testing, you can insert the license key directly into the file:
      FLYWAY_LICENSE_KEY: <your-license-key>

      Security Tip: While you can put the key inline for testing, we strongly recommend moving it to a secure variable or variable group for production implementation.

    3. SQL Authentication (if needed)
      If you're using SQL Authentication instead of Windows Authentication, you will need to provide the SQL Username and Password in the YAML file. Add the following parameters under the appropriate block in the YAML file:

Step 5: Run the Pipeline

  1. Create the Pipeline:

    • In Azure DevOps, go to Pipelines and click New Pipeline.
    • Choose Azure Repos Git and select the repository you created (by default, it’s named Flyway AutoPilot).
    • Select Existing Azure Pipelines YAML File and choose the YAML file you have been using
  2. Review the YAML and Run:

    • Review the file, ensure all settings (especially the connection strings and license key) are correct, and click Run.

Didn't find what you were looking for?