MICROSOFT POWER BI β€’ PUBLISHING AND COLLABORATION

Using Gateways β€” Use gateways for on-prem data refresh (conceptual)

Bridging on-premises data sources with cloud-based Power BI through secure gateway architecture.

Historical Context & Motivation

The rise of cloud-based business intelligence platforms introduced a fundamental architectural tension: organizations had invested decades in building robust on-premises data infrastructure β€” SQL Server instances, Oracle databases, file shares, and proprietary data warehouses β€” yet the analytics layer was migrating to the cloud. Microsoft recognized early that a wholesale "lift and shift" of enterprise data was neither practical nor desirable for most organizations. Security policies, regulatory compliance (HIPAA, GDPR, SOX), and sheer data volume made full cloud migration a multi-year endeavor. The on-premises data gateway emerged as the bridge that would let organizations keep their data where it was while still leveraging Power BI's cloud-hosted reporting and collaboration features.

2013
Power BI Preview & Early Data Management Gateway
Microsoft launched Power BI as an Office 365 add-on with a rudimentary Data Management Gateway to support hybrid data access for Power Query. This first iteration required manual configuration per data source and lacked centralized management.
2016
On-Premises Data Gateway (Standard Mode)
With Power BI's general availability, Microsoft released the on-premises data gateway in standard (enterprise) mode, supporting centralized management, multiple data sources per gateway, and gateway clustering for high availability.
2018
Personal Mode & VNet Gateways Introduced
Microsoft added a lightweight personal mode gateway for individual users, along with early support for Azure Virtual Network (VNet) data gateways that eliminated the need for a physical machine on premises.
2021
VNet Data Gateway GA & Unified Gateway Management
VNet data gateways reached general availability, enabling organizations with Azure-hosted databases to bypass on-prem gateway installations entirely. The Power Platform admin center became the unified management surface for all gateway types.
2023–Present
Fabric Integration & Managed Connections
Microsoft Fabric's emergence brought tighter integration with gateway infrastructure, including managed private endpoints and streamlined credential management through the Fabric admin portal.

The core question the gateway addresses is deceptively simple: How does a cloud service securely query a database that is not exposed to the public internet? The answer involves outbound-only encrypted connections, relay-based communication channels, and a carefully orchestrated credential management scheme β€” concepts we will unpack throughout this lesson.

Core Principles & Definitions

Before diving into architecture details, it is essential to establish the foundational concepts that govern gateway behavior. A data gateway in the Power BI ecosystem is a software agent installed on a machine within your network that acts as a secure conduit between on-premises data sources and the Power BI service in the cloud. It does not move data permanently into the cloud; rather, it facilitates on-demand query execution and scheduled data refresh operations. Understanding gateways requires grasping several interrelated concepts.

1

Outbound-Only Connections

The gateway initiates all connections outbound to Azure Service Bus via HTTPS (port 443). No inbound firewall rules are required, which dramatically reduces the attack surface compared to opening database ports to the internet.
2

Encrypted Credential Store

Data source credentials are encrypted using an asymmetric key pair generated during gateway installation. The private key exists only on the gateway machine; the Power BI service holds the public key and the encrypted credentials. This means Microsoft never has access to your plaintext database passwords.
3

Standard vs. Personal Mode

Standard (enterprise) mode supports multiple users and centralized administration. Personal mode is restricted to a single user and cannot share data sources. Think of standard mode as a departmental server and personal mode as a developer workstation.
4

Gateway Cluster (High Availability)

Multiple standard-mode gateway installations can be grouped into a cluster. The Power BI service load-balances refresh requests across cluster members and automatically fails over if one node becomes unresponsive, providing enterprise-grade availability.
5

Scheduled Refresh vs. DirectQuery

Gateways support two data access patterns: scheduled refresh (import mode) pulls data into the Power BI dataset on a schedule, while DirectQuery forwards each user query through the gateway to the on-premises source in real time.
✦ KEY TAKEAWAY
Think of the on-premises data gateway as a reverse SSH tunnel for BI data. Just as an SSH tunnel allows you to securely expose a local service to a remote machine without opening inbound ports, the gateway establishes an outbound encrypted channel to Azure Service Bus. The cloud service drops query requests into this channel, and the gateway picks them up, executes them against local databases, and returns the results β€” all without your database ever being directly addressable from the internet.

Visual Explanation β€” Gateway Architecture

The following diagram illustrates the end-to-end data flow when a Power BI dataset configured in import mode triggers a scheduled refresh through the on-premises data gateway. Pay close attention to the direction of arrow connections β€” all gateway-initiated traffic is outbound.

The numbered steps show the refresh lifecycle: β‘  Power BI triggers a refresh, β‘‘ the relay notifies the gateway via its persistent outbound connection, β‘’ the gateway decrypts stored credentials using its local private key, β‘£ queries execute against on-premises sources, and β‘€ results flow back through the relay to the Power BI dataset.

Notice that the on-premises network boundary (right side) never exposes any inbound ports. The gateway maintains a persistent outbound WebSocket connection to Azure Service Bus, which the Power BI service uses to relay commands. This is conceptually similar to how a WebSocket-based chat client connects outbound to a message broker, then receives messages pushed back over the same channel. The credential flow (step β‘’) is particularly important from a security standpoint: the encrypted credential blob travels from the cloud to the gateway, where the gateway's locally stored RSA private key decrypts it. At no point does a plaintext password traverse the network.

How It Works β€” Communication & Security Internals

The gateway's communication model is built atop Azure Service Bus Relay, which acts as a cloud-hosted message broker. When the gateway Windows service starts, it authenticates with Azure Active Directory (now Entra ID) and establishes a persistent TLS 1.2+ WebSocket connection to a Service Bus relay namespace. This connection is always outbound from the gateway β€” the gateway polls the relay for pending work items. When the Power BI service needs to execute a refresh or DirectQuery operation, it places a message on the relay, which the gateway picks up within seconds.

Credential Encryption Scheme

During gateway installation, a 2048-bit RSA key pair is generated. The public key is uploaded to the Power BI service; the private key remains on the gateway machine, stored in the Windows DPAPI-protected credential store. When an administrator configures a data source in the Power BI service and provides a username/password, the service encrypts those credentials with the gateway's public key before persisting them. Only the gateway can decrypt them.

CREDENTIAL ENCRYPTION
C = E(PUB_gw, plaintext_credentials)
Where C is the ciphertext stored in the Power BI service, E is RSA-OAEP encryption, and PUB_gw is the gateway's public key. Decryption occurs only on the gateway: plaintext = D(PRIV_gw, C).

Transport Layer Security

All data in transit between the gateway and the Power BI service is encrypted via TLS 1.2 (minimum). The gateway also supports an optional secondary encryption layer using AES-256 symmetric keys negotiated per session between the gateway agent and the cloud endpoint. This defense-in-depth approach ensures that even if TLS termination occurs at a corporate proxy, the inner payload remains encrypted. The combination of asymmetric encryption for credentials and symmetric encryption for data transport mirrors the hybrid approach used in protocols like TLS itself β€” use slow asymmetric crypto for key exchange, fast symmetric crypto for bulk data.

Refresh Scheduling & Throttling

The Power BI service orchestrates refresh scheduling. A Pro license allows up to 8 refreshes per day per dataset; Premium workspaces allow 48. When a scheduled refresh triggers, the service enqueues a refresh job targeting the gateway cluster. The gateway picks up the job, retrieves and decrypts the relevant credentials, executes the data source queries (e.g., SQL, OData, ODBC), compresses the result set, and transmits it back to Power BI for ingestion into the in-memory Analysis Services (VertiPaq) engine. If the refresh fails β€” due to network issues, credential expiry, or gateway downtime β€” the Power BI service retries and eventually notifies the dataset owner via email.

Detailed Breakdown β€” Gateway Modes & Deployment Options

Microsoft provides three distinct gateway deployment models, each targeting a different use case. Understanding when to use each is critical for both Power BI certification exams and real-world enterprise deployments. The following diagram and table break down the key differences.

Comparison of the three gateway deployment models. Standard mode is the enterprise workhorse. Personal mode is a quick solution for individual developers. VNet gateways eliminate hardware management entirely but require Azure-hosted data sources and a Premium or Fabric capacity.
Gateway Feature Comparison
FeatureStandard ModePersonal ModeVNet Gateway
InstallationDedicated server on-premUser's workstationNone β€” Azure-managed
UsersMultiple (shared)Single userMultiple (shared)
Data Access ModesImport, DirectQuery, LiveConnectImport onlyImport, DirectQuery
Clustering / HAYes β€” up to N nodesNoManaged by Azure
License RequiredPro or Premium per userProPremium or Fabric
Data Source LocationOn-premises or cloudOn-premises or cloudAzure VNet only
πŸ’‘ When to Use Which?
Use standard mode for production workloads that serve teams or departments. Use personal mode during development or for individual prototyping β€” but plan to migrate to standard before going live. Use a VNet gateway when your data sources are already in Azure (e.g., Azure SQL, Azure Synapse) and you want zero hardware management.

Worked Example β€” Configuring Scheduled Refresh via Gateway

Let us walk through a realistic scenario. Imagine you are a data engineer at a mid-size retail company. You have published a Power BI report to the Power BI service that imports sales data from an on-premises SQL Server 2019 instance. You need to configure the report's dataset to refresh automatically every 4 hours during business days.

Setting Up On-Premises Scheduled Refresh
1
Step 1 β€” Install and Register the GatewayDownload the on-premises data gateway installer from Microsoft's gateway download page. Run the installer on a dedicated Windows Server machine that has network access to the SQL Server instance. During installation, sign in with an organizational account (the gateway admin). The installer generates an RSA key pair, registers the gateway with the Power BI service, and establishes the outbound connection to Azure Service Bus.
Gateway appears in the Power Platform admin center under Settings β†’ Manage gateways.
2
Step 2 β€” Add a Data Source to the GatewayIn the Power BI service, navigate to Settings β†’ Manage connections and gateways. Select the registered gateway and click New connection. Choose the data source type SQL Server, enter the server name (e.g., retaildb01.corp.local), database name (SalesDB), and authentication credentials. The credentials are RSA-encrypted with the gateway's public key before being stored.
A green checkmark confirms the connection is valid.
3
Step 3 β€” Map the Dataset to the Gateway Data SourceNavigate to the published dataset's settings page (Workspace β†’ Dataset β†’ Settings β†’ Gateway connection). Power BI displays detected data sources from the .pbix file. Map each source to a gateway data source. If the connection string in the .pbix matches the gateway data source server and database, Power BI auto-maps it; otherwise, perform a manual mapping.
Status shows Gateway connection: OK for each source.
4
Step 4 β€” Configure the Refresh ScheduleUnder the dataset's Scheduled refresh section, toggle Keep your data up to date to On. Set the refresh frequency to Daily and add time slots: 08:00, 12:00, 16:00, 20:00. Optionally, configure failure notifications so the gateway admin receives an email if a refresh fails. Click Apply.
The dataset will refresh 4 times daily. The Refresh history page shows status of each run.
5
Step 5 β€” Verify & MonitorTrigger a manual refresh from the dataset's context menu (Refresh now) to validate the end-to-end pipeline. Monitor the Refresh history for success. On the gateway machine, check Event Viewer β†’ Applications and Services Logs β†’ On-premises data gateway for detailed logs. In a production setting, integrate gateway health metrics with Azure Monitor or a SIEM for proactive alerting.
Refresh history shows Completed status with duration in seconds. Reports consuming this dataset now display fresh data.

Strengths, Limitations, and Trade-offs

Like any middleware component, the on-premises data gateway introduces both capabilities and constraints. A clear-eyed assessment of these trade-offs is essential for making sound architectural decisions, especially in environments where alternatives such as cloud data migration, ETL pipelines to Azure Data Lake, or VNet gateways are also viable options.

Gateway Strengths vs. Limitations
StrengthsLimitations
No inbound firewall ports required β€” outbound-only HTTPS keeps security teams satisfiedRequires a dedicated always-on Windows machine; gateway downtime blocks all dependent refreshes
Supports 60+ data source types: SQL Server, Oracle, SAP HANA, file shares, ODBC, web APIsSome data sources (e.g., custom REST APIs) require a custom connector, adding development overhead
Credentials never leave the on-premises boundary in plaintext β€” RSA encryption provides strong securityRecovering a lost gateway key pair requires re-entering all data source credentials β€” no automated migration
Clustering enables horizontal scaling and automatic failover for high availabilityCluster members must all be on the same LAN / VPN; cross-region clustering is not supported
Single gateway can serve Power BI, Power Apps, Power Automate, and Azure Logic AppsConcurrent refresh load can saturate gateway machine CPU/memory, requiring careful capacity planning
✦ KEY TAKEAWAY
Think of the gateway as a load balancer for hybrid data access. Just as a reverse proxy like NGINX sits at the boundary of your web infrastructure, mediating between external requests and internal backend services, the gateway mediates between cloud-based analytics requests and on-premises databases. Both require capacity planning, health monitoring, and redundancy β€” and both become single points of failure if not properly clustered.

Connection to Advanced Theory β€” Gateway in the Modern Data Stack

The on-premises data gateway is not the only pattern for bridging on-prem and cloud data. As organizations mature their data infrastructure, they often encounter a spectrum of approaches, from simple gateway-based refresh to full cloud-native architectures. Understanding where the gateway fits in this continuum helps you make informed architectural recommendations.

Gateway vs. Cloud-Native Pipeline Comparison
AspectOn-Prem Gateway (Current)Cloud-Native Pipeline (Advanced)
Data LocationData stays on-premises; queried on demand or imported on scheduleData is ingested into Azure Data Lake / Synapse / Lakehouse via ADF or Fabric pipelines
LatencyDirectQuery adds round-trip latency through relay; import mode has stale data between refreshesNear-real-time with streaming or micro-batch pipelines
ScalabilityLimited by gateway machine resources; cluster adds nodes but all need LAN accessCloud-scale compute (Spark, Synapse Serverless); auto-scales to workload
ComplexityLow β€” install gateway, configure data sources, set scheduleHigh β€” requires ETL/ELT pipeline design, data modeling, orchestration (ADF, Airflow)
CostLow marginal cost β€” existing server + Pro/Premium licenseAzure compute and storage costs, but eliminates on-prem hardware dependency
Best ForOrganizations early in cloud migration; regulated industries with data residency requirementsOrganizations committed to cloud-first architecture; large-scale data processing workloads

Looking forward, Microsoft's Fabric platform is blurring the lines between these approaches. Fabric's shortcuts and mirroring features allow data from on-premises sources (accessed via gateways) to be virtualized within a lakehouse without full ETL. Meanwhile, managed private endpoints are enabling secure connectivity to Azure-hosted databases without even a VNet gateway. The long-term trajectory suggests that gateways will remain essential for truly on-premises (non-Azure) sources, while Azure-hosted data will increasingly bypass gateways entirely through native Fabric integration.

Practice Problems

PROBLEM 1 β€” CONCEPTUAL
Explain why the on-premises data gateway uses outbound-only connections rather than requiring inbound firewall rules. What security advantage does this provide over directly exposing a database port to the internet?
PROBLEM 2 β€” BASIC CALCULATION
A Power BI Pro user has configured a dataset with 6 scheduled refresh slots per day. Each refresh takes approximately 12 minutes. The dataset is mapped to a standard-mode gateway that also serves 4 other datasets, each with 4 refreshes per day taking 8 minutes each. Assuming refreshes do not overlap (sequential scheduling), how many total minutes per day is the gateway busy with refresh operations? Is the gateway approaching a utilization concern if we assume it should not exceed 75% busy time in a 24-hour period?
PROBLEM 3 β€” INTERMEDIATE
Your organization has a standard-mode gateway cluster with 3 nodes. Node A experiences a hardware failure at 2:00 AM. At 2:30 AM, a scheduled refresh triggers for a dataset that was previously load-balanced across all three nodes. Describe the sequence of events that occurs, including how the Power BI service, Azure Service Bus, and the remaining gateway nodes interact. What would happen if nodes B and C were also offline?
PROBLEM 4 β€” APPLIED
You are consulting for a healthcare company subject to HIPAA regulations. They want to visualize patient outcome data in Power BI. The data resides in an on-premises PostgreSQL database. The CISO insists that no patient data may be stored in the public cloud, but executives want cloud-based dashboards for remote access. Design an architecture using gateways that satisfies both requirements. Specify the gateway mode, data access pattern (import vs. DirectQuery), and justify your choices with respect to HIPAA's data-at-rest and data-in-transit requirements.
PROBLEM 5 β€” CRITICAL THINKING
Critically evaluate the following claim: "The on-premises data gateway will become obsolete within five years as all enterprise data moves to the cloud." Consider technical, organizational, regulatory, and economic factors. Under what conditions might this claim hold true, and under what conditions is it likely false? Reference specific gateway features and cloud-native alternatives in your analysis.

Lesson Summary

The on-premises data gateway is a software agent that enables secure, outbound-only connectivity between on-premises data sources and the Power BI cloud service. It communicates via Azure Service Bus Relay using TLS 1.2+ encrypted WebSocket connections, ensuring no inbound firewall ports are required. Credentials are protected by an RSA-2048 asymmetric key pair generated at installation time, with the private key stored only on the gateway machine. The gateway supports both scheduled refresh (import mode) and DirectQuery data access patterns, allowing organizations to choose between data freshness and performance.

Three deployment models serve different needs: standard mode for enterprise-grade shared access with clustering and high availability; personal mode for single-user development scenarios; and VNet gateways for Azure-managed, hardware-free connectivity to Azure-hosted data sources. While cloud-native pipelines (Azure Data Factory, Fabric) represent the advanced end of the hybrid data continuum, the on-premises gateway remains indispensable for organizations with data residency requirements, legacy on-prem databases, or early-stage cloud migration strategies.

Varsity Tutors β€’ Microsoft Power BI β€’ Using Gateways β€” Use gateways for on-prem data refresh (conceptual)