Forum Discussion
Fabric UDFs Deployment ISSUEs
- 28 days ago
Hi Hansie151,
Yes — the pattern you describe strongly points to a Fabric UDF dependency/runtime mismatch, rather than a problem with your BigQuery credentials or the get_bigquery_client() logic.
The key clue is: Works in Test/Develop mode, fails only after Publish → Run only mode, and adding google-cloud-bigquery triggers it.
Please check this.
This looks like a Fabric User Data Functions (UDF) deployment/runtime issue rather than an issue with your Python code itself.
Since the function works in Test mode but fails in Run/Published mode, and you have isolated the problem to the "google-cloud-bigquery" / "google.oauth2" packages, I would check the production dependency resolution first.
A few things I would try:
1. Pin the package versions instead of relying on the latest versions. For example, explicitly define compatible versions of:
- "google-cloud-bigquery"
- "google-auth"
- "google-api-core"
2. Check the published environment's dependency list and confirm that the Google packages are actually being included after publishing. Test mode can sometimes have a different dependency/runtime context than the deployed function.
3. Try importing the packages separately:
import google.auth
import google.oauth2.credentials
import google.cloud.bigquery
This can help identify whether the failure occurs during module initialization.
4. Since the error is only:
"WorkloadException / NotFound"
and does not expose the underlying Python exception, check the Fabric monitoring/logging output for the published invocation. The actual import/dependency error may be hidden behind the generic workload error.
5. As a diagnostic, temporarily remove the BigQuery imports and the "get_bigquery_client()" call. If the published function runs successfully, that further confirms the dependency/runtime issue.
One other thing I'd test is changing:
from google.oauth2.credentials import Credentials
to a lazy import inside the "PERSONAL" branch. That prevents the Google OAuth package from being loaded when the function is initialized:
if auth_type_upper == "PERSONAL":
from google.oauth2.credentials import Credentials
...
Given that this worked previously and started failing after a relatively small change, I'd also compare the package versions and Fabric runtime/deployment configuration between the last working publication and the current one.
If all of this checks out, I'd raise it with Microsoft as a Fabric Functions deployment regression, providing the function definition, dependency versions, and the fact that Test mode succeeds while Published/Run mode returns "WorkloadException: NotFound".
Please let me know if any of the above solution works for you .