{
    "properties": {
        "displayName": "Shared dashboards should not have markdown tiles with inline content",
        "policyType": "BuiltIn",
        "mode": "Indexed",
        "description": "Disallow creating a shared dashboard that has inline content in markdown tiles and enforce that the content should be stored as a markdown file that's hosted online. If you use inline content in the markdown tile, you cannot manage encryption of the content. By configuring your own storage, you can encrypt, double encrypt and even bring your own keys. Enabling this policy restricts users to use 2020-09-01-preview or above version of shared dashboards REST API.",
        "metadata": {
            "version": "1.0.0",
            "category": "Portal"
        },
        "parameters": {
            "effect": {
                "type": "string",
                "defaultValue": "Audit",
                "allowedValues": [
                    "Audit",
                    "Deny",
                    "Disabled"
                ],
                "metadata": {
                    "displayName": "Effect",
                    "description": "The effect determines what happens when the policy rule is evaluated to match"
                }
            }
        },
        "policyRule": {
            "if": {
                "allOf": [
                    {
                        "field": "type",
                        "equals": "Microsoft.Portal/dashboards"
                    },
                    {
                        "anyof": [
                            {
                                "not": {
                                    "value": "[requestContext().apiVersion]",
                                    "greaterOrEquals": "2020-09-01-alpha"
                                }
                            },
                            {
                                "count": {
                                    "field": "Microsoft.Portal/dashboards/lenses[*].parts[*]",
                                    "where": {
                                        "allOf": [
                                            {
                                                "field": "Microsoft.Portal/dashboards/lenses[*].parts[*].metadata.type",
                                                "equals": "Extension/HubsExtension/PartType/MarkdownPart"
                                            },
                                            {
                                                "anyOf": [
                                                    {
                                                        "field": "Microsoft.Portal/dashboards/lenses[*].parts[*].metadata.Extension-HubsExtension-PartType-MarkdownPart.settings.content.settings.markdownUri",
                                                        "exists": "false"
                                                    },
                                                    {
                                                        "field": "Microsoft.Portal/dashboards/lenses[*].parts[*].metadata.Extension-HubsExtension-PartType-MarkdownPart.settings.content.settings.markdownSource",
                                                        "exists": "false"
                                                    },
                                                    {
                                                        "field": "Microsoft.Portal/dashboards/lenses[*].parts[*].metadata.Extension-HubsExtension-PartType-MarkdownPart.settings.content.settings.markdownSource",
                                                        "equals": "1"
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                },
                                "greater": 0
                            }
                        ]
                    }
                ]
            },
            "then": {
                "effect": "[parameters('effect')]"
            }
        }
    },
    "id": "/providers/Microsoft.Authorization/policyDefinitions/04c655fe-0ac7-48ae-9a32-3a2e208c7624",
    "name": "04c655fe-0ac7-48ae-9a32-3a2e208c7624"
}