You can use parameterization with environment-specific settings in the pipeline :
- Create Pipeline Parameters:
- In Azure Data Factory, open the pipeline you want to configure.
- Under the Pipeline pane, click Parameters.
- Add a new parameter that will store the environment-specific variable, such as
ServiceUrl
.
- Configure Pipeline Activities:
- In the activity (e.g., a web activity or linked service), find the property that needs to be parameterized.
- Set the property to the parameter created earlier using dynamic content, e.g.,
@pipeline().parameters.ServiceUrl
.
- Set Variable Values Per Environment (QA, PROD, TEST):
- Navigate to Manage → Triggers.
- Create environment-specific triggers (e.g., one for QA, one for PROD).
- Each trigger should pass the appropriate value for the parameter using the Pipeline Parameters section. For example, when the QA trigger runs, the parameter
ServiceUrl
is set tohttps://qa.example.com/api
, and for PROD, it ishttps://prod.example.com/api
.
- Create Global Parameters (Optional):
- Navigate to Manage → Global Parameters.
- Add parameters here if they are needed across multiple pipelines for each environment.
- Linked Service Parameterization (Optional):
- If your variable is linked to a service (like a database or storage account), open the linked service in the Manage pane.
- Under Connection String or other configurable properties, use parameters or dynamic content to make the service URL or credentials environment-specific.
- For example, use
@pipeline().parameters.ServiceUrl
or@dataset().connectionString
to parameterize the linked service.
- Publish and Deploy:
- Once your pipeline is parameterized, publish it to your data factory.
- When moving from one environment to another (e.g., from QA to PROD), you can modify the values in the respective triggers to ensure they match the new environment.