Does anyone have suggestions for how to manage/mai...
# ask-community
e
Does anyone have suggestions for how to manage/maintain a whole bunch (~200) of Secret Blocks on Cloud? It's not clear to me that there's a way to delete them programmatically, and I also am generally hesitant to clutter my Block catalog with all these secrets. There is some structure to the values (they're API keys) and they'd fit into a dictionary, but my understanding is that a JSON block wouldn't remain secret. Is there a more elegant solution other than loading them individually or creating and registering a dictionary-of-secret-values block?
n
It's not clear to me that there's a way to delete them programmatically
Copy code
from prefect.blocks.system import Secret

Secret.delete("your-secret")
https://github.com/PrefectHQ/prefect/blob/main/src/prefect/blocks/core.py#L1001 you can also make a block with a secret dict attached
e
oh, great!Thanks