简体   繁体   中英

How to administer the Azure Durable functions Task Hub locally?

I am currently developing an Azure Durable Function and I ran into the issue that unfinished orchestrations would hang around for next time after I tried to run my functions.

The problem was the task hub, as explained in the answer to this question :

Orchestrations were created and did not finish in a previous run. Orchestrations are durable and long-running, so they will continue to try to run until they complete or fail, even after you shut down your function app and restart it.

The problem now is that while there is information on how I'd manage the task hub on Azure, I cannot then find any information on how to administer it while I am doing local testing.

Right now, I change the name of the test hub every time the problem arises, but I would much rather have a few lines of code that simply clear any existing data in the task hub.

How do I administer the Azure Durable functions Task Hub locally, in code?

As suggested in the comments, you can use the Azure Storage Emulator to clear out your local instances of the TaskHub. You can actually use the command AzureStorageEmulator.exe clear all if you don't have any other data stored in your local emulated storage that you care about. According to this answer , you can find that exe in C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\Storage Emulator .

If you do have blobs, tables, or queues that are being emulated locally that you don't want to wipe just to remove the reference to the TaskHub, you can do as Murray Foxcroft suggested in the comments and use the storage explorer to connect to your local emulator, and remove all references to your specific TaskHub. The TaskHub uses a combination of tables, blobs, and queues, so make sure to be thorough.

Durable Functions Monitor VsCode 扩展显示您所有的任务中心,并允许管理、清理甚至删除它们。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM