Automating Fabric: Maintaining workspace icon images
When working with data platform solutions in Microsoft Fabric, a well-structured approach is crucial for maintaining scalability and organization. One best practice is to separate workspaces not only into different environments (such as development, test, and production) but also into distinct layers—data storage, data ingestion, transformation, semantic modeling, and reporting. This separation improves governance, security, and clarity in large-scale deployments.
However, managing multiple workspaces can quickly become overwhelming. Identifying and distinguishing them at a glance is not always easy. Fortunately, Microsoft Fabric allows us to assign Workspace Images, which provide a simple yet effective way to visually categorize different workspaces based on their purpose and environment.
Uploading these images manually is feasible, but when dealing with a large number of workspaces, automation becomes the obvious solution. In this blog post, I will walk you through how to automate the process of uploading workspace images using a Fabric Notebook, making it easy to manage and update workspace visuals at scale.
Disclaimer: This solution uses a non-documented and unofficial Microsoft endpoint for fetching and updating workspace metadata in Microsoft Fabric/Power BI. Since this is not an officially supported API, it may change without notice, which could impact the functionality of this approach. Use it with that in mind, and feel free to experiment!
Fabric Notebook to automating Workspace Image uploads
To demonstrate how to maintain workspace icon images programmatically, I’ve created a simple Fabric Notebook. This notebook provides methods for:
Identifying workspaces based on a filter definition.
Fetching workspace metadata, including existing icons.
Setting new workspace icons in bulk.
For this demonstration, the notebook utilizes icons from Marc Lelijveld’s blog post on Designing Architectural Diagrams with the Latest Microsoft Fabric Icons.
Requirements
The notebook requires a few Python libraries:
cairosvg– Converts base64 SVGs to PNG images.Pillow– Supports adding an environment letter on top of the icons (not used in the example but available for experimentation).
To fetch all accessible workspaces, the notebook uses SemanticLink and the FabricRestClient class:
SemanticLink FabricRestClient Documentation.
Filtering Workspaces
The notebook filters workspaces using two parameters:
must_contain = "PeerInsights"
either_contain = ["dev", "tst", "prd"]
A custom Python function filter_items then filters the list of workspaces:
workspaces = filter_items(all_workspaces, must_contain, either_contain)
Defining Workspace Icons
A JSON structure is used to define workspace icons and color overlays:
workspace_icon_def = {
"icons": {
"prepare": "Notebook",
"ingest": "Pipelines",
"store": "Lakehouse",
"serve": "Dataset"
},
"color_overlays": {
"dev": "#1E90FF", # Blue
"tst": "#FFA500", # Orange
"prd": "#008000" # Green
}
}
Note: To remove an existing icon, set the icon title to None.
Updating Workspace Icons
In Cell 7 of the notebook, a new property
icon_base64imgis added to each workspace, storing the base64-encoded PNG string of the new icon.The function
display_workspace_iconsgenerates an HTML table showing the old and new workspace icons for verification.
Finally, we iterate through the filtered workspaces and updates their icons using the
set_workspace_iconfunction.
The result….

Using the non-documented metadata endpoint
Workspace icons are updated by calling the non-documented Microsoft endpoint:
{cluster_base_url}metadata/folders/{workspace_id}
The cluster_base_url can be retrieved using the Power BI REST API:
https://api.powerbi.com/v1.0/myorg/capacities
Example base URL:
https://wabi-north-europe-j-primary-redirect.analysis.windows.net/v1.0/...
Making API Calls
Fetching workspace metadata:
GET {cluster_base_url}metadata/folders/{workspace_id}
Updating the workspace icon:
PUT {cluster_base_url}metadata/folders/{workspace_id}
With the following payload:
{ "icon": "data:image/png;base64,{base64_png}" }
Conclusion
By automating the upload of workspace images in Microsoft Fabric, we can enhance the visual organization of workspaces, making it easier to distinguish between different layers and environments. Instead of manually updating images across multiple workspaces, a Fabric Notebook provides an efficient and scalable solution.
You're free to use my example as-is or as inspiration for your own automated setup. I’d love to hear how others are tackling this challenge - what solutions have you come up with, and what are your use cases? Feel free to comment, ask questions, or share suggestions!
If you're interested in trying this out, you can download the Fabric Notebook here.

