Forum Discussion

AswanyT's avatar
AswanyT
Frequent Visitor
1 year ago
Solved

403 Forbidden Error When Calling New-FabricWorkspace in PowerShell – Was Working Earlier

 

Hi Team,

I'm encountering an issue while trying to call the Fabric REST API to create/get a workspace ID using PowerShell. The script was working fine until 19-May-2025, but it started failing from 20-May-2025 with the following error:

 

powershell
Import-Module ".\modules\FabricPS-PBIP" -Force
$workspaceId = New-FabricWorkspace -name $workspaceName -skipErrorIfExists

 

The second line throws below exception:

Exception: Response status code does not indicate success: 403 (Forbidden).; API error code: 'FeatureNotAvailable'
 
  • I have an App Registration created in Azure and am using that spn for authentication.

  • No changes were made to the script or permissions from my side around the time the issue started.

Could someone please help me understand why this error is occurring now? Was there any recent change in Fabric API availability, permissions, or licensing that could cause this?

Thanks in advance!

  • Hi AswanyT,

    • If possible,use managed identity tied to a user that has the necessary Power BI and Fabric admin rights. user principals generally have fewer restrictions in tenant-level operations like workspace creation.
    • If creating new workspaces isn't mandatory in your flow, you can: Pre-create a set of workspaces manually or via user login. Use those workspaces via their ID or name for subsequent automation.

     

    Thanks,

    Prashanth Are

    MS Fabric community support

     

7 Replies

  • Hi AswanyT  It might be due to recent changes in Fabric API permissions or availability. Verify if API updates or restrictions were introduced post-May 19, 2025. Ensure your App Registration has the required permissions like Workspace.ReadWrite.All and re-consent if needed. Also, check for license or feature restrictions and validate Service Principal authentication

  • AswanyT's avatar
    AswanyT
    Frequent Visitor

    Hi Akash_Varuna , All required permissions are granted in app registration. Also I am able to authenticate using spn. I am also able to perform below operations

    Import-FabricItems -workspaceId $workspaceId -path "{pbip_path}"
    Export-PowerBIReport -Id $reportId -WorkspaceId $workspaceId -OutFile "{saved_pbix_file_path}"
    Only issue is not able fetch workspaceid using below line 
    $workspaceId = New-FabricWorkspace -name $workspaceName -skipErrorIfExists
    • v-prasare's avatar
      v-prasare
      Community Support

      Hi AswanyT,

      • If possible,use managed identity tied to a user that has the necessary Power BI and Fabric admin rights. user principals generally have fewer restrictions in tenant-level operations like workspace creation.
      • If creating new workspaces isn't mandatory in your flow, you can: Pre-create a set of workspaces manually or via user login. Use those workspaces via their ID or name for subsequent automation.

       

      Thanks,

      Prashanth Are

      MS Fabric community support

       

  • v-prasare's avatar
    v-prasare
    Community Support

    AswanyT,

    As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?

     

     

     

    Thanks,

    Prashanth Are

    MS Fabric community support

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

  • v-prasare's avatar
    v-prasare
    Community Support

    @AswanyT,

    As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?

     

     

     

    Thanks,

    Prashanth Are

    MS Fabric community support

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

  • v-prasare's avatar
    v-prasare
    Community Support

    @AswanyT,

    As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?

     

     

     

    Thanks,

    Prashanth Are

    MS Fabric community support

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

  • I have the exact same issue. It seems there are some changes introduced that the FabricPS-PBIP module cant handle properly. I switched to manually create the workspace with a fixed name and assign admin role to spn and then use this: 

    $workspaceId = (Get-FabricWorkspace $workspaceName).id