New-OctopusAzureWebAppTarget -OctopusRoles Bug?

I’m trying to create an Octopus Azure WebApp target with multiple roles via the Powershell library.

I’ve created using

New-OctopusAzureWebAppTarget -Name $myAppName -AzureWebApp $myAppName -AzureResourceGroupName $resourceGroup -OctopusAccountIdOrName $azureAccount -OctopusRoles $roles -updateIfExisting;

If tried with $roles = @(“role1”, “role2”) and with $roles = “role1”, “role2”

In both cases, it creates the target with a single tag “role1 role2” which isn’t what I would expect this to do.

Is my expectation off or is this a bug?

Cheers,

Ben

I’ve not used that cmdlet before, but the documentation seems to say the OctopusRoles parameter is a comma-separated list…

You could try:

$roles = “role1, role2”

Hope this helps,

Mike

Hi Ben,

Thanks for getting in touch! Were you able to get this working with @mike’s suggestion? ($roles = “role1, role2”)

Let me know if you are still having trouble with this or if you have any further questions.

Best regards,
Daniel

It turns out you can’t have a space after the , either. Not exactly intuitive, but it works.

Cheers,

Ben

1 Like

I guess the documentation really means it when it says “comma separated” as opposed to “command and space separated” :slight_smile:

Glad you got it working.

M

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.