Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a unique problem that Microsoft support hasn't been able to solve.
My goal is to generate cost dashboards in Power BI by accessing an Azure government tenant. I am able to make API calls on the cost usage Microsoft page with the try it now feature and generate the data I would like. I understand the standard cost connectors do not work with government tenants, hence the need to customize this.
It is no problem to connect to the tenant using organizational credentials, however Power BI then tells me "Web.Contents with the Content option is only supported when connecting anonymously." I am using the Web.Contents options to pass the API key and secret, although I am unsure of the correct syntax.
Below are the details:
Power Query
let
url = "https://management.azure.com/subscription/{subscriptionID}/resourceGroups/{RG-name}/providers/Microsoft.CostManagement/query?api-version=2019-11-01",
body = "{
""type"": ""Usage"",
""timeframe"": ""TheLastMonth"",
""dataset"":
{
""granularity"": ""None"",
""aggregation"":
{
""totalCost"":
{
""name"": ""PreTaxCost"",
""function"": ""Sum""
}
},
""grouping"": [
{
""type"": ""Dimension"",
""name"": ""ResourceGroup""
}
]
}
}",
Parsed_JSON = Json.Document(body),
BuildQueryString = Uri.BuildQueryString(Parsed_JSON)m
Source = Json.Document(Web.Contents(url,[Headers = [#"Authentication-Key"="{API-key}", #"Authentication-Secret"="{API-secret}", #"Content-Type"="application/json"], Content = Text.ToBinary(body) ] ))
in
Source
Any guidance is much appreciaed.
Thank you,
S
Hi @bananajams ,
Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your problem.
Best Regards,
Stephen Tao
Hi @bananajams ,
The error message tells us that the connection is only supported when connecting anonymously. Please check whether your data source supports anonymous connections.
Please open Data Source Settings, then find the web data source, choose Anonymous like below:
Similar posts: https://community.powerbi.com/t5/Desktop/Web-Contents-with-the-Content-option-is-only-supported-when...
https://community.powerbi.com/t5/Desktop/Remote-API-Access-to-data-source-sudden-errors/m-p/627973
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
101 | |
49 | |
19 | |
12 | |
11 |