question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect validation errors in user-defined functions when using recently added builtin functions (createObject etc.)

See original GitHub issue

It seems that the validation logic for user-defined functions does not recognize the four new builtin functions that have recently been added (https://github.com/MicrosoftDocs/azure-docs/commit/be56ab92a33c673e858fc812339ea0610dafcfc1, https://github.com/microsoft/vscode-azurearmtools/issues/1043#issuecomment-710433636).

This template

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {},
    "functions": [
        {
            "namespace": "test",
            "members": {
                "testNewFunctions": {
                    "parameters": [],
                    "output": {
                        "value": "[
                            createArray(
                                true(),
                                false(),
                                null(),
                                createObject('name', 'foo')
                            )]",
                        "type": "array"
                    }
                }
            }
        }
    ],
    "resources": [],
    "outputs": {
        "result": {
            "type": "array",
            "value": "[test.testNewFunctions()]"
        }
    }
}

triggers this warning in VSCode: Template validation failed: The template function 'testNewFunctions' at line '11' and column '31' is not valid. These function calls are not supported in a function definition: 'true,false,null,createObject'. Please see https://aka.ms/arm-template/#functions for usage details.

but the deployment actually succeeds:

> New-AzResourceGroupDeployment -Name 'test' -ResourceGroupName 'test-rg' -TemplateFile .\test.json

DeploymentName          : test
ResourceGroupName       : test-rg
ProvisioningState       : Succeeded
Timestamp               : 2021-02-01 13:31:24
Mode                    : Incremental
TemplateLink            :
Parameters              :
Outputs                 :
                          Name             Type                       Value
                          ===============  =========================  ==========
                          result           Array                      [
                            true,
                            false,
                            null,
                            {
                              "name": "foo"
                            }
                          ]

DeploymentDebugLogLevel :

msazurermtools.azurerm-vscode-tools extension version: 0.14.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jberezanski-mdgcommented, Mar 24, 2021

Thank you, it seems to be working fine.

0reactions
StephenWeatherfordcommented, Mar 11, 2021

@jberezanski-mdg This was released on Monday. Let us know if you’re still having problems, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vscode-azurearmtools/CHANGELOG.md at main - GitHub
... Incorrect validation errors in user-defined functions when using recently added builtin functions (createObject etc.) ...
Read more >
How to Fix Compile Error: Sub or Function Not Defined
From VB Editor Tools menu, choose References. The References dialog box opens. If VBA has identified a missing library, the last library with...
Read more >
User Defined function error? - Microsoft Community
Hello, We are getting the following message when opening on of our spread sheets. "The following user-defined functions, created in an older ...
Read more >
Manually adding & removing validation errors to jQuery validator
I have jQuery validation already set up, and default validations (regex, required etc) are automatically mapped using jquery.unobtrusive plugin.
Read more >
PeopleCode built-in functions and language constructs
Validation. Error. IsMenuItemAuthorized. RevalidatePassword. SetCursorPos ... Use the AddEmailAddress function to add an email address for the current user.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found