I have an EventHub trigger implemented with Azure Functions App. My business logic implementation was wrong in that function and had to correct it. I have corrected my implementation on Functions App, how would I change the checkpoint to that Azure Function to go back 24 hours and make the stream data available to Functions App?
When I needed to start processing of events in a Hub from scratch, I went to Blob Storage -> azure-webjobs-hosts
container and deleted the blobs with names like yournamespace.servicebus.windows.net/yourhub/$Default/X
. Those blobs store the current checkpoints, so if you restart the Function App, it will start processing from the first event.
I know it's hacky, but works for such basic scenario. Maybe somebody will suggest a better way.
The problem remains that you likely don't know the sequence number used on each partition 24 hours ago, otherwise, Mikhail's suggestion may work with an modified step of going into each blob and editing the sequence number instead of deleting all blob entries.
You should probably just start from the beginning. Here are the steps:
- Go to the EventHub portal.
- Create a new consumer group, e.g. name it "GroupB"
- Edit your function.json and add the following entry to the trigger section,
"consumerGroup": "GroupB"
- Save your changes.
You should see that your Function will start processing events from the very beginning on the GroupB consumer group.
来源:https://stackoverflow.com/questions/46199269/how-to-go-back-to-a-checkpoint-with-azure-eventhub-trigger-to-functions