How to pass unescaped JSON to Azure IoTHub?

@Dave Can help clarify on the JSON string issues.

Yes, I get separate table columns placed into the Azure Table storage and here is what my code and JSON Template look like to do that:

Here is the code I'm testing on a Photon:


char Org[] = "My_ORGANIZATION";
char Disp[] = "Particle Photon";
char Locn[] = "Fishers, IN";

const char* cityLocation = "Fishers"; //City for my Photon
const char* stateLocation = "IN"; // State for my Photon

int SOC = 95;
float Voltage = 12.80;
float Current = 5.25;
float TTG = 35.4;
float Temperature = 81.3;
float SolarVin = 24.2;
float SolarVmp = 19.2;
float SolarW = 56.2;


// The on-board LED
int led = D7;

void setup() {
  pinMode(led, OUTPUT);
}
void loop() {




  char payload[255];
  // Turn the LED ON
 digitalWrite(led, HIGH);

  snprintf(payload, sizeof(payload), "{ \"s\": %d, \"v\": %.2f, \"i\": %.2f, \"t\": %.2f,\"f\": %.2f, \"s\": %.2f, \"m\": %.2f, \"w\": %.2f,\"l\":\"%s\" }", SOC, Voltage, Current, TTG, Temperature, SolarVin, SolarVmp, SolarW, Locn);
   //Serial.println(payload);
  //   Spark.publish("AzureElectron", payload, NO_ACK);   //The NO_ACK is currently only working with RC 0.6.0 rc1 firmware. This is just a test. For Electron
   Particle.publish("Azure_IOT_Almost", payload, PRIVATE);


  // Turn the LED off
  digitalWrite(led, LOW);
  delay(10000);
}

And here is how I have the Azure IoT Hub setup with custom JSON formatting to get the data fields into separate columns in Azure Table Storage:

Then using this Azure Stream Analytics Query:

I get data in separate columns in the Azure Table Database:

Does that help you any?

2 Likes