Forum Discussion

powerbiexpert22's avatar
powerbiexpert22
Impactful Individual
10 months ago
Solved

Power BI API for license allocation

is there an API in power BI which can be used for allocation license such as Pro, PPU or Premium Capacity. I found below document however this is for allocating visual license to user 

 

https://learn.microsoft.com/en-us/power-bi/developer/visuals/licensing-api

 

4 Replies

  • Not sure exactly why you want to do that from Power BI but I'd probably suggest making a group within Azure that's linked to the licenses. Then a Power Automate flow that once clicked, it will go and add the user to the group (giving that user a license). From an Azure side of things, it's better to handle licenses like this. 

    Also, it probably makes more sense to have a PowerApp to do this rather than a Power BI report. Power BI is normally just meant for viewing as opposed to "Doing" things. You can do it with a Power Automate button and you could even add in APIs to that PA flow to do whatever you want. 

    Hope that helps.

  • Thankyou, pbiuseruk, for your response.

    Hi powerbiexpert22,

    We appreciate your inquiry through the Microsoft Fabric Community Forum.

    Based on my understanding, the Power BI REST API does not support direct assignment of user licenses such as Pro, PPU, or Premium. License assignment for Power BI users is managed at the Microsoft Entra ID (Azure AD) or Microsoft 365 licensing layer and cannot be performed directly through Power BI APIs.

    Please follow the approach below, which may help resolve the issue:

    1. Create an Azure AD security group and assign the required Power BI SKU (Pro or PPU) to that group. Automate adding users to this group using Power Automate or a Power App to streamline the license allocation process.
    2. Use the Microsoft Graph endpoint to assign licenses programmatically:
      POST https://graph.microsoft.com/v1.0/users/{id}/assignLicense
      You can retrieve your SKU ID using GET /subscribedSkus.
    3. Use the Power BI REST API to assign a workspace to a Premium capacity.

    Additionally, please refer to the links provided below:
    Microsoft Entra licensing - Microsoft Entra | Microsoft Learn
    user: assignLicense - Microsoft Graph v1.0 | Microsoft Learn
    List subscribedSkus - Microsoft Graph v1.0 | Microsoft Learn
    Capacities - Groups AssignToCapacity - REST API (Power BI Power BI REST APIs) | Microsoft Learn

    We hope the information helps resolve your issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.

    Thank you.

  • Hi powerbiexpert22,

    We would like to follow up and see whether the details we shared have resolved your problem.
    If you need any more assistance, please feel free to connect with the Microsoft Fabric community.

    Thank you.

  • Hi powerbiexpert22,

    We are following up to see if what we shared solved your issue. If you need more support, please reach out to the Microsoft Fabric community.

    Thank you.