Hello,
I have parameterized linked service for storage, I am trying to access this within synapse notebook as suggested in below link - https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-secure-credentials-with-tokenlibrary?pivots=programming-language-python#adls-gen2-storage-with-linked-services
%%pyspark # Python code
source_full_storage_account_name = "teststorage.dfs.core.windows.net" spark.conf.set(f"spark.storage.synapse.{source_full_storage_account_name}.linkedServiceName", "<LINKED SERVICE NAME>")
spark.conf.set(f"fs.azure.account.oauth.provider.type.{source_full_storage_account_name}", "com.microsoft.azure.synapse.tokenlibrary.LinkedServiceBasedTokenProvider")
df = spark.read.csv('abfss://<CONTAINER>@<ACCOUNT>.dfs.core.windows.net/<DIRECTORY PATH>')
df.show()
I get below error:
Py4JJavaError: An error occurred while calling o3897.csv. : HTTP Error -1CustomTokenProvider getAccessToken threw java.io.IOException : POST failed with 'Bad Request' (400) and message: {"result":"DependencyError","errorId":"BadRequest","errorMessage":"[Code=, Target=, Message=]. TraceId : 9c989aa9-6bb3-4aea-9dbc-42814da06672 | client-request-id : 1990387d-78d0-4615-8c8a-7af2179ef5fe. Error Component : LSR"}org.apache.hadoop.fs.azurebfs.oauth2.AzureADAuthenticator$HttpException: HTTP Error -1CustomTokenProvider getAccessToken threw java.io.IOException : POST failed with 'Bad Request' (400) and message: {"result":"DependencyError","errorId":"BadRequest","errorMessage":"[Code=, Target=, Message=]. TraceId : 9c989aa9-6bb3-4aea-9dbc-42814da06672 | client-request-id : 1990387d-78d0-4615-8c8a-7af2179ef5fe. Error Component : LSR"}
However, it works fine when I hardcode the storage URL within linked service (i.e without parameterization).
Please can you help on this
Thanks,
Divya