{"id":3900,"library":"azure-mgmt-powerbiembedded","title":"Microsoft Azure Power BI Embedded Management Client Library for Python","description":"This is the Microsoft Azure Power BI Embedded Management Client Library for Python, providing client-side functionality to manage Power BI Embedded workspace collections and retrieve workspaces within an Azure subscription. The library is currently at version 3.0.0 and follows the Azure SDK release cadence, with updates typically driven by new features or breaking changes in the underlying Azure API.","status":"active","version":"3.0.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","management","powerbi","embedded","sdk","cloud"],"install":[{"cmd":"pip install azure-mgmt-powerbiembedded","lang":"bash","label":"Install core package"},{"cmd":"pip install azure-identity","lang":"bash","label":"Install Azure Identity for authentication"}],"dependencies":[{"reason":"Required for modern Azure Active Directory token authentication using DefaultAzureCredential.","package":"azure-identity"},{"reason":"Requires Python 3.8 or higher.","package":"Python","optional":false}],"imports":[{"symbol":"PowerBIEmbeddedManagementClient","correct":"from azure.mgmt.powerbiembedded import PowerBIEmbeddedManagementClient"},{"symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.powerbiembedded import PowerBIEmbeddedManagementClient\n\n# Set environment variables for authentication and subscription ID:\n# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET (for service principal)\n# AZURE_SUBSCRIPTION_ID\n\n# For local development, DefaultAzureCredential will try various methods (env vars, managed identity, VS Code, Azure CLI, etc.)\ncredential = DefaultAzureCredential()\n\nsubscription_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"\")\nif not subscription_id:\n    raise ValueError(\"AZURE_SUBSCRIPTION_ID environment variable is not set.\")\n\nclient = PowerBIEmbeddedManagementClient(credential=credential, subscription_id=subscription_id)\n\n# Example: List Power BI Embedded workspace collections (replace with actual operation)\n# This is a placeholder as Power BI Embedded workspace collections are largely deprecated\n# and modern Power BI embedding relies on other APIs or Fabric capacity.\n# The management library is for managing the *Azure resource* itself, not the Power BI content.\n# For Power BI content interaction, refer to Power BI REST APIs and SDKs.\n# https://learn.microsoft.com/en-us/rest/api/power-bi/ \n\n# The Power BI Embedded A SKUs were deprecated in favor of Fabric F SKUs.\n# The management client would typically manage resources like capacity or workspace collections.\n# As workspace collections are deprecated, direct management with this client for new scenarios is less common.\n# For illustrative purposes, an older operation might look like:\n# collections = client.workspace_collections.list_by_resource_group(resource_group_name=\"myResourceGroup\")\n# for collection in collections:\n#     print(collection.name)\n\nprint(\"PowerBIEmbeddedManagementClient initialized. Operations may vary based on current Azure API status.\")","lang":"python","description":"Initializes the PowerBIEmbeddedManagementClient using `DefaultAzureCredential` for authentication. This example assumes environment variables like `AZURE_SUBSCRIPTION_ID`, `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_CLIENT_SECRET` are set for authentication. The client is used to manage Azure Power BI Embedded resources. Note that Power BI Embedded A SKUs and Workspace Collections have largely transitioned to Fabric F SKUs."},"warnings":[{"fix":"Migrate to `azure-identity` classes (e.g., `DefaultAzureCredential`) for authentication and update `credentials` parameter to `credential`.","message":"Version 3.0.0 introduced significant breaking changes to the credential system. Old `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported. The `credentials` parameter has been renamed to `credential`.","severity":"breaking","affected_versions":">=3.0.0 (from 2.x)"},{"fix":"Ensure all arguments passed to model constructors are keyword arguments (e.g., `MyModel(arg_name='value')` instead of `MyModel('value')`).","message":"Version 2.0.0 changed model signatures to use keyword-only arguments. Positional arguments for models must be rewritten as keyword arguments.","severity":"breaking","affected_versions":">=2.0.0 (from 1.x)"},{"fix":"Carefully follow the Azure SDK authentication guide and Power BI Embedded setup instructions for AAD application registration, secret creation, and granting appropriate API permissions and Power BI service roles to the service principal.","message":"Proper Azure Active Directory (AAD) application setup is crucial. Authentication requires setting specific environment variables (`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`). Additionally, the service principal often needs specific Power BI API permissions and role assignments in the Power BI service or workspace, not just general Azure 'Owner' roles.","severity":"gotcha","affected_versions":"All"},{"fix":"For new Power BI embedding solutions, investigate using Azure Fabric capacities and the associated Power BI embedding APIs, rather than relying on the older workspace collection model. This management client primarily interacts with Azure ARM resources, not directly with Power BI content APIs.","message":"The concept of 'Power BI Embedded workspace collections' (A SKUs) has largely been superseded by 'Power BI Embedded Generation 2' and 'Fabric F SKUs'. While the management client might still exist for older resources, new deployments are encouraged to use Fabric capacities.","severity":"deprecated","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}