Hi @Jerry Pan ,
Thanks for the question and using MS Q&A platform.
When the linked service is configured with account key, it returns a SAS token as connection string that can be passed in through fs.azure.sas.blob.core.windows.net
.
As per the repro, when I used the same above code returns error message as shown above:
Note: In order to use a linked service configured with MSI for blob storage, the code would need to be changed quite a bit. Along the lines of:
spark.conf.set("spark.storage.synapse.linkedServiceName", blob_linked_service_name)
spark.conf.set("fs.azure.account.oauth.provider.type", "com.microsoft.azure.synapse.tokenlibrary.LinkedServiceBasedTokenProvider")
blob_path = 'abfss://%s@%s.dfs.core.windows.net/%s' % (blob_container_name, blob_account_name, blob_relative_path)
files = mssparkutils.fs.ls(blob_path)
When I changed the code to use the
fs.azure.account.oauth.provider.type
it works as excepted.
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on or upvote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators