Problem with API REST Power BI Post Method


I am new to PowerShell and I don’t understand how to run this command, can you help me ?


  "capacityId": "0f084df7-c13d-451b-af5f-ed0c466403b2"

What I did but it doesn’t work :

$Body = @{
    capacityId = "blblblblbl"

Invoke-PowerBIRestMethod -Url "" -Method Post -Body ($Body|ConvertTo-Json)

Are you getting any error with the above statement ?

Hello @kvprasoon,

I did some testing so the code works when I use my account but not when I use a Service principal.