Email Alerts addon for Power BI Report Server

This script creates a stored procedure that will send email alerts for cache refresh and timed subscription events in PowerBI Report Server.

Requirements

  • Python3
  • venv (recommended)
  • Install dependencies:
python3 -m venv env
.\env\Scripts\activate
pip install requirements.txt

Setup connection

Go to the ODBC data sources program in Windows to create a new data source.

Configure addon

Modify the config.json file to set

  1. DSN name (e.g. mydatasource)
  2. Email account for sending
  3. Email recepients

Parameters for email recepients:

Parameter Values Description
event_type RefreshCache, TimedSubscription
recepient_list Valid email address
last_status_type_like succeeded, failed
email_profile_name String
email_template relative filepath to HTML file
date_add datetime

Run script

python main.py

This will install the stored procedure for the first time and also make updates if the configuration has changed.

  • The script will replace all rows in the EmailRecepients table based on the JSON config.

  • If a new email account is configured, it will be added to the current list of email accounts in the database.

  • Tables created during setup will not be overrided and will just be ignored.

How to use

Full reset

  • To do a full reset, run EmailerDrop.sql in your database.