Use secrets in Databricks
Below scripts base on python notebook
Provides utilities for leveraging secrets within notebooks. Databricks documentation for more info.
get(scope: String, key: String): String -> Gets the string representation of a secret value with scope and key getBytes(scope: String, key: String): byte[] -> Gets the bytes representation of a secret value with scope and key list(scope: String): Seq -> Lists secret metadata for secrets within a scope listScopes: Seq -> Lists secret scopes
Out[2]: [SecretScope(name='ADBDataLakeKeyVault'), SecretScope(name='DataLakeKeyVault')]
Out[7]: [SecretMetadata(key='ADSL-AccountKey'),
SecretMetadata(key='ADSL-AccountName'),
SecretMetadata(key='ADSL-ContainerName-DWData'),
SecretMetadata(key='ADSL-ContainerName-ODSData'),
SecretMetadata(key='ADSL-ContainerName-RawData')]
Out[8]: [SecretMetadata(key='ADSL-AccountKey'),
SecretMetadata(key='ADSL-AccountName'),
SecretMetadata(key='ADSL-ContainerName-DWData'),
SecretMetadata(key='ADSL-ContainerName-ODSData'),
SecretMetadata(key='ADSL-ContainerName-RawData')]
Out[11]: '[REDACTED]'
Out[14]: [FileInfo(path='abfss://[REDACTED]@[REDACTED].dfs.core.windows.net/Customer.csv', name='Customer.csv', size=196514)]
Reference
最后更新于