public static async Task StartChangeFeedHost() { var config = ServiceLocator.GetService <IConfiguration>(); string hostName = config.MonitoredCollectionName + "_monitor_" + Guid.NewGuid().ToString(); DocumentCollectionInfo documentCollectionLocation = new DocumentCollectionInfo { Uri = config.DatabaseAccountUri, MasterKey = config.DatabaseAccountKey, DatabaseName = config.MonitoredDatabaseName, CollectionName = config.MonitoredCollectionName }; DocumentCollectionInfo leaseCollectionLocation = new DocumentCollectionInfo { Uri = config.DatabaseAccountUri, MasterKey = config.DatabaseAccountKey, DatabaseName = config.ChangeTrackingDatabaseName, CollectionName = config.ChangeTrackingLeaseCollectionName }; Console.WriteLine("Main program: Creating ChangeFeedEventHost..."); ChangeFeedOptions feedOptions = new ChangeFeedOptions(); ChangeFeedHostOptions feedHostOptions = new ChangeFeedHostOptions(); ChangeFeedEventHost host = new ChangeFeedEventHost(hostName, documentCollectionLocation, leaseCollectionLocation, feedOptions, feedHostOptions); await host.RegisterObserverAsync <DocumentFeedObserver>(); Console.WriteLine("Main program: press Enter to stop..."); Console.ReadLine(); await host.UnregisterObserversAsync(); }