Forum Discussion

anusha_madhavan's avatar
anusha_madhavan
Frequent Visitor
1 year ago
Solved

Formula.Firewall, please rebuild this data combination error

Hi Team, 

I am using an ADO based API in my PowerBI m query and I am facing "Formula.Firewall: Query 'Dependency Alerts' (step 'FinalTable') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination." error. Can someone guide on how to fix this query without making changes to the Privacy settings?

 

Here's my Dependency Alerts query: 

let

    // Filter the source table to include only rows where Advanced Security is enabled

    Source = #"AdSec - Org level Alerts(pagination)",

    Project = Source[projectName],

    Repo = Source[repos.repoName],

 

    // Function to fetch repo-wise Advanced Security details with continuationToken

    FetchRepoAdSec = (Project as text, Repo as text, token as nullable text) =>

        let

            URL = "https://advsec.dev.azure.com/{org}/"&Project&"/_apis/Alert/repositories/"&Repo&"/Alerts?top=50&orderBy=severity&criteria.alertType=dependency&criteria.states=active",

            URLWithContinuation = if token = null then URL else URL & "&continuationToken=" & token,

            AlertSource = try VSTS.Contents(URLWithContinuation) otherwise null,

            JsonResponse = if AlertSource <> null then try Json.Document(AlertSource, 65001) otherwise null else null,

            value = if JsonResponse <> null then JsonResponse[value] else null,

            continuationToken = if AlertSource <> null then try Value.Metadata(AlertSource)[Headers][#"x-ms-continuationtoken"]? otherwise null else null,

            Result = if continuationToken = null then value else value & @FetchRepoAdSec(Project, Repo, continuationToken)

        in

            if JsonResponse <> null then Result else {null},

 

   // Add the fetched repo-wise Advanced Security details to the main table updated

    RepoAdSecDetails = Table.AddColumn(Source, "RepoAdSecDetails", each Table.FromList(FetchRepoAdSec([projectName], [repos.repoName], null), Splitter.SplitByNothing(), null, null, ExtraValues.Error)),

    FinalTable = Table.SelectColumns(RepoAdSecDetails, {"projectName", "repos.repoName", "RepoAdSecDetails"})

 in                                                                                                                                                                                                                   FinalTable

2 Replies