Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Solved! Go to Solution.
HI @riyajshaikh09,
For the library and command which I mentions, they should similar as below code:
pip install azure-core
pip install azure-storage-blob
pip install semantic-link
In addition, you can refer to the following links about install Azure libraries.
How to install Azure SDK library packages for Python - Python on Azure | Microsoft Learn
Package index for Azure SDK libraries for Python - Python on Azure | Microsoft Learn
Regards,
Xiaoxin Sheng
HI @riyajshaikh09,
azurebfs.SecureAzureBlobFileSystem not found
According to the error message, it seems related to azure libraries. I suppose that you may lose some of libraries that in your environment so the code cannot be initialized/processed.
If that is the case, I'd like to suggest you check if these code processing required to attach 'Azure' and 'Azure Blob Storage' libraries. (when you run these codes on service side, it already includes and initialize some of required libraries)
Regards,
Xiaoxin Sheng
So how to fix this? which libraries I need to install?
Hi @riyajshaikh09,
Have you tried to import the azure libraries(e.g. azure core and azure blob storage) which appeared in the error messages before row 'import sempy.fabric as fabric'?
Regards,
Xiaoxin Sheng
can you give the commands?
HI @riyajshaikh09,
For the library and command which I mentions, they should similar as below code:
pip install azure-core
pip install azure-storage-blob
pip install semantic-link
In addition, you can refer to the following links about install Azure libraries.
How to install Azure SDK library packages for Python - Python on Azure | Microsoft Learn
Package index for Azure SDK libraries for Python - Python on Azure | Microsoft Learn
Regards,
Xiaoxin Sheng
Hi, @riyajshaikh09
Ensure that the necessary packages are installed. Run the following command in the VSCode terminal.
pip install semantic-link
pip install azure-core
pip install azure-storage-blob
Make sure your import statements are correct and the Python package is available:
from pyspark.sql import SparkSession
from pyspark.sql.types import StructType, StructField, IntegerType, BooleanType, StringType
from pyspark.sql.functions import col, max, current_date
import sempy.fabric as fabric
import json
from datetime import datetime
from azure.core.credentials import AccessToken
from azure.storage.blob import BlobServiceClient
To resolve the missing Hadoop filesystem class for Py4JJavaError, make sure that the necessary Hadoop and Azure configurations are set up correctly.
Add the following to your Spark configuration:
spark = SparkSession.builder \
.appName("MergeWithRowHash") \
.config("fs.azure.account.auth.type.<your_storage_account>.dfs.core.windows.net", "OAuth") \
.config("fs.azure.account.oauth.provider.type.<your_storage_account>.dfs.core.windows.net", "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider") \
.config("fs.azure.account.oauth2.client.id.<your_storage_account>.dfs.core.windows.net", "<your-client-id>") \
.config("fs.azure.account.oauth2.client.secret.<your_storage_account>.dfs.core.windows.net", "<your-client-secret>") \
.config("fs.azure.account.oauth2.client.endpoint.<your_storage_account>.dfs.core.windows.net", "https://login.microsoftonline.com/<your-tenant-id>/oauth2/token") \
.getOrCreate()
Ensure that the path to the Azure Data Lake file system is in the correct format:
df = spark.read.json('abfss://<container-name>@<storage-account>.dfs.core.windows.net/<directory-path>/config.json')
Ensure that hadoop-azure and azure-data-lake-storeJARs are available in the Spark class path. You may need to download the JAR files and place them in the Spark installation jars directory or add them to the Spark configuration:
spark = SparkSession.builder \
.appName("YourAppName") \
.config("spark.jars", "/path/to/hadoop-azure.jar,/path/to/azure-data-lake-store.jar") \
.getOrCreate()
In addition, you should check for any proxy settings or network issues that may be preventing access to Azure services.
hackcrr
If this post helps, then please consider Accept it as the solution and kudos to this post to help the other members find it more quickly
But while we are running in Fabric workspace we dont need to do all these.
we can directly call this
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
9 | |
4 | |
3 | |
3 | |
2 |