powerful-football-81694
03/07/2021, 10:58 PMreturn new DeploymentArgs()
{
DeploymentName = "hostname-binding-template",
ResourceGroupName = resourceGroupName,
Location = location,
Properties = new DeploymentPropertiesArgs()
{
Mode = DeploymentMode.Incremental,
Parameters = new
{
webAppName = webAppName,
hostname = hostname,
sslState = sslState.ToString(),
thumbprint = thumbprint
},
Template = templateJson
}
};
This gets us an exception when running pulumi up
:
System.InvalidOperationException: <>f__AnonymousType0`4[[Pulumi.Input`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Pulumi, Version=2.21.2.0, Culture=neutral, PublicKeyToken=null],[Pulumi.Input`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Pulumi, Version=2.21.2.0, Culture=neutral, PublicKeyToken=null],[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Pulumi.Input`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Pulumi, Version=2.21.2.0, Culture=neutral, PublicKeyToken=null]] is not a supported argument type.
So I checked the XML docs for the Parameters
property, which say:
// Summary:
// Name and value pairs that define the deployment parameters for the template.
// You use this element when you want to provide the parameter values directly in
// the request rather than link to an existing parameter file. Use either the parametersLink
// property or the parameters property, but not both. It can be a JObject or a well
// formed JSON string.
[Input("parameters", false, false)]
public Input<object>? Parameters { get; set; }
So I tried a JSON string instead, but then we get a different error:
error: azure-native:resources:Deployment resource 'hostname-binding-template' has a problem: 'properties.parameters' should be of type '' but got a string
Can someone tell me how I should pass the parameters now? With the old provider, the anonymous object approach worked fine.
The C# examples here don’t give any hint - they are even incorrect C# syntax (value for the Parameters
property is just missing from the code snippet:
https://www.pulumi.com/docs/reference/pkg/azure-native/resources/deployment/tall-librarian-49374
03/08/2021, 7:02 AMnew Dictionary<string, object>...
powerful-football-81694
03/08/2021, 9:40 AMInput<T>
or should the values be resolved before @tall-librarian-49374?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
System.Text.Json.JsonDocument
and JObject
but neither works.
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
tall-librarian-49374
03/08/2021, 10:44 AMpowerful-football-81694
03/08/2021, 11:52 AMtall-librarian-49374
03/08/2021, 11:57 AMpowerful-football-81694
03/08/2021, 12:07 PM"sku": "Dynamic",
"skuCode": "Y1",
into this:
"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).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.tall-librarian-49374
03/08/2021, 12:51 PMI 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).
powerful-football-81694
03/08/2021, 12:54 PMOur current approach is staying true to the specsI can appreciate that. A workaround is not too difficult, and the need for templated deployments should be almost zero with the new provider anyway.
tall-librarian-49374
03/08/2021, 12:54 PMAny idea how to get around that one?Ouch, that’s not good. Could you try setting
location
to null in your code?powerful-football-81694
03/08/2021, 12:54 PMDeploymentArgs
object you mean, or in the template JSON?tall-librarian-49374
03/08/2021, 12:54 PMpowerful-football-81694
03/08/2021, 12:55 PMtall-librarian-49374
03/08/2021, 12:56 PMpowerful-football-81694
03/08/2021, 12:59 PMtall-librarian-49374
03/08/2021, 2:51 PMpowerful-football-81694
03/08/2021, 3:31 PMtall-librarian-49374
03/08/2021, 3:40 PMpowerful-football-81694
03/08/2021, 4:00 PM