Spark can already directly connect to on-premises sources under strict networking controls. Unfortunately, until Azure PLS Direct Connect becomes GA, it currently requires complex Azure networking.
This feature you’re sharing is elegant in setup assuming a GW+connections are pre-provisioned to your on-premises source. However, consider the implications in that Spark itself is not running its unmanaged code directly against the source; instead, it’s by proxy of the MashUp engine.
This looks good. 180 second timeout will be a little tricky, but not too bad.
Last I checked, it seemed like running PQ from a notebook required a DFg2 object to exist as a proxy, but this notebookutils approach doesn't seem to need that anymore. If WI works without any issue, I can see myself using this instead of DFg2 for some file-based on-prem sources.
this is a very interesting method of retrieving small to medium sized data in cases where maintaining a separate pipeline or other item would be overkill, or where the native power query connector provides something you can't re-create externally easily, or has a linked credential.
this is a poor method of retrieving anything substantiative and you are far better off sinking your data to binary and reading it in the notebook directly, both from a cost, scale, and reliability perspective
it's cool to be able to re-use existing connections with no additional configuration.
if you are looking at a 20 second runtime, where the performance appears to be on par with copy data and copy job implementations, paying the extra ~200 CU's for the run if there's a clear benefit could be worth it. if you're doing it "just because", then it's not an effective use of your CU's.
billing: the queries go against the Dataflows Gen2 Run Query API, so you're paying the full 12 CU/s billed as background.
large items: Folder.Files -> select csv with 4,503,915 rows that took 1:30 to materialize via Table.RowCount() in a DFG2, failed after 2 minutes with an error multiple times, all some variation of "Expected to be able to read 177920 bytes for message body, got 159756" with different numbers each time.
small items: Folder.Files -> select csv with 7699 rows came back in 12 seconds. this was not too far off it's performance in a Copy Job.
binary: it will not transfer binary content, tables only.
I’ve been experimenting with Cloudflare (Tunnels + Zero Trust) for this, along with SOPS + age for securing the token that authenticates the connection, although you could always use Azure Key Vault for that.
Pilots are working pretty well so far, although I imagine if you’re in a more locked down networking context there would be some hurdles to get over
As far as I can tell - this only is configurable for Azure resources (cloud). What am I supposed to put in the resource identifier for an on prem server?
You'll also need to configure routing, DNS, and approve the private endpoint connection.
The MPE targeting a Private Link Service must be created through the Fabric REST API, not the UI.
There's also a newer Private Link Service Direct Connect option in preview that can eliminate the load balancer for supported configurations.
Alternatively, an on-premises data gateway can serve supported Data Factory pipeline activities, but that's a different connection mechanism from direct Spark notebook access.
Yes, this is the documented approach.
No, I don't understand why connecting a notebook to an existing SQL Server needs to be this complicated either. 😂
I gave gemini the link to learn, it created a notebook which use a on-prem gateway, and connects with a Web query to a internal hosted server. Worked first try
6
u/Data_cruncher Moderator 3d ago edited 3d ago
Spark can already directly connect to on-premises sources under strict networking controls. Unfortunately, until Azure PLS Direct Connect becomes GA, it currently requires complex Azure networking.
This feature you’re sharing is elegant in setup assuming a GW+connections are pre-provisioned to your on-premises source. However, consider the implications in that Spark itself is not running its unmanaged code directly against the source; instead, it’s by proxy of the MashUp engine.
2
u/radioblaster Fabricator 3d ago
https://learn.microsoft.com/en-us/fabric/data-engineering/notebookutils/notebookutils-power-query
as of last week, wasn't available in my region.
I also suspect this will incur DFG2 CU prices, but that's only my untested theory.
2
u/radioblaster Fabricator 2d ago
i did some fiddling around with this.
conclusion:
billing: the queries go against the Dataflows Gen2 Run Query API, so you're paying the full 12 CU/s billed as background.
large items: Folder.Files -> select csv with 4,503,915 rows that took 1:30 to materialize via Table.RowCount() in a DFG2, failed after 2 minutes with an error multiple times, all some variation of "Expected to be able to read 177920 bytes for message body, got 159756" with different numbers each time.
small items: Folder.Files -> select csv with 7699 rows came back in 12 seconds. this was not too far off it's performance in a Copy Job.
binary: it will not transfer binary content, tables only.
1
u/TrebleCleft1 3d ago
I’ve been experimenting with Cloudflare (Tunnels + Zero Trust) for this, along with SOPS + age for securing the token that authenticates the connection, although you could always use Azure Key Vault for that.
Pilots are working pretty well so far, although I imagine if you’re in a more locked down networking context there would be some hurdles to get over
1
u/kieranimal 3d ago
I am trying to figure out how to even configure this. When I try to add a connection in the notebook, it doesnt include any on prem option
1
u/Lomholdt90 3d ago
I gave gemini the link to learn, it created a notebook which use a on-prem gateway, and connects with a Web query to a internal hosted server. Worked first try