# Set the subscription ID, resource group name, and data factory name $subscription_id = "{subscription-id}" $resource_group = "{resource-group-name}" $data_factory = "{data-factory-name}" # Get the comma separated list of CDC names from the environment variable $cdc_names = $env:CDC_NAMES # Split the list by comma and store it in an array $cdc_array = $cdc_names -split "," # Loop through each CDC name in the array foreach ($cdc_name in $cdc_array) { Write-Output "Starting CDC = $($cdc_name)" # Start the CDCs $start_response = Invoke-AzRestMethod -Method POST -Path "/subscriptions/$subscription_id/resourcegroups/$resource_group/providers/Microsoft.DataFactory/factories/$data_factory/adfcdcs/$cdc_name/Start?api-version=2018-06-01" Write-Output "Starting CDC = $cdc_name status = $($start_response.StatusCode)" }