Hi @Caio Cavalcanti ,
Thank you for posting query in Microsoft Q&A Platform.
Looks strange. Even I am ending up with similar issue as you mentioned. But I tried this same in past and recorded a YouTube video on same. That time it was working fine. Please check this video for same.
As a work around you can try below code to get secret from key vault.
import sys
from pyspark.sql import SparkSession
sc = SparkSession.builder.getOrCreate()
token_library = sc._jvm.com.microsoft.azure.synapse.tokenlibrary.TokenLibrary
connection_string = token_library.getSecret("AKV-cshaik", "testSecret", "AzureKeyVault1")
print(connection_string)
I tried above code. It working good. Please consider using same in your case too.
Please note, I informed to PG about getSecret() function issue. Waiting for there response. I am hoping PG team to fix this issue or update documentation accordingly. I will update thread after getting updates. Thank you for spoting this.
Hope this helps. Please let us know if any further queries.
-----------------
Please consider hitting Accept Answer
button. Accepted answers help community as well.