mysterious-australia-14256
10/09/2020, 10:48 AM{"$schema":"<https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#>","actions":{},"parameters":{},"triggers":{},"contentVersion":"1.0.0.0","outputs":{}}
Without luck (I get an error saying that the property $schema wasn't found in the JSON (though I can access it via GetProperty("$schema")).
Does anyone know the correct format? I've tried the example code from the above link but that won't buildtall-librarian-49374
10/09/2020, 11:51 AMmysterious-australia-14256
10/09/2020, 3:59 PMinternal class AzureWorkflowModel
{
[System.Text.Json.Serialization.JsonPropertyName("$schema")]
public string schema { get; set; } = "<https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#>";
public object actions { get; set; } = new object();
public object parameters { get; set; } = new object();
public object triggers { get; set; } = new object();
public string contentVersion { get; set; } = "1.0.0.0";
public object outputs { get; set; } = new object();
}
and then doing a bit of ugly conversion to get it to a JsonElement
var laDefinition = JsonSerializer.Serialize(new AzureWorkflowModel());
var laDefinitionJsonElement = JsonSerializer.Deserialize<System.Text.Json.JsonElement>(laDefinition);
the above then allows me to correctly access the $schema property
System.Console.WriteLine(laDefinitionJsonElement.GetProperty("$schema").ToString());
But passing it in to the following code results in the error reported above
return new Pulumi.AzureNextGen.Logic.Latest.Workflow(myName, new Pulumi.AzureNextGen.Logic.Latest.WorkflowArgs
{
WorkflowName = myName,
Location = myLocation,
ResourceGroupName = myResourceGroupName,
laDefinition = laDefinitionJsonElement
});