I have a Power BI dataset deployed to a premium workspace through publishing a PBIX file. I have to configure an on-premises SQL Server gateway for the dataset.
If I make a change to the file and republish, the gateway "sticks" but if I make the same change via XMLA endpoint, the gateway disconnects and I have to set it up again. This defeats the purpose of programmatic deployment of XMLA endpoint.
Specifically, I have a PBIX file with a table running a piece of SQL query against our on-premises server. If I change the SQL and republish, it is all good - I can refresh the dataset. But if I right click "Script create or replace" in SSMS, make the same change to the SQL text, refresh fails with a no gateway error. If I go to the PBI workspace, I see that the gateway has indeed "disconnected" and needs re-configuring.
XMLA attached below (with identifies redacted). If I change the SQL from ">5" to ">6" or whatever and redeploy, it resets the gateway. The same change does not when published via PBI desktop.