MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.28k stars 21.46k forks source link

Using Copy loop in variables doesn't trigger logic statements in other variables #9501

Closed kyle-thomas-TT closed 6 years ago

kyle-thomas-TT commented 6 years ago

The following code:


"suffixName": "[if(empty(parameters('Suffix')), '', concat('-', parameters('Suffix')))]", "notificationHubNames": { "copy": [ { "name": "names", "count": "[length(variables('applicationTypes'))]", "input": { "name": "[concat(variables('applicationName'), variables('suffixName'), '-', variables('applicationTypes')[copyIndex('names')],'-notifyhub')]" } } ] }


results in the error: 3:57:25 PM - Resource Microsoft.NotificationHubs/namespaces/notificationHubs 'mobility-ktlocal-notifynamespace/mobility[if(empty(parameters('Suffix')), '', concat('-', parameters('Suffix')))]-crewForce-notifyhub' failed with message '{ "error": { "message": "Bad Request", "code": "BadRequest" }


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

femsulu commented 6 years ago

@kyle-thomas-TT Thanks for bringing this to our attention. Your issue has been shared with the content owner for further review.

tfitzmac commented 6 years ago

@kyle-thomas-TT - thanks for this question. You have a couple of options. You can use property iteration in the resource to correctly resolve the if statement. Or, you can move the if statement directly into the place where the suffixName variable is used.

I am trying to verify exactly which functions won't work in this situation of using copy in a variable.

tfitzmac commented 6 years ago

@kyle-thomas-TT - the product team is researching why this is happening. I'll let you know if there is an update on this issue.

tfitzmac commented 6 years ago

@kyle-thomas-TT - I have confirmed that this issue has been resolved. Thanks for your feedback.

tfitzmac commented 6 years ago

please-close