Fina Silva-Santisteban
11/04/2021, 8:28 PMCreate API Key
option in prefect cloud’s Service Account
page. When I use that for flow registration I get this warning:
/opt/hostedtoolcache/Python/3.9.7/x64/lib/python3.9/site-packages/prefect/client/client.py:175: UserWarning: Client was created with an API token configured for authentication. API tokens are deprecated, please use API keys instead.
I set the auth token/key in a python file like this:
client = prefect.Client(
api_token='secret value'
)
client.save_api_token()
The docs only seem to show how to set auth_api_key
when using the prefect cli or a graphql query. Does this mean using the api you’re still using the deprecated token? (I’ve peeked into prefect’s implementation for the Client
class and everything still says api_token
, but that might be a red herring!)Kevin Kho
api_key
instead of api_token
in the Client. Key is now preferred going forward. A bit more info in the docstring hereKevin Kho
key
is preferred over token, but token is still backward compatible, which is why you may see it in the source code.Fina Silva-Santisteban
11/05/2021, 1:12 PMapi_key
!)