pulumi / pulumi-azure-native

Azure Native Provider
Apache License 2.0
128 stars 34 forks source link

Unsupported Dahsboard types in azure-native/portal/Dashboard #747

Closed annaFaralliCR closed 1 month ago

annaFaralliCR commented 3 years ago

Description:

Currently, Pulumi only accepts Extension/HubsExtension/PartType/MarkdownPart value for lenses.part.metadata.type in module @pulumi/azure-native/portal/dashboard.

However, more values should be available, e.g. Extension/HubsExtension/PartType/MonitorChartPart.

An example of this could be:

const dashboard = new azure_dashboard.Dashboard('dashboard-hub', {
    dashboardName: 'dashboard-hub',
    resourceGroupName: resourceGroupDashboard.name,
    lenses: [
        {
            order: 0,
            parts: [
                {
                    position: {
                        x: 0,
                        y: 0,
                        rowSpan: 4,
                        colSpan: 6,
                    },
                    metadata: {
                        inputs: [
                            {
                                name: 'options',
                                isOptional: true,
                            },
                            {
                                name: 'sharedTimeRange',
                                isOptional: true,
                            },
                        ],
                        settings: {
                            content: {},
                        },
                        type: 'Extension/HubsExtension/PartType/MonitorChartPart',
                    },
                },
                {
                    position: {
                        x: 6,
                        y: 0,
                        rowSpan: 4,
                        colSpan: 6,
                    },
                    metadata: {
                        inputs: [{}, {}],
                        settings: {
                            content: {},
                        },
                        type: 'Extension/HubsExtension/PartType/MonitorChartPart',
                    },
                },
            ],
        },
    ],
    metadata: {
        model: {
            timeRange: {
                value: {
                    relative: {
                        duration: 24,
                        timeUnit: 1,
                    },
                },
                type: 'MsPortalFx.Composition.Configuration.ValueTypes.TimeRange',
            },
            filterLocale: {
                value: 'en-us',
            },
            filters: {
                value: {
                    MsPortalFx_TimeRange: {
                        model: {
                            format: 'utc',
                            granularity: 'auto',
                            relative: '24h',
                        },
                        displayCache: {
                            name: 'UTC Time',
                            value: 'Past 24 hours',
                        },
                        filteredPartIds: [
                            'StartboardPart-MonitorChartPart-6f3299ae-de1c-471f-a8e2-188920f0f1ff',
                            'StartboardPart-MonitorChartPart-6f3299ae-de1c-471f-a8e2-188920f0f20f',
                        ],
                    },
                },
            },
        },
    },
})

which returns the error: The type of dashboard part. Expected value is 'Extension/HubsExtension/PartType/MarkdownPart'.

mikhailshilkov commented 3 years ago

Hi @annaFaralliCR thank you for reporting this.

Unfortunately, the only DashboardPartMetadata I see in the Open API spec is MarkdownPartMetadata: https://github.com/Azure/azure-rest-api-specs/blob/85441dcd442a3c58f5bdf867b94d3bbb147e506b/specification/portal/resource-manager/Microsoft.Portal/preview/2020-09-01-preview/portal.json#L477

Unless I miss something here, would you be so kind to open a request in the Open API issues for this?

grosren commented 3 years ago

I stumbled across the same issue. I am migrating to azure-native provider, but these Azure dashboards are a blocker for us.

https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/azure-portal/azure-portal-dashboards-create-programmatically.md proves that there are way more tile types than markdown tiles. With the classic azure provider, I created GO structs --> marshalled them into a json string and done... Now we have to use Pulumi Go types which is a nightmare for such complex resources. https://www.pulumi.com/arm2pulumi/ is also failing because it cant understand the models, Azure uses.

pulumi-bot commented 1 month ago

This issue has been addressed in PR #3566 and shipped in release v2.62.0.