enough-butcher-66045
06/30/2021, 10:13 AMpulumi import
output into C#
This is what pulumi gives me...
var slack_webhook = new AzureNative.Web.WebAppFunction("slack-webhook", new AzureNative.Web.WebAppFunctionArgs
{
Config =
{
{ "bindings",
{
{
{ "authLevel", "function" },
{ "direction", "in" },
{ "methods",
{
"get",
"post",
} },
{ "name", "req" },
{ "type", "httpTrigger" },
},
{
{ "direction", "out" },
{ "name", "res" },
{ "type", "http" },
},
} },
},
This is what I've mapped the Config to:
Config = new {
Bindings = new object[]
{
new
{
AuthLevel = "function",
Direction = "in",
Name = "req",
Type = "httpTrigger"
},
new
{
Direction = "out",
Name = "res",
Type = "http"
}
}
},
I have no syntax errors in the IDE, but when I try running it I get:
System.InvalidOperationException: <>f__AnonymousType0`1[[System.Object[], System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=asdasd]] is not a supported argument type.
resource:slack-webhook[azure-native:web:WebAppFunction].config.id
at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
at Pulumi.Serialization.Serializer.SerializeAsync(String ctx, Object prop, Boolean keepResources)
at Pulumi.Deployment.SerializeFilteredPropertiesAsync(String label, IDictionary`2 args, Predicate`1 acceptKey, Boolean keepResources)
at Pulumi.Deployment.PrepareResourceAsync(String label, Resource res, Boolean custom, Boolean remote, ResourceArgs args, ResourceOptions options)
at Pulumi.Deployment.RegisterResourceAsync(Resource resource, Boolean remote, Func`2 newDependency, ResourceArgs args, ResourceOptions options)
at Pulumi.Deployment.ReadOrRegisterResourceAsync(Resource resource, Boolean remote, Func`2 newDependency, ResourceArgs args, ResourceOptions options)
at Pulumi.Deployment.CompleteResourceAsync(Resource resource, Boolean remote, Func`2 newDependency, ResourceArgs args, ResourceOptions options, ImmutableDictionary`2 completionSources)
at Pulumi.Deployment.Runner.<>c__DisplayClass9_0.<<WhileRunningAsync>g__HandleCompletion|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Pulumi.Deployment.Runner.WhileRunningAsync()
I'm wondering what should I use instead?
This is what the WebAppFunctionArgs type hint looks like (this is for azure native)
Thanks