[QUERY] How to use custom script extensions with Azure.ResourceManager.Compute? #13114
Labels
Compute - Extensions
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Mgmt
This issue is related to a management-plane library.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
TLDR
I'm at a loss on how to set VirtualMachineScaleSetExtension.Setting in order to run custom script extensions.
Query/Question
I'm trying to create a scaleset with a custom script extension. The equivalent ARM template section would be:
I can't seem to find a way to do something similar with the new Azure.ResourceManager.Compute library.
I've tried using an anonymous object, but this fails with a NotSupportedException:
I've also tried just passing a JSON string - the scaleset gets created, but the extension fails because the JSON isn't formatted properly. This code
returns this setting (note the extra quote the beginning and end)


as opposed to this desired setting
I looked at the SDK serialization code (here and here) and found that it does this, which explains my results:
So I tried writing a small CustomScriptSettings class that implements IUtf8JsonSerializable, but that interface is internal.
I understand this is still in preview, so this scenario might just not have been fully implemented yet.
Thanks!
Environment:
The text was updated successfully, but these errors were encountered: