Skip to content

Windows system tray app for monitoring Power BI refresh status, capacity metrics, and gateway health

Notifications You must be signed in to change notification settings

HSwart/PowerTray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Power BI Tray Monitor

A Windows system tray application for monitoring Power BI semantic model refresh status, capacity utilization, and gateway health - all at a glance.

✨ Features

Dynamic Tray Icon

The tray icon displays real-time capacity metrics using 3 dynamic bars:

Bar Represents Color
Left Background utilization % Blue
Middle Total utilization % Green/Orange/Red (health)
Right Interactive utilization % Teal

The middle bar changes color based on capacity health:

  • 🟒 Green: Normal (<80%)
  • 🟠 Orange: High (80-99%)
  • πŸ”΄ Red: Critical (β‰₯100%, throttling)

Refresh Monitoring

  • βœ… Real-time refresh status tracking
  • πŸ“Š Detailed refresh history with table-level breakdown
  • ⏱️ Countdown to next scheduled refresh
  • πŸ”” Windows notifications on refresh completion/failure

Capacity Metrics

  • πŸ“ˆ Live capacity utilization monitoring
  • πŸ”΅ Background vs Interactive utilization breakdown
  • ⚑ Throttling status alerts
  • πŸ“Š Stacked progress bar visualization

Gateway Health

  • 🌐 Gateway online/offline status
  • ⚠️ Alerts for offline or degraded gateways
  • πŸ“ Multi-gateway support with individual status

Pipeline Integration

  • πŸ”„ Azure Data Factory pipeline schedule tracking
  • ⏰ Next run time display for each pipeline
  • πŸ“‹ Full/Partial refresh type indicators

πŸš€ Quick Start

Automated Setup (Recommended)

  1. Download or clone this repository
  2. Double-click setup.bat - this will:
    • Create a Python virtual environment
    • Install all dependencies
    • Optionally add to Windows startup
    • Launch the application

Manual Setup

# Create virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1

# Install dependencies
pip install -r requirements.txt

# Run the application
python -m pbi_tray

βš™οΈ Configuration

First Run

  1. A browser window opens for Microsoft sign-in
  2. Sign in with your Power BI account
  3. Credentials are cached for future sessions

Settings

Right-click the tray icon β†’ Settings to configure:

Setting Description
Workspace ID Your Power BI workspace GUID
Dataset ID Your semantic model GUID
Timezone Display timezone for timestamps
Capacity Workspace Workspace for capacity metrics (optional)
Pipelines Azure Data Factory pipeline configuration

Configuration File

Copy settings.example.json to settings.json and configure your IDs:

{
    "workspace_id": "your-workspace-guid",
    "dataset_id": "your-dataset-guid",
    "refresh_interval": 300,
    "timezone": "UTC",
    "capacity_metrics_workspace": "Microsoft Fabric Capacity Metrics - YourCapacity"
}

Finding Your IDs

  1. Open Power BI Service
  2. Navigate to your workspace β†’ semantic model
  3. Look at the URL:
    https://app.powerbi.com/groups/{WORKSPACE_ID}/datasets/{DATASET_ID}/details
    

πŸ“± System Tray Menu

Right-click the tray icon:

Section Items
Status Current status, last refresh time, duration
Recent History Last 5 refreshes with expandable details
Capacity Utilization %, BG/Interactive breakdown
Actions Trigger Refresh, Cancel Refresh, Check Status
Account Sign In, Sign Out
Settings Timezone, Configuration

πŸ–₯️ Details Window

Double-click the tray icon to open the full details window:

  • Status Overview: Last refresh with countdown to next
  • Gateways: Health status of all connected gateways
  • Pipelines: Configured refresh pipelines with schedules
  • Capacity: Detailed utilization with stacked bar chart
  • History: Scrollable list with expandable table-level details

πŸ”§ Advanced Configuration

Capacity Metrics

To enable capacity monitoring, you need access to a workspace with the Microsoft Fabric Capacity Metrics app installed.

  1. Install the Capacity Metrics app
  2. Copy the workspace ID where it's installed
  3. Add to settings as "Capacity Workspace"

Pipeline Configuration

Configure Azure Data Factory pipelines in settings:

{
  "pipelines": {
    "pipeline-guid-1": {
      "name": "Full Daily Refresh",
      "type": "full",
      "cron": "0 6 * * *"
    },
    "pipeline-guid-2": {
      "name": "Intra-Daily Refresh", 
      "type": "partial",
      "cron": "0 */2 * * *"
    }
  }
}

πŸ“ Project Structure

PowerBI_Tray/
β”œβ”€β”€ pbi_tray/              # Main application package
β”‚   β”œβ”€β”€ api/               # Power BI API clients
β”‚   β”œβ”€β”€ ui/                # UI components
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ __main__.py        # Entry point
β”‚   β”œβ”€β”€ auth.py            # Authentication
β”‚   β”œβ”€β”€ config.py          # Configuration
β”‚   └── tray.py            # System tray
β”œβ”€β”€ assets/                # Icons and images
β”‚   β”œβ”€β”€ icon.ico
β”‚   β”œβ”€β”€ PBI_mini.png
β”‚   β”œβ”€β”€ settings.png
β”‚   └── ...
β”œβ”€β”€ scripts/               # Utility scripts
β”‚   β”œβ”€β”€ add_to_startup.bat
β”‚   β”œβ”€β”€ remove_from_startup.bat
β”‚   └── pbi_tray_silent.vbs
β”œβ”€β”€ setup.bat              # Automated setup (double-click)
β”œβ”€β”€ setup.ps1              # PowerShell setup script
β”œβ”€β”€ settings.json          # User configuration (gitignored)
β”œβ”€β”€ settings.example.json  # Example configuration
β”œβ”€β”€ requirements.txt       # Python dependencies
└── README.md

πŸ”’ Authentication

Uses MSAL (Microsoft Authentication Library):

  • First run: Browser-based interactive sign-in
  • Subsequent runs: Automatic token refresh
  • Token cache: Securely stored in .token_cache.json

To force re-authentication: Account β†’ Sign Out

πŸ“‹ Requirements

  • OS: Windows 10/11
  • Python: 3.9+
  • License: Power BI Pro or Premium Per User
  • Permissions: Read access to workspace/dataset

πŸ› Troubleshooting

Icon not appearing

  • Check system tray overflow (arrow near clock)
  • Restart the application

Authentication issues

  • Use Account β†’ Sign Out, then sign in again
  • Delete .token_cache.json and restart

Capacity metrics unavailable

  • Ensure Capacity Metrics app is installed
  • Verify workspace ID is correct
  • Check you have access to the capacity

"No gateway required" showing

  • Dataset uses only cloud datasources
  • No on-premises gateway configured

πŸ“„ License

MIT License - See LICENSE file for details.

🀝 Contributing

Contributions welcome! Please open an issue or pull request

About

Windows system tray app for monitoring Power BI refresh status, capacity metrics, and gateway health

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published