question

LanceShelton-7813 avatar image
3 Votes"
LanceShelton-7813 asked bharathn-msft commented

createUIDefinition.json: Error: Unknown function 'if'

Testing createUIDefinition.json with https://github.com/Azure/azure-quickstart-templates/blob/master/sideload-createuidef.sh

The 'if' function described in the docs does not appear to work:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/create-ui-definition-logical-functions#if

Specifically I am trying to return one of two strings in an output, starting with the example in the doc:

    "outputs": {
         "myoutput": "[if(equals(42, mul(6, 7)), 'yes', 'no')]"
     }

The error reported by the console:
[Microsoft_Azure_Compute] 3:58:11 PM MsPortalFx.Base.Diagnostics.ErrorReporter 3 MsPortalFx.Base.Diagnostics.ErrorReporter: message: Unknown function 'if'
Details: {"type":4,"function":"if","params":[{"type":2,"value":true},{"type":1,"value":"yes"},{"type":1,"value":"no"}],"path":[]}
stack: Error: Unknown function 'if'
Details: {"type":4,"function":"if","params":[{"type":2,"value":true},{"type":1,"value":"yes"},{"type":1,"value":"no"}],"path":[]}
at t.n.evaluate (https://afd.hosting.portal.azure.net/compute/Content/Dynamic/T4szTja92chj.js:12:768)
at t.n.evaluateToResult (https://afd.hosting.portal.azure.net/compute/Content/Dynamic/T4szTja92chj.js:12:1173)
at t.evaluateToResult (https://afd.hosting.portal.azure.net/compute/Content/Dynamic/T4szTja92chj.js:13:4188)
at https://afd.hosting.portal.azure.net/compute/Content/Dynamic/whMGwlab_Aoz.js:29:14428
at Array.forEach (<anonymous>)
at t._resolveTemplateParams (https://afd.hosting.portal.azure.net/compute/Content/Dynamic/whMGwlab_Aoz.js:29:14376)
at Object.supplyInitialData (https://afd.hosting.portal.azure.net/compute/Content/Dynamic/whMGwlab_Aoz.js:29:7723)
at Object.supplyParams (https://portal.azure.com/Content/Dynamic/1rEwFp4kIIC3.js:163:677)
at o (https://portal.azure.com/Content/Dynamic/1rEwFp4kIIC3.js:204:622)
at n.l as callback
From RPC: fx -> Microsoft_Azure_Compute
(Callstack capturing is not enabled. Use ?trace=diagnostics to enable it.)

azure-managed-applications
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@LanceShelton-7813 - Our sincere apologies for delay in getting to this thread. We are further evaluating the issue called out with our internal team, will get back to you at the earliest.

0 Votes 0 ·

@LanceShelton-7813- Similar issue has been handled on this GitHub thread. So requesting you to please review that thread and let us know if you have any further queries. Thank you


0 Votes 0 ·

0 Answers