https://prefect.io logo
Title
d

David Beck

11/10/2022, 4:39 PM
Hi again, in Prefect Cloud, once you have registered a new block, how does one remove it? So far I can't find anything in the documentation.
1
b

Bianca Hoch

11/10/2022, 4:41 PM
Hi David, you should be able to delete the block by selecting the menu button to the right of the block record.
d

David Beck

11/10/2022, 4:43 PM
@Bianca Hoch I think you're misunderstanding my question. I registered a new block type in the Cloud, but now I want remove that type. Specificially, I created this Azure Key Vault Credentials block and now I want that removed.
There is nothing in the UI I can see that can remove that type
perhaps there is a command line option to remove it?
k

Kalise Richmond

11/10/2022, 4:45 PM
does uninstalling the collection remove the block type?
:upvote: 1
d

David Beck

11/10/2022, 4:46 PM
@Kalise Richmond how do I do that? Also this a block that I created, not part of the known collections Prefect provides
a custom block
🤔 2
k

Khuyen Tran

11/10/2022, 4:54 PM
You can delete a block through a command line by typing the following on the CLI
prefect block type delete block-type
:gratitude-thank-you: 1
d

David Beck

11/10/2022, 6:10 PM
@Khuyen Tran I get a
Block Type 'AzureKeyVaultCredentials' not found!
error. I used this command:
prefect block type delete AzureKeyVaultCredentials
z

Zanie

11/10/2022, 6:11 PM
@David Beck I believe you will need to pass the slug, you can see it in
prefect block type ls
d

David Beck

11/10/2022, 6:13 PM
@Zanie using the slug yields a cannot delete block type error
z

Zanie

11/10/2022, 6:17 PM
Can you share the full output?
d

David Beck

11/10/2022, 6:17 PM
Cannot delete Block Type 'azure-key-vault-credentials'!
that is in fact the slug provided by the ls operation
z

Zanie

11/10/2022, 6:24 PM
Let me get a blocks expert in the thread 🙂 cc @alex
Let’s get some actual information about the error.. here’s a patch to add a log: https://github.com/PrefectHQ/prefect/compare/block-type-delete-status
a

alex

11/10/2022, 6:31 PM
Hmmm, that’s very interesting that you’re getting an error when trying to delete a block type. Have you used that block type to create any blocks?
z

Zanie

11/10/2022, 6:31 PM
You can install with
pip install git+<https://github.com/PrefectHQ/prefect@block-type-delete-status>
d

David Beck

11/10/2022, 6:32 PM
@alex I did create a block but I have since deleted that block
@Zanie
Received error from the the API: {'exception_message': 'Internal Server Error'}
Cannot delete block type 'azure-key-vault-credentials'! Status code 500.
that's the error revealed after doing that install
z

Zanie

11/10/2022, 6:52 PM
Thanks! I’ll track down that internal error with our Cloud team.
👍 1
c

Chris Guidry

11/10/2022, 7:15 PM
Thanks for the ping, @Zanie! I talked to @David Beck offline and we got it squared away, and I’ve got an exciting query plan to read! Win-win!
d

David Beck

11/10/2022, 7:16 PM
Thanks all for your help!