-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array as output from template result as empty string. #20
Comments
Hi @keesschollaart81 thanks for the reply. I can't use the suggestion you made. We need the entire array itself since we do not know the size beforehand. |
Hi, yes that should be possible. Basically it threads the array the same a complex type/object. It flattens it, for array's without keys an indexer will be used. more here. I suggest that you try it with the v5 with the 'System.Debug' variable set to true and lets use the output of the log in this discussion! |
Since we needed a quick fix we added a single url as output called 'defaultUrl' : We have 2 webapps one is A and other one is B. A outputs a array of hostnames we use as input for CORS settings in B. Now we see in the deployments from A that the output from the template is correct. Output in resource group deployments: WebUrl is an array of hostnames and defaultUrl is for now the first hostname. Debug ARM output: I see an empty value for the array and the string value "defaultUrl" gets filled in and works. I use a prefix name "webapp" since i have multiple tasks. Hope this helps. Thanks in advance |
You're on the old v4.0.x version of the task. Please update and share the log! :-) (you can check/select the version you're using at the top of the task-form) |
Log from version 5: i do see webappwebUrl_0 but i can't just get the entire array by using "webappwebUrl". Is this by design? in version 4 i did not saw webappwebUrl_0 either. I get this error in the template : There was an error while overriding 'corsSettings' parameter because of 'SyntaxError: Unexpected token $ in JSON at position 0', make sure it follows JavaScript Object Notation (JSON). Since it propably can't find a variable named "webappwebUrl". If getting the entire array is not a feature than we know that and we will just use "defaultUrl". |
When creating an Azure resource in this case a webapp it looks like a string array is not being set as a variable in the pipeline.
Example:
When i debug the ARM Output task for the frontend i see that the array output is set as empty string, Is the array type supported? If so how do i use it? Good to mention that there is also no option to access the array by index.
Task:
Outputs from the template:
Where "webUrl" is the one that causes issues and "defaultUrl" is our temporary fix. Only we will surely get multiple host names and want to use the array.
Hopefully you can help me,
Greetings Michael
The text was updated successfully, but these errors were encountered: