Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Guide to Using the Python SDK for Microsoft Fabric REST API

Description

The Microsoft Fabric API provides developers with programmatic access to manage and interact with Microsoft Fabric resources. It enables developers to automate a wide array of tasks, including data integration, data warehousing, big data analytics, deployment process automation, Fabric items provisioning, and more.

This document provides an overview of the API endpoints, authentication methods, and usage examples for the Python SDK for Fabric REST API. The Python SDK is a client library that simplifies communication with the Microsoft Fabric API service and handles serialization and error handling for you.

Installation via pip

To install the client library via pip:

pip install microsoft-fabric-api

Getting Started

1. Register your application

Register your application to use Microsoft Fabric API.

2. Authenticate for the Microsoft Fabric service

The Microsoft Fabric Python Client Library supports the use of TokenCredential classes in the azure-identity library.

You can read more about available Credential classes at Azure Identity client library for Python.

The recommended library for authenticating against Microsoft Identity (Azure AD) is MSAL.

For an example of how to acquire a Microsoft Entra token for Microsoft Fabric Service, see Microsoft Fabric API - get token.

3. Create a Microsoft Fabric client object with an authentication provider

An instance of the FabricClient class handles building requests, sending them to the Microsoft Fabric API, and processing the responses. To create a new instance of this class, you need to provide a instance of TokenCredential or the string representation of its underlying Microsoft Entra access token.

4. Make requests to Microsoft Fabric

Once you have completed authentication and have a FabricClient, you can begin to make calls to the service.

For example, to get a list of workspaces:

from azure.identity import DefaultAzureCredential
from microsoft_fabric_api import FabricClient

# Create credential and client
credential = DefaultAzureCredential(exclude_interactive_browser_credential=False)
fabric_client = FabricClient(credential)

# Get the list of workspaces using the client
workspaces = [workspace for workspace in fabric_client.core.workspaces.list_workspaces()]
print(f"Number of workspaces: {len(workspaces)}")
for workspace in workspaces:
    print(f"Workspace: {workspace.display_name}, Capacity ID: {workspace.capacity_id}")

Documentation and resources

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microsoft_fabric_api-0.1.0b23-py3-none-any.whl (2.8 MB view details)

Uploaded Python 3

File details

Details for the file microsoft_fabric_api-0.1.0b23-py3-none-any.whl.

File metadata

File hashes

Hashes for microsoft_fabric_api-0.1.0b23-py3-none-any.whl
Algorithm Hash digest
SHA256 32da80c668a1be1c0f355373465b2e1f967a3c6e8f0dab1effbd59314e01ef11
MD5 f50cfdaac3c572713722ed24b98f50cf
BLAKE2b-256 f66def77ff22aa5afe6efdf185cac0a31789cf0b9cc4b52a74bcb741f62e04a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page