Jump to Content
Data Analytics

Multicloud reporting and analytics using Google Cloud SQL and Power BI

July 12, 2022
Matthew Smith

Strategic Cloud Engineer

After migrating databases to Google Cloud,  Cloud SQL developers and business users can use familiar business intelligence tools and services like Microsoft Power BI to connect to and report from Cloud SQL MySQL, PostgreSQL, and SQL Server databases.  

The ability to quickly migrate databases to GCP without having to worry about refactoring or developing new reporting and BI tools is a key capability for businesses migrating to CloudSQL. Organizations can migrate today, and then replatform databases and refactor reporting in subsequent project phases.

https://storage.googleapis.com/gweb-cloudblog-publish/images/000_Image.max-1100x1100.jpg

The following guide demonstrates key steps to configure Power BI reporting from Cloud SQL. While your environment and requirements may vary, the design remains the same. 

To begin, create three Cloud SQL Instances, each with a Private IP address.

https://storage.googleapis.com/gweb-cloudblog-publish/images/001_Image.max-2800x2800.max-1100x1100.png

After creating the database instances, create a Windows VM in the same VPC as the Cloud SQL instances. Install and configure the Power BI Gateway on this VM along with the required ODBC connectors.

Download and Install ODBC Connectors for PostgreSQL and MySQL.

 Configure System DSNs for each Database connection. Examples follow. 

SQL Server

https://storage.googleapis.com/gweb-cloudblog-publish/images/002_Image.max-700x700.jpg
https://storage.googleapis.com/gweb-cloudblog-publish/images/003_Image.max-600x600.jpg
https://storage.googleapis.com/gweb-cloudblog-publish/images/004_Image.max-600x600.jpg

PostgreSQL

https://storage.googleapis.com/gweb-cloudblog-publish/images/005_Image.max-700x700.jpg

MySQL

https://storage.googleapis.com/gweb-cloudblog-publish/images/006_Image.max-600x600.jpg

The traffic between the CloudSQL instance and the VM hosting the data gateway stays inside the Google VPC and is encrypted via Encryption in Transit in Google Cloud. To add an additional layer of SSL encryption for the data inside the Google VPC, configure each System DSN to use CloudSQL SSL/TLS certificates

Next, download, install, and configure the Power BI Gateway. Note that the gateway may be installed in an HA configuration. The screenshot below shows a single standalone gateway. 

On-premises data gateway configuration: Create a new on-premises data gateway

https://storage.googleapis.com/gweb-cloudblog-publish/images/007_Image.max-700x700.jpg

On-premises data gateway configuration: Validate Gateway Configuration

https://storage.googleapis.com/gweb-cloudblog-publish/images/008_Image.max-600x600.jpg

On-premises data gateway configuration: Review logging settings

https://storage.googleapis.com/gweb-cloudblog-publish/images/009_Image.max-600x600.jpg

On-premises data gateway configuration: Review HTTPS mode

Make sure that outgoing HTTPS traffic is allowed to exit from the VPC.

https://storage.googleapis.com/gweb-cloudblog-publish/images/010_Image.max-500x500.jpg

Next, download and open Power BI Desktop. Log into Power BI and select “Manage gateways” to configure data sources.

https://storage.googleapis.com/gweb-cloudblog-publish/images/011_Image.max-600x600.jpg

Add data sources for each instance, and then test the data source connections. In the example below a data source is added for each CloudSQL instance.

https://storage.googleapis.com/gweb-cloudblog-publish/images/012_Image.max-800x800.jpg

Load test data into each database instance (optional). In the example below a simple table containing demo data is created in each source database.

https://storage.googleapis.com/gweb-cloudblog-publish/images/013_Image.max-600x600.jpg

Launch Power BI desktop and log in. Next, add data sources and create a report. Select “Get data” and add ODBC connections for CloudSQL SQL Server, PostgreSQL and MySQL, then create a sample report with data from each instance.

https://storage.googleapis.com/gweb-cloudblog-publish/images/014_Image.max-800x800.jpg

Using the Power BI publish feature, publish the report to the Power BI service. Once the report and data sources are published, update the data sources in the Power BI workspace to point to the data gateway data sources.

https://storage.googleapis.com/gweb-cloudblog-publish/images/015_Image.max-500x500.jpg

Map the datasets to the CloudSQL database gateway connections.

https://storage.googleapis.com/gweb-cloudblog-publish/images/016_Image.max-800x800.jpg

Optional: Schedule a refresh time.

https://storage.googleapis.com/gweb-cloudblog-publish/images/017_Image.max-700x700.jpg

To perform an end-to-end test, update the test data and refresh the reports to view the changes.

https://storage.googleapis.com/gweb-cloudblog-publish/images/018_Image.max-800x800.jpg

Use the Publish to - Power BI Service to publish Power BI reports that were developed with Power BI Report Builder to a workspace (Power BI Premium Capacity is required).

https://storage.googleapis.com/gweb-cloudblog-publish/images/019_Image.max-700x700.jpg

Conclusion

Hopefully this blog was helpful in demonstrating how Power BI reports and dashboards can connect to Google Cloud SQL Databases using the Power BI Gateway. You can also use the Power BI Gateway to connect to your Big Query datasets and databases running on GCE VMs. For more information on Cloud SQL, please visit Google Cloud Platform Cloud SQL.  

Posted in