Data Engineer Diary: How to make Power BI Gateway work in an environment with a proxy

With this blog post, I would like to show and describe to you the last lesson that I learned on my recent project regarding the installation and configuration of Power BI Gateway (PBI GW). If you haven’t read my previous blog posts about PBI GW you can do so there: first and second

When I was installing PBI GW in the client’s environment I did the installation in a traditional way. I have downloaded the installation package for Standard GW and run it. The only prerequisite for that installation was that the internal IT team added my account to the privileged users (in PowerPlatform Admin Portal). That was easy and straightforward.

I named the PBI GW that was being installed, saved the recovery key, and then I hit a very weird thing that has never happened to me. When I clicked Configure button, the refresh icon next to it kept rotating for several minutes. After that, it gave me an error message that is displayed in the picture below.

 

When I clicked on Show Details it stated:

Failed to update gateway details. You may need to change the account the gateway runs under.

This request operation sent to net.tcp://127.0.0.1:45375/powerbi/gatewayconfiguration/service did not receive a reply within the configured timeout (00:01:00).  The time allotted to this operation may have been a portion of a longer timeout.  This may be because the service is still processing the operation or because the service was unable to send a reply message.  Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.”

Once you click Cancel you see your PBI GW in an offline state.

 

 

I was confused. I did not expect that.

But then I realized that client’s network environment used a proxy server. Briefly, a proxy server is a “mediator” through which must the requests flow to communicate with the Internet, otherwise, they won’t be fulfilled. PBI GW was trying to communicate with the Cloud (Azure Service Bus) directly, but it was not able to deliver the request and due to that there were those timeout issues (problematic part is marked as 1. below).

 

 

I had to adjust it and tell the PBI GW to use that Proxy server that would mediate the communication between on-prem and Cloud. So, I googled how to do so.

Thankfully there is a great MS docs page that in detail describes what you must do to make it work. Long story short, there are three .NET configuration files that you must adjust depending on your use case.

The first two files:

  • enterprisegatewayconfigurator.exe.config
  • Microsoft.PowerBI.EnterpriseGateway.exe.config

must be adjusted to make it work. With this configuration, you are changing the connection in a way that is shown on the picture above and marked as number 2. The change that you must do is to add a proxy element into those config files (details and more details).

The third file:

  • Microsoft.Mashup.Container.NetFX45.exe.config

must be adjusted if you want to enable connection with cloud data sources via PBI GW.

In our use case, we modified the first two files. PBI GW then jumped into an Online state, and it worked like a charm. We were able to add the data sources in PBI Service and use that GW seamlessly for the scheduled refreshes.

I have been working at Joyful Craftsmen for several years as a Data Engineer. However, what I enjoy most is the intensive work with Power BI and I am generally one of the passionate developers of Microsoft BI. Not only did I gain a lot of experience during my previous projects, but I also passed several MS BI certification exams. I am one of the organizers of the Czech Power BI User Group.

PAVEL ŘEHÁK
Data Engineer

LinkedIn

4 Comments. Leave new

  • first file name is missing/scrambled.

    EnterpriseGatewayConfigurator.exe.config

    Reply
  • Wally Schreiber
    22. 6. 2022 20:38

    In your article you mentioned that you got this error “Failed to update gateway details. You may need to change the account the gateway runs under” and to fix it you did “In our use case, we modified the first two files. PBI GW then jumped into an Online state, and it worked like a charm.”

    I have a QA and Prod environment set up using the corporate proxy and documented how I did it. I am doing the same in a new UAT environment and I for the life of me can’t get past that issue. I’ve triple checked everything from (Proxy settings on the server, in the config files, Trusted sites, tried to different logins for the service, reinstalled, rebooted numerous times, etc. It creates the Gateway (I see it in the cloud) but the server does not see it.

    Reply
    • It is difficult to tell what could be the bottleneck from your description. There must be something missing / something different in the UAT environment if it works in the QA and PROD. In our case, it was a typical installation plus the adjustment of the .config files. Then it worked seamlessly.

      Reply

Leave a Reply

Your email address will not be published.

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu