{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-functions/json-schema/microsoft-azure-functions-recommendation-rule-schema.json",
  "title": "RecommendationRule",
  "description": "Represents a recommendation rule that the recommendation engine can perform.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-functions-recommendations-api-openapi.yml#/components/schemas/RecommendationRule",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/RecommendationRuleProperties",
      "description": "RecommendationRule resource specific properties",
      "x-ms-client-flatten": true
    },
    "kind": {
      "type": "string",
      "description": "Kind of resource."
    }
  },
  "allOf": [
    {
      "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource"
    }
  ],
  "$defs": {
    "Channels": {
      "type": "string",
      "description": "List of channels that this recommendation can apply.",
      "enum": [
        "Notification",
        "Api",
        "Email",
        "Webhook",
        "All"
      ],
      "x-ms-enum": {
        "name": "Channels",
        "modelAsString": false
      }
    },
    "NotificationLevel": {
      "type": "string",
      "description": "Level indicating how critical this recommendation can impact.",
      "enum": [
        "Critical",
        "Warning",
        "Information",
        "NonUrgentSuggestion"
      ],
      "x-ms-enum": {
        "name": "NotificationLevel",
        "modelAsString": false
      }
    },
    "RecommendationRuleProperties": {
      "type": "object",
      "description": "RecommendationRule resource specific properties",
      "properties": {
        "recommendationName": {
          "type": "string",
          "description": "Unique name of the rule."
        },
        "displayName": {
          "type": "string",
          "description": "UI friendly name of the rule."
        },
        "message": {
          "type": "string",
          "description": "Localized name of the rule (Good for UI)."
        },
        "recommendationId": {
          "type": "string",
          "format": "uuid",
          "description": "Recommendation ID of an associated recommendation object tied to the rule, if exists.\nIf such an object doesn't exist, it is set to null."
        },
        "description": {
          "type": "string",
          "description": "Localized detailed description of the rule."
        },
        "actionName": {
          "type": "string",
          "description": "Name of action that is recommended by this rule in string."
        },
        "level": {
          "$ref": "#/$defs/NotificationLevel",
          "description": "Level of impact indicating how critical this rule is."
        },
        "channels": {
          "$ref": "#/$defs/Channels",
          "description": "List of available channels that this rule applies."
        },
        "categoryTags": {
          "type": "array",
          "description": "The list of category tags that this recommendation rule belongs to.",
          "items": {
            "type": "string"
          },
          "readOnly": true
        },
        "isDynamic": {
          "type": "boolean",
          "description": "True if this is associated with a dynamically added rule"
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name of the portal if exists. Applicable to dynamic rule only."
        },
        "bladeName": {
          "type": "string",
          "description": "Deep link to a blade on the portal. Applicable to dynamic rule only."
        },
        "forwardLink": {
          "type": "string",
          "description": "Forward link to an external document associated with the rule. Applicable to dynamic rule only."
        }
      }
    }
  }
}