azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

Deployment of Dashboard fails via Azure Portal Cloud Shell for exported json template

Open jsntcy opened this issue 9 months ago • 7 comments

Describe the bug

There will be error when running the command az portal dashboard create --input-path .\dashboard-props.json --name testDashboard --resource-group lazinnat-test-so in both PowerShell window and Cloud Shell.

Related command

dashboard-props.json

Errors

azPortalDashboardDebugOut.txt

Issue script & Debug output

az portal dashboard create --input-path .\dashboard-props.json --name testDashboard --resource-group lazinnat-test-so

dashboard-props.json

Expected behavior

No error

Environment Summary

NO

Additional context

No response

jsntcy avatar Mar 17 '25 05:03 jsntcy

Thank you for opening this issue, we will look into it.

yonzhan avatar Mar 17 '25 05:03 yonzhan

Could you share the version of the extension? az --version

cxznmhdcxz avatar Mar 17 '25 12:03 cxznmhdcxz

azure-cli: 2.70.0

lazinnat avatar Mar 17 '25 16:03 lazinnat

What's the version of the portal extension? Could you share a full ouput like this Image

cxznmhdcxz avatar Mar 18 '25 01:03 cxznmhdcxz

Image

lazinnat avatar Mar 18 '25 02:03 lazinnat

Seems it's the wrong format. Please check this sample json of portal 0.1.3 extension. https://github.com/Azure/azure-cli-extensions/blob/eb35ad2b013747567bb6b6d2b51ff613690412ac/src/portal/azext_portal/tests/latest/properties.json

It has a format like

{
  "lenses": {
    "0": {
      "order": "0",
      ...
    } 
  }
}

instead of the json you shared

{
  "lenses": [
    {
      "order": "0",
      ...
    }
  ]
}

cxznmhdcxz avatar Mar 21 '25 09:03 cxznmhdcxz

Dashboard is using a new api version that has the changes in schema. I think you could try the latest version of portal extension.

cxznmhdcxz avatar Mar 21 '25 10:03 cxznmhdcxz