I wan use Show billing report by pipeline in ADF, and enabled this via CI/CD

Benjamin Baele 25 Reputation points Microsoft Employee
2024-07-03T15:15:45.9433333+00:00

I want enabled the feature "Show billing report by pipeline " in azure Data Factory, but I don't know how can I enabled this via Terraform deployment or ARM template deployment. How Can I do that ?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,639 questions
{count} votes

Accepted answer
  1. phemanth 15,765 Reputation points Microsoft External Staff Moderator
    2024-07-06T04:50:37.94+00:00

    @Benjamin Baele

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer .

    Ask: Trying to create a schema for an external table on the serverless SQL pool in Azure Synapse Analytics. The error message they received indicates that the specified schema name either does not exist or they do not have permission to use it.

    Solution: Infortunatly Azure CLI doesn't not support this feature also: https://learn.microsoft.com/en-us/cli/azure/datafactory?view=azure-cli-latest#az-datafactory-update

    I find a solution with REST API call, executed by Powershell. I share my script to help other users:

    param(
        [string]$subscriptionId,
        [string]$resourceGroupName,
        [string]$dataFactoryName,
        [bool]$pipelineBillingEnabled = $true
    )
    $uri = "https://management.azure.com/subscriptions/" + $subscriptionId +  "/resourceGroups/" + $resourceGroupName + "/providers/Microsoft.DataFactory/factories/" + $dataFactoryName + "?api-version=2018-06-01"
    $body = @{
        properties = @{
            globalConfigurations = @{
                PipelineBillingEnabled = $pipelineBillingEnabled
            }
        }
    } | ConvertTo-Json
    $token = (Get-AzAccessToken -ResourceUrl "https://management.azure.com").Token
    $headers = @{
        "Authorization" = "Bearer $token"
        "Content-Type" = "application/json"
    }
    $response = Invoke-WebRequest -Uri $uri -Method Patch -Headers $headers -Body $body 
    if ($response.StatusCode -eq 200) {
        Write-Host "Data Factory resource updated successfully."
    } else {
        Write-Host "Failed to update Data Factory resource. Status code: $($response.StatusCode)"
    }
    

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    Was this answer helpful?Yes

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.