Hi Everyone,
I've been tasked to add an additional Azure VM extension (agent) to our Pulumi Iac build. I'm having issues passing variables to the extension once its deployed. I'm deploying the "team service agent" on to a windows 2019 server in Azure. The extension deploys ok, but has soon as I try and pass any variables to the agent it logs an error.
Error in Agent Logs
The Extension failed to execute: Cannot convert value "VSTSAccountName" to type "System.Int32". Error: "Input string was not in a correct format.".
c#
// Install the Azure Pipelines Agent as a VM extension
var extension = new Pulumi.AzureNative.Compute.VirtualMachineExtension("VMExtension",
new Pulumi.AzureNative.Compute.VirtualMachineExtensionArgs
{
ResourceGroupName = resourceGroup.Name,
VmName = virtualMachine.Name,
AutoUpgradeMinorVersion = true,
EnableAutomaticUpgrade = false,
InstanceView = { },
Location = location,
ProtectedSettings= @"
{
'PATTOKEN': 'mypattokengoeshere',
}",
ProtectedSettingsFromKeyVault = { },
Publisher = "Microsoft.VisualStudio.Services",
Settings = @"
{
'VSTSAccountName': '
https://dev.azure.com/projectname',
'TeamProject': 'Project',
'DeploymentGroup': 'Pulumi-Deploy',
'AgentName': 'vm1',
'Tags': 'Customer1'
}",
SuppressFailures = true,
Type = "TeamServicesAgent",
TypeHandlerVersion = "1.2",
VmExtensionName = "azure-pipelines-agent",
});
```