This message was deleted.
# azure
s
This message was deleted.
t
Yeah, it looks like the Azure API spec isn’t great there, so we generate an untyped object. Do you have a sample for me to try?
Feel free to add your code based on JsonElement and I will try it too
m
Thanks @tall-librarian-49374, That's a bit more direct than what I was trying 🙂 I was starting with the following class
Copy code
internal 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
Copy code
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
Copy code
System.Console.WriteLine(laDefinitionJsonElement.GetProperty("$schema").ToString());
But passing it in to the following code results in the error reported above
Copy code
return new Pulumi.AzureNextGen.Logic.Latest.Workflow(myName, new Pulumi.AzureNextGen.Logic.Latest.WorkflowArgs
{
    WorkflowName = myName,
    Location = myLocation,
    ResourceGroupName = myResourceGroupName,
    laDefinition = laDefinitionJsonElement
});