Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL preview
Databricks Runtime 15.0 and above
Extracts a secret value with the given scope and key from Databricks secret service, or NULL if the key cannot be retrieved.
Syntax
try_secret ( scope, key )
Arguments
scope: A constant string expression containing the scope of the secret to be extracted. The scope is the namespace in which multiple keys might reside.key: A constant string expression with the key of the secret to be extracted.
Returns
A STRING.
If the key cannot be retrieved the function returns NULL.
To raise INVALID_SECRET_LOOKUP instead, use the secret() function.
To retrieve a list of all secrets the user is authorized to see use the list_secrets function.
Common error conditions
Examples
> SELECT * FROM list_secrets();
scope key
------------ ---------------
secrets.r.us theAnswerToLife
> SELECT try_secret('secrets.r.us', 'theAnswerToLife');
fourtyTwo
> SELECT try_secret('secrets.r.us', 'WhatIsTheAnswerToLife');
NULL