Skip to content
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

arm-ttk does not seem to recognize an outputs reference to a DropDown living inside an EditableGrid's column #768

Open
raouche opened this issue Mar 1, 2024 · 2 comments

Comments

@raouche
Copy link
Contributor

raouche commented Mar 1, 2024

arm-ttk version: 0.24
Scenario: A DropDown control inside a column in an EditableGrid control is referenced in an "outputs" parameter using the following expression (see the full CUID sample at the very bottom) that references it via a reference to the containing column's column id:
[concat('Value: ', first(basics('EditableGrid1')).Column1)]

Problem: When running arm-ttk against the example shown below, the following error is returned:

arm-ttk: Failed: Allowed Values Should Actually Be Allowed
Error: Could not find DropDown1 in outputs

NOTE: The same issue is also noticed when placing an OptionsGroup control inside an EditableGrid's column. But a TextBox seems to fare well though.

What are we missing here?

Full sample CUID:

{
  "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
  "handler": "Microsoft.Azure.CreateUIDef",
  "version": "0.1.2-preview",
  "parameters": {
    "basics": [
      {
        "ariaLabel": "EditableGrid1",
        "constraints": {
          "columns": [
            {
              "element": {
                "constraints": {
                  "allowedValues": [
                    {
                      "label": "Item1",
                      "value": "Value1"
                    },
                    {
                      "label": "Item2",
                      "value": "Value2"
                    }
                  ]
                },
                "label": "DropDown1",
                "name": "DropDown1",
                "toolTip": "DropDown1",
                "type": "Microsoft.Common.DropDown"
              },
              "header": "Column1",
              "id": "Column1",
              "width": "1fr"
            }
          ]
        },
        "label": "EditableGrid1",
        "name": "EditableGrid1",
        "type": "Microsoft.Common.EditableGrid"
      }
    ],
    "steps": [],
    "outputs": {
      "location": "[location()]",
      "EditableGrid1": "[concat('Value: ', first(basics('EditableGrid1')).Column1)]"
    }
  },
  "metadata": {
    "_generator": {
      "name": "MaestroStudio",
      "sku": "Solo",
      "version": "0.9.0.0",
      "template": {
        "author": "StratusOn",
        "id": "EA622966-CE0C-46E7-841B-73C2E6ED5DEB",
        "description": "A blank Azure Marketplace Managed Application offer."
      }
    },
    "_sync": {
      "offer": {
        "displayName": "My Offer"
      },
      "plan": {
        "displayName": "Plan"
      }
    }
  }
}
@vidapour
Copy link

vidapour commented Mar 18, 2024

Hi @raouche can you provide the parameters section that you've added in your main template? Thanks :)

@raouche
Copy link
Contributor Author

raouche commented Mar 18, 2024

Hi @vidapour -- For sure, you bet! And thanks for looking into this.

Here's an ARM template sample (not just the params). It's a no-op ARM Template sample that passes the arm-ttk without deploying anything (but the issue was discovered in a real-life, large template).

One thing I should have mentioned before was that if the same DropDown was placed outside of the EditableGrid (for example inside basics) and referenced in the outputs, it passes arm-ttk's checks with flying colors, so this is not likely related to not having allowedValues on the ARM template param.

Anyway, here you go -- hope this helps:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "MaestroStudio",
      "sku": "Solo",
      "version": "0.9.0.0",
      "template": {
        "author": "StratusOn",
        "id": "EA622966-CE0C-46E7-841B-73C2E6ED5DEB",
        "description": "A blank Azure Marketplace Managed Application offer."
      }
    }
  },
  "parameters": {
    "location": {
      "type": "string"
    },
    "EditableGrid1": {
      "type": "string",
      "metadata": {
        "description": "TODO: EditableGrid1 description."
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.Resources/deployments",
      "apiVersion": "2023-07-01",
      "name": "Noop",
      "properties": {
        "mode": "Incremental",
        "parameters": {
          "location": {
            "value": "[parameters('location')]"
          },
          "editableGrid1": {
            "value": "[parameters('EditableGrid1')]"
          }
        },
        "template": {
          "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "resources": [
          ]
        }
      }
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants