Skip to content

Commit 115a1c7

Browse files
Merge pull request #212609 from SnehaGunda/SynapseIssues1
Updating TokenLibrary.GetSecret() method
2 parents 92532ef + 8709d65 commit 115a1c7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

articles/synapse-analytics/spark/apache-spark-secure-credentials-with-tokenlibrary.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: mlee3gsd
66
ms.service: synapse-analytics
77
ms.topic: overview
88
ms.subservice: spark
9-
ms.date: 11/19/2020
9+
ms.date: 09/26/2022
1010
ms.author: martinle
1111
ms.reviewer: nirav
1212
zone_pivot_groups: programming-languages-spark-all-minus-sql
@@ -316,20 +316,20 @@ print(accountKey)
316316

317317
::: zone-end
318318

319-
#### getSecret()
319+
#### GetSecret()
320320

321321
To retrieve a secret stored from Azure Key Vault, we recommend that you create a linked service to Azure Key Vault within the Synapse workspace. The Synapse workspace managed service identity will need to be granted **GET** Secrets permission to the Azure Key Vault. The linked service will use the managed service identity to connect to Azure Key Vault service to retrieve the secret. Otherwise, connecting directly to Azure Key Vault will use the user's Azure Active Directory (AAD) credential. In this case, the user will need to be granted the Get Secret permissions in Azure Key Vault.
322322

323-
`TokenLibrary.getSecret("<AZURE KEY VAULT NAME>", "<SECRET KEY>" [, <LINKED SERVICE NAME>])`
323+
`TokenLibrary.GetSecret("<AZURE KEY VAULT NAME>", "<SECRET KEY>" [, <LINKED SERVICE NAME>])`
324324

325-
To retrieve a secret from Azure Key Vault, use the **TokenLibrary.getSecret()** function.
325+
To retrieve a secret from Azure Key Vault, use the **TokenLibrary.GetSecret()** function.
326326

327327
::: zone pivot = "programming-language-scala"
328328

329329
```scala
330330
import com.microsoft.azure.synapse.tokenlibrary.TokenLibrary
331331

332-
val connectionString: String = TokenLibrary.getSecret("<AZURE KEY VAULT NAME>", "<SECRET KEY>", "<LINKED SERVICE NAME>")
332+
val connectionString: String = TokenLibrary.GetSecret("<AZURE KEY VAULT NAME>", "<SECRET KEY>", "<LINKED SERVICE NAME>")
333333
println(connectionString)
334334
```
335335

@@ -344,7 +344,7 @@ from pyspark.sql import SparkSession
344344
sc = SparkSession.builder.getOrCreate()
345345
token_library = sc._jvm.com.microsoft.azure.synapse.tokenlibrary.TokenLibrary
346346

347-
connection_string = token_library.getSecret("<AZURE KEY VAULT NAME>", "<SECRET KEY>", "<LINKED SERVICE NAME>")
347+
connection_string = token_library.GetSecret("<AZURE KEY VAULT NAME>", "<SECRET KEY>", "<LINKED SERVICE NAME>")
348348
print(connection_string)
349349
```
350350

0 commit comments

Comments
 (0)