Skip to content

apotenza92/okebet-refresh

Repository files navigation

Table of Contents

  1. Description
  2. Requirements
  3. Setup
  4. Manual Refresh Instructions
  5. (TBC) Automatic Script Refresh Instructions

1 Description

Guide for Okebet to refresh PowerBI data.

2 Requirements

  • Windows OS to install the PowerBI on-premises data gateway
  • okebet-replication.pem ssh key (stored in Okebet PowerBI Refresh Data folder)

2.1 Automatic Script Requirements (TBC)

3 Setup

All instructions within this Setup section are required regardless of if you're performing manual refreshes or using the scripts.

3.1 Set up On-premises Data Gateway

Download Data Gateway and install.

Data Gateway Installation

Data Gateway Installation

Install the data gateway by signing into your Okebet Microsoft Power BI account.

Create a new on-premises data gateway, it will ask you for a gateway name and some other information.

Check to see if it's working by going here:

Gateway Status

Gateway Status

Your gateway will appear as Online while your computer is on, meaning it's working and we can refresh the data.

Open the settings panel for the gateway and activate the options under General and PowerBI
Gateway Settings

Gateway Settings

3.2 Set up Connection Dataset

While still in Manage Connections and Gateways go to the 'Connections' tab and click 'New' in the top left corner.

Set up a new On-premises connection using the Gateway cluster name you created when setting up the gateway.

Name the connection and set the Connection type to MySQL.

Connection Setup

Now fill out the following information in the remaining fields

Server: localhost:3309  
Database: bi

Authentication method: Basic  
Username: reporting  
Password: OnAreCleTION

Encrypted connection: Not encrypted  
Privacy level: Organizational

When you click Create it will test the connection and ensure the details and password are correct.

3.3 Connect to the Semantic Model

Now we need to connect the data to our semantic model.

Head back to the home page on PowerBI and search for Okebet Reporting, find the one that's Type Semantic Model and click it.

Semantic Model

Within the semantic model click File > Settings:

Semantic Model Settings

Now expand the "Gateway and cloud connections" dropdown and you'll see some information about the data sources included in the semantic model. We want to map the MySQL server to the Connection we created earlier, which we called bm. Once you map it correctly it will look like this:

Mapped Connection

Maps to: bm

Click Apply to save the settings.

4 Manual Refresh Instructions

For our refresh to work we have to be connected to the ssh tunnel provided by BetMakers.

The following instructions are specifically for Windows PCs because you must open the ssh tunnel on the PC where you installed the on-premises gateway.

Take the private key certificate provided (okebet-replication.pem) and place it somewhere easily accessible e.g. your desktop.

Private Key Certificate

Now we need to run a terminal command that uses this certificate.

The easiest way to do this if you're unfamiliar with how terminals work is to ensure you have Windows' new 'Terminal' program, which provides a handy right click option.

Right click your desktop (or any folder where you placed the certificate) and select 'Open in Terminal'. If you don't see this option I recommend just heading to the Microsoft Store on your PC and installing it.

Open in Terminal

Once the Terminal opens you'll see it opens to wherever you right clicked from:

Terminal

We can make sure of this by running the 'ls' command (meaning list) which will display all the contents of the folder that the terminal is in. We can see the certificate file when running the list command on the Desktop:

List Command

Now we can run the ssh command to connect. Copy this and run it.

ssh -i okebet-replication.pem [email protected] -L 3309:replicated-db-api.okebet.com.au:3306 -N

If it's the first time you've run it you may see a security prompt that requires you to type 'yes'.

Once run successfully you'll see it look like this, with a simple blinking cursor:

SSH Connection

Now that the ssh is connected let's head back to PowerBI online and try to refresh the data. (The refresh can be performed from any computer as long as the Windows machine with the gateway installed is connected to the ssh tunnel)

Back on the Okebet Reporting settings page we were on earlier. Let's click Refresh > Refresh now:

Refresh Now

You'll see a small animated circle indicating the refresh is taking place.

Refresh In Progress

For more information about the refresh you can head to Refresh > Refresh history and see the following screen showing how we have a refresh currently in progress and all the past refreshes completed. Detailed error messages may also appear here if things go wrong.

Refresh History

In my experience, the refresh should take approximately 6-8 mins.

Once the refresh finishes the small animated circle will stop spinning. If you refresh the settings page you'll see the time of the last refresh has updated:

Refresh Completed

Inside the history we can also see that it's completed and it took about 6 minutes:

Refresh History Completed

We're done! That's how you can perform a manual refresh of the dataset.

5 Automatic Script Refresh Instructions

To be completed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published