Pass json array object to azure arm

Hi,

I am trying to send below variable to azure arm. the parameter type is array. This is working when directly entering the parameter value, but not working when selecting file inside a package/octopus variable. Could you please help me on identifying the issue. I have attached screenshot of working and not working scenario.

                   [{
			"TestName": "Authentication",
			"Name": "AuthenticationPingTest",
			"Description": "Authentication Ping Test",
			"Guid": "5b1be5ad-f96e-45f5-b105-58c2c5f87110"
		},
		{
			"TestName": "Authentication1",
			"Name": "Authentication1PingTest",
			"Description": "Authentication Ping Test",
			"Guid": "036336b8-a076-42ea-8292-a87691301946"
		}]

Hi,

Thanks for getting in touch!

This is a known issue with array values and Octopus variables.

There is a workaround in this support ticket that you can try out.

I hope that helps!

Thank you and best regards,
Henrik

Hi,
I have tried the workaround still not working. please see the screenshot.

variables.PNG

template.PNG

Hi,

So it looks like you’re still using a variable to bind your array object to a parameter in your ARM template, which isn’t supported at this point in time.

You need to put the actual value of your locations variable in the parameter field unfortunately, you can still have the variable location1 within it though and it will be replaced as expected.

So you’d enter the below into your parameter field:

[
    {
        "id": "#{location1}"
    }
]

and if you want to have two locations:

[
    {
        "id": "#{location1}"
    }, 
    {
        "id":"#{location2}"
    }
]

I hope that helps.

Thank you and best regards,
Henrik