Created
May 5, 2018 05:11
-
-
Save kennetham/ff739149439a9ea3eb94f6e0dafe91a9 to your computer and use it in GitHub Desktop.
Queue Trigger - HTTP POST Logic App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "Newtonsoft.Json" | |
using System; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using Newtonsoft.Json; | |
public static void Run(string myQueueItem, TraceWriter log) | |
{ | |
log.Info($"C# Queue trigger function processed: {myQueueItem}"); | |
SendQueue(myQueueItem); | |
} | |
public static async Task<string> SendQueue(string queueItem) | |
{ | |
using (var client = new HttpClient()) | |
{ | |
Dictionary<string, string> dictionary = new Dictionary<string, string>(); | |
dictionary.Add("blob_name", queueItem); | |
string json = JsonConvert.SerializeObject(dictionary); | |
var requestData = new StringContent(json, Encoding.UTF8, "application/json"); | |
var response = await client.PostAsync(String.Format(ConfigurationManager.AppSettings["LogicAppUri"]), requestData); | |
var result = await response.Content.ReadAsStringAsync(); | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment