https://pulumi.com logo
#general
Title
# general
b

brief-action-50530

02/04/2022, 7:37 PM
I am trying to create a VirtualMachineExtension using pulumi using C# but the type for settings and protectedSettings are Input<object>. I tried many things but I couldn’t make it work. Does anyone have any example on how to do this?
https://www.pulumi.com/registry/packages/azure-native/api-docs/compute/virtualmachineextension/#inputs
m

miniature-musician-31262

02/04/2022, 10:23 PM
Do you have some code you can share that shows how you’re declaring the
VirtualMachineExtension
instance? And anything useful you might be seeing in an error message?
f

famous-parrot-52821

02/07/2022, 4:30 PM
@miniature-musician-31262 I have shared the code I am using as well as the error message I am getting
m

miniature-musician-31262

02/07/2022, 10:18 PM
Thanks. I’m definitely no Azure expert, but it looks like you’re passing a (JSON-serialized)
ProtectedSettings
where a
Settings
is expected — but the properties look okay (at least from my reading of the schema), so I’m guessing that’s maybe not it. Might want to try lining those up a bit better, though, just to rule it out as a possible cause. https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-windows#troubleshoot-and-support
t

tall-librarian-49374

02/07/2022, 10:22 PM
Try
new Dictionary<string, object> { ... }
f

famous-parrot-52821

02/08/2022, 3:23 PM
@tall-librarian-49374 I found this example using Dictionary https://github.com/Azure/azure-libraries-for-net/issues/119 but with azure-native it is not accepting Dictionary. The type in Pulumi.Azure was Input<string> but now in Pulumi.AzureNative is Input<object> and doesn't accept Dictionary as input
t

tall-librarian-49374

02/08/2022, 3:39 PM
doesn’t accept Dictionary as input
Is it a compilation or a runtime error?
f

famous-parrot-52821

02/09/2022, 2:36 PM
Compilation
6 Views