Exemple #1
0
        /// <summary>
        /// Send a event to Event Grid Topic
        /// </summary>
        /// <returns>A task</returns>
        public async Task SendEventAsync()
        {
            TopicCredentials topicCredentials = new TopicCredentials(TopicKey);
            EventGridClient  client           = new EventGridClient(topicCredentials);

            EventGridEvent eventWithReference = await _storage.UploadEventAsync(GetEvent());

            await client.PublishEventsAsync(new Uri(TopicEndpoint).Host, new List <EventGridEvent>() { eventWithReference });
        }