microsoft / Application-Insights-Workbooks

Templates for Azure Monitor Workbooks
MIT License
562 stars 462 forks source link

Workbooks cannot be linked to Application Insights #1246

Closed ChristopherL-STCU closed 3 years ago

ChristopherL-STCU commented 3 years ago

When I deploy a Workbook ARM template to a resource group then the Workbook appears in the Workbook gallery of the resource group. Here's a simple example:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "resources": [
        {
            "apiVersion": "2018-06-17-preview",
            "kind": "shared",
            "location": "westus2",
            "name": "18a15b48-f071-4728-b954-54be8e85755d",
            "properties": {
                "category": "workbook",
                "displayName": "LegacyWorkBook",
                "serializedData": "{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":{\"json\":\"Blank workbook\"},\"name\":\"text - 0\"}]}",
                "sourceId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-rg",
                "version": "1.0"
            },
            "type": "microsoft.insights/workbooks"
        }
    ]
}

But when I try to deploy to Application Insights (Exact same template as above with this one change.)

"sourceId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-rg/providers/microsoft.insights/components/my-appinsights",

Then the Workbook shows as linked to Application Insights but when trying to view the Workbook it says the resource cannot be found.

⚠ This item could not be restored. Could not find Workbook with id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/phoenix-monitor-rg/providers/microsoft.insights/workbooks/18a15b48-f071-4728-b954-54be8e85755d in subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. It may have been deleted or moved, or you may not have access to it.

And the Workbook does not show in Application Insight's Workbook gallery.

If I go back to the Workbook resource and save a new Workbook then that new version does display in Application Insight's gallery, but it seems to be detached from the Workbook resource it was originally created under because it does not appear under the Workbook resource.

(As an aside, if I create several new Workbooks under the Workbook resource and then delete one of them it then shows a gallery view containing all of the Workbooks under that Workbook resource. The URL to this gallery view is in the form of:

https://portal.azure.com/#@xxxxxxxxxxxxxxxx.onmicrosoft.com/resource/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-rg/providers/microsoft.insights/workbooks/18a15b48-f071-4728-b954-54be8e85755d/workbook

However, once I navigate away I can't get back to this gallery view. If I try going directly back to that URL in my browser I end up at the original Workbook which was created. This doesn't have to do with Application Insight Workbooks but is another possibly helpful observation.)

Also, when creating a Workbook in the portal within the Workbook gallery of a Resource Group it gives the option to "Save content to an Azure Storage Account." But Workbooks created within Application Insights Workbooks gallery do not have this option. Will Application Insight Workbooks eventually have this option?

gardnerjr commented 3 years ago

This limitation is called out in https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Documentation/Programmatically.md#limitations

We are actively working on removing this limitation and moving "Application Insights Workbooks" (resource type microsoft.insights/components/favorites) to be on top of the same save system as "Azure Workbooks" (resource type microsoft.insights/workbooks). Once this conversion has taken place, these limitations will no longer be in place.

gardnerjr commented 3 years ago

(and technically they can be linked, you just won't see them in the gallery in App Insights until that work is completed (in progress now). they would still show up in the full Azure Workbooks browse list though, and would work from there)

gardnerjr commented 3 years ago

FYI @ChristopherL-STCU the changes to allow microsoft.insights/workbooks to appear in Application Insights workbooks have now started rolling out to prod. Let me know if you're seeing any issues, the above errors should no longer occur.

I still need to update the docs here to get rid of this limitation note.

MichaCo commented 3 years ago

@gardnerjr My workbooks linked to an AI resource can only be found under the "Browse across all galleries" button and are not visible in the standard Gallery list. That doesn't feel right and makes it really hard to find workbooks (not just because of the fed up name of the resources under "across all galleries" which seems to be the container the workbook is actually in?)

Can I expect all workbooks show up at some point in the standard Gallery??

Now that I'm not able to save them anymore within the AI resource this bug makes the new stuff really hard to use ;)

Thanks, Michael

gardnerjr commented 3 years ago

@MichaCo you'd have to open a request with support. All workbooks should now be capital W Workbooks micrsosoft.insights/workbooks, and any that were left as private workbooks or legacy favorites will need to be manually migrated: https://aka.ms/workbookConversionTool

if you can see them in browse across galleries, opening the workbook as resource there should show you what resource it is specifically linked to in the essentials section at the top of the resource view.