This message was deleted.
# azure
s
This message was deleted.
t
I believe it expects a dictionary right now.
new Dictionary<string, object>...
p
OK, thanks I’ll try that - should it be a dictionary of
Input<T>
or should the values be resolved before @tall-librarian-49374?
And what does it expect for the template itself now? A well-formed JSON string does not seem to work.
Copy code
Diagnostics:
  azure-native:resources:Deployment (hostname-binding-template):
    error: azure-native:resources:Deployment resource 'hostname-binding-template' has a problem: 'properties.template' should be of type '' but got a string
Tried both
System.Text.Json.JsonDocument
and
JObject
but neither works.
Copy code
Diagnostics:
  pulumi:pulumi:Stack (SvcDownload-dev):
    error: Running program '/Users/danielrosenberg/Git/OrgFlow/SvcDownload/infra/bin/Debug/netcoreapp3.1/OrgFlow.Download.Pulumi.dll' failed with an unhandled exception:
    System.InvalidOperationException: System.Text.Json.JsonDocument is not a supported argument type.
        resource:hostname-binding-template[azure-native:resources:Deployment].properties.id.template.id
t
same, dictionaries
I can see how this could be painful. Mind filing an issue for that?
p
Sure, if you promise not to lose it 😉
But, I’m not sure I understand
You’re saying a whole ARM template needs to be represented as a dictionary?
In the meantime, how can I work around this? Could I use the TemplateDeployment resource from the old provider as a stop-gap?
t
Yes, you can. Or, make a helper function to convert your JSON to dictionaries recursively.
p
@tall-librarian-49374 turns out that, for the parameters dictionary, you also now have to “wrap” each value, from this:
Copy code
"sku": "Dynamic",
"skuCode": "Y1",
into this:
Copy code
"sku": {
    "value": "Dynamic"
},
"skuCode": {
    "value": "Y1"
},
To match what ARM expects. I think it would be a huge improvement if the new provider did this for you (like the old one did).
I’ll add it to the issue.
Anyway, with that out of the way, I hit the next road block:
Copy code
Diagnostics:
  azure-native:resources:Deployment (hostname-binding-template):
    error: Code="InvalidDeployment" Message="The 'location' property is not allowed for a deployment at resource group scope. Please see <https://aka.ms/deploy-to-subscription> for usage details."
I’m not specifying the “location” property anywhere, neither in the template JSON nor in the resource properties.
Any idea how to get around that one?
t
I think it would be a huge improvement if the new provider did this for you (like the old one did).
This is unlikely for now. Our current approach is staying true to the specs (even if they are sub-optimal).
p
Our current approach is staying true to the specs
I can appreciate that. A workaround is not too difficult, and the need for templated deployments should be almost zero with the new provider anyway.
t
Any idea how to get around that one?
Ouch, that’s not good. Could you try setting
location
to null in your code?
p
Yeah - on the
DeploymentArgs
object you mean, or in the template JSON?
t
In the args
p
same message 😕
t
It’s our auto-location feature kicking in… in a bad way, it seems.
yeah… I can’t think of a workaround for this
p
ouch.. hmm
What about a fix?
t
It can be fixed
p
Ok good. You need me to submit an issue?
t
Yes please
p