pass json array object to azure arm

sthomas's Avatar

sthomas

17 May, 2017 07:22 AM

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"
}]

  1. Support Staff 1 Posted by Henrik Andersso... on 17 May, 2017 11:55 PM

    Henrik Andersson's Avatar

    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

  2. 2 Posted by sthomas on 18 May, 2017 11:50 AM

    sthomas's Avatar

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

  3. Support Staff 3 Posted by Henrik Andersso... on 19 May, 2017 12:33 AM

    Henrik Andersson's Avatar

    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

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • NotWorking.PNG 30.2 KB
  • Working.PNG 41.6 KB
  • NotWorking_with_variable.PNG 34.9 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac