#r "Newtonsoft.Json"
using System;
using Newtonsoft.Json;
using System.Threading.Tasks;
public static string Run(string mySbMsg, TraceWriter log)
{
log.Info($"C# ServiceBus topic trigger function processed message: {mySbMsg}");
dynamic MyData = JsonConvert.DeserializeObject(mySbMsg);
DateTime functiondate = MyData.functiondate;
MyData.storefunctiondate = DateTime.UtcNow;
//calculate time difference from sent to received and write to console
TimeSpan timedifference = DateTime.UtcNow - functiondate;
double timespan = timedifference.Milliseconds;
MyData.functiontimespan = timespan;
string outmessage = JsonConvert.SerializeObject(MyData);
return outmessage;
}
-
Notifications
You must be signed in to change notification settings - Fork 0
hybridflux/PingIoTContdFunctions
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Use Azure Functions to process a json messsage
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published