For keeping the elasticsearch index up-to-date I have hooked into the content events (registered by an initializationmodule). When hosting this site in Azure using multiple websites (servers) does this event get triggered for every instance? If so the index will be updated multiple time (by every instance), how can I avoid this?
My second question is about scheduled jobs, are these only run on one instance?
Only cache invalidation messages propagates to all servers, and of course your custom event messages. Not content events.
Scheduled jobs could run from multiple instances, but only one at the time. You can disable the scheduler from a server by setting EnableScheduler to false in application settings.
So if I understand correctly save, update and deletes propagates to all servers but things like move not?
I'm hosting with azure (websites) with auto-scale and I'm not sure if I can enforce one of the running instances to have the appsetting to true. What is the best way to solve this? Store a execution date by using the dds?
No content events, only cache invalidation messages! So it's safe for you to subscribe to content event and push content to a search engine.
The scheduler already keep track of running instances, so you don't have to that. That's not the reason for disabling the scheduler. But in some cases you have to do that depending on what your job is actually doing. E.g. you might have a folder on disk where xml files are dropped and then a job imports them, and this folder is only available on one of the servers...