I have to “do.” So, I read the docs, then pick an old project I’ve implemented with another technology and look at the problem it solved, then see what the solution looks like with the new technology.
The issue is definitely because the original code was just designed as a personal tool so the only nod to concurrency is that the exception is thrown before inserting the new link so there are no “bad links.” The code you used seems like it should be the right approach (i.e. if a 412 is thrown, reload the key, increment…
EventHub is for big data streams. It’s a pull/poll model, not push, and supports strict ordering and replay. It’s also not billed on a consumption model (serverless) like Event Grid is.