Registry / azure / azure-mgmt-powerbiembedded

azure-mgmt-powerbiembedded

JSON →
library3.0.0pypypi✓ verified 23d ago

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.

pip install azure-mgmt-powerbiembedded
INSTALL
IMPORT
SIG · AZURE-MGMT-POWERBI
A
azure-mgmt-powerbiembedded
azurepythonv3.0.0
Install
3.0s avg
Import
557ms
Disk
53MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.600s · 98.2MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.0s · import 0.514s · 25MB
53MB installed
● package 53MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PowerBIEmbeddedManagementClient
from azure.mgmt.powerbiembedded import PowerBIEmbeddedManagementClient
DefaultAzureCredential
from azure.identity import DefaultAzureCredential

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.

import os from azure.identity import DefaultAzureCredential from azure.mgmt.powerbiembedded import PowerBIEmbeddedManagementClient # Set environment variables for authentication and subscription ID: # AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET (for service principal) # AZURE_SUBSCRIPTION_ID # For local development, DefaultAzureCredential will try various methods (env vars, managed identity, VS Code, Azure CLI, etc.) credential = DefaultAzureCredential() subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "") if not subscription_id: raise ValueError("AZURE_SUBSCRIPTION_ID environment variable is not set.") client = PowerBIEmbeddedManagementClient(credential=credential, subscription_id=subscription_id) # Example: List Power BI Embedded workspace collections (replace with actual operation) # This is a placeholder as Power BI Embedded workspace collections are largely deprecated # and modern Power BI embedding relies on other APIs or Fabric capacity. # The management library is for managing the *Azure resource* itself, not the Power BI content. # For Power BI content interaction, refer to Power BI REST APIs and SDKs. # https://learn.microsoft.com/en-us/rest/api/power-bi/ # The Power BI Embedded A SKUs were deprecated in favor of Fabric F SKUs. # The management client would typically manage resources like capacity or workspace collections. # As workspace collections are deprecated, direct management with this client for new scenarios is less common. # For illustrative purposes, an older operation might look like: # collections = client.workspace_collections.list_by_resource_group(resource_group_name="myResourceGroup") # for collection in collections: # print(collection.name) print("PowerBIEmbeddedManagementClient initialized. Operations may vary based on current Azure API status.")
Debug
Known issues
breakingVersion 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`.
fix
Migrate to `azure-identity` classes (e.g., `DefaultAzureCredential`) for authentication and update `credentials` parameter to `credential`.
affects: >=3.0.0 (from 2.x)
breakingVersion 2.0.0 changed model signatures to use keyword-only arguments. Positional arguments for models must be rewritten as keyword arguments.
fix
Ensure all arguments passed to model constructors are keyword arguments (e.g., `MyModel(arg_name='value')` instead of `MyModel('value')`).
affects: >=2.0.0 (from 1.x)
gotchaProper 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.
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.
affects: All
deprecatedThe 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.
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.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'azure.mgmt.powerbiembedded'
The `azure-mgmt-powerbiembedded` package is not installed in your Python environment or is not accessible.
fix
Install the package using pip: `pip install azure-mgmt-powerbiembedded`
Workspace Collection embedding is retired
The Power BI Embedded Workspace Collections resource, which this library (azure-mgmt-powerbiembedded) manages, was retired on August 31, 2021. Attempts to create new workspace collections or manage old ones may fail if the underlying service is no longer available or if you are trying to use it for the current Power BI Embedded (based on Power BI Premium capacities).
fix
Migrate your Power BI embedded solution to Power BI Embedded with A SKUs (Power BI Premium capacities) instead of Workspace Collections. The `azure-mgmt-powerbiembedded` library is for the deprecated Workspace Collections. For current Power BI Embedded, you typically interact with the Power BI Service APIs directly, often using libraries like `msal` or `azure-identity` for authentication, and making HTTP requests.
AADSTS70002: Error validating credentials. AADSTS50053: You've tried to sign in too many times with an incorrect User ID or password.
This error indicates an authentication failure with Azure Active Directory (AAD), often due to incorrect client ID, tenant ID, client secret, or an invalid username/password combination. It might also occur if multi-factor authentication (MFA) is enabled for the account being used for direct authentication, or if direct authentication is not enabled via an AAD policy.
fix
Ensure that the `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_CLIENT_SECRET` environment variables are correctly configured for your Azure Active Directory application. If using `DefaultAzureCredential`, verify these environment variables or other credential sources are valid. If MFA is an issue, consider using a service principal with app-only authentication or configuring AAD policies to allow direct authentication for specific applications.
AttributeError: 'PowerBIEmbeddedManagementClient' object has no attribute 'workspace_collections'
This error typically occurs when using an outdated client object or attempting to access an attribute/method that has been renamed or removed in version 3.0.0 of `azure-mgmt-powerbiembedded`. For example, older versions might have exposed operations differently.
fix
Refer to the official documentation or SDK samples for `azure-mgmt-powerbiembedded` version 3.0.0 to understand the correct client object structure and available operations. If migrating from an older version, be aware that `credential` parameter was renamed from `credentials` and operations that returned `msrest.polling.LROPoller` now return `azure.core.polling.LROPoller` and are prefixed with `begin_` (e.g., `delete` -> `begin_delete`).
Upgrade
Version history
3.0.0latest on PyPI · released Jun 24, 2024
Audit
Dependencies
azure-identityrequiredRequired for modern Azure Active Directory token authentication using DefaultAzureCredential.
PythonrequiredRequires Python 3.8 or higher.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
azure-mgmt-powerbiembedded — pip install azure-mgmt-powerbiembedded · libregistry