Format JSON in IOT HUB Integration

Hello,

I’m trying to get a better format on the data I’m sending from a Photon to an IOT Hub through the out of the box integration. Currently I send data from the Photon as follows:

snprintf(eventData, sizeof(eventData),"{ “tempf”:%f}", tempf);
Particle.publish(“Photon_WeatherData”, eventData);

And I get output from the cloud events like this:

{“data”:"{ “tempf”:72.207687}",“ttl”:60,“published_at”:“2017-12-11T20:12:55.699Z”,“coreid”:“1e0037000d47353136383631”,“name”:“Photon_WeatherData”}

I tried to use a custom JSON format which I created in the integration between Azure IOT Hub and particle cloud (Advanced Settings, Custom JSON Data)

{
“tempf”:"{{tempf}}",
}

However it’s not saving this format (everytime I go back to custom, my format is gone) and I’m expecting the event data to be formatted as this (back slashes removed):

{“data”:"{ “tempf”:72.207687}",“ttl”:60,“published_at”:“2017-12-11T20:12:55.699Z”,“coreid”:“1e0037000d47353136383631”,“name”:“Photon_WeatherData”}

What am I doing wrong?

Is this trailing comma intentional? I’d rather remove it.

Accidental, this is what it is, long story short, I had other variables I was passing in and removed them all to test out this functionality. I didn’t remove the comma in the post, but it is removed in the code:

{
“tempf”:"{{tempf}}",
“PARTICLE_PUBLISHED_AT”:"{{PARTICLE_PUBLISHED_AT}}",
“PARTICLE_DEVICE_ID”:"{{PARTICLE_CORE_ID}}"
}