The resource type Microsoft.Fabric/capacities not yet support for diagnostic settings so far. I have tried to run the Azure CLI command as below:
# Define variables
RESOURCE_GROUP_NAME="<YourResourceGroupName>"
RESOURCE_NAME="<YourResourceName>" # e.g., your Fabric capacity name or Data Factory name
RESOURCE_PROVIDER="<ResourceProviderNamespace>" # e.g., Microsoft.Fabric/capacities or Microsoft.DataFactory/factories
SUBSCRIPTION_ID="<YourSubscriptionID>"
WORKSPACE_NAME="<YourLogAnalyticsWorkspaceName>"
DIAG_SETTING_NAME="CapacityMetricsToLA"
# Construct full Azure resource IDs
RESOURCE_ID="/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP_NAME/providers/$RESOURCE_PROVIDER/$RESOURCE_NAME"
WORKSPACE_ID=$(az monitor log-analytics workspace show --resource-group <YourWorkspaceRG> --workspace-name $WORKSPACE_NAME --query id --output tsv)
# Create the diagnostic setting to send AllMetrics to the Log Analytics workspace
az monitor diagnostic-settings create \
--name $DIAG_SETTING_NAME \
--resource $RESOURCE_ID \
--workspace $WORKSPACE_ID \
--metrics "[{category:AllMetrics,enabled:true,retention-policy:{enabled:false,days:0}}]"
then got an exception: (ResourceTypeNotSupported) The resource type 'microsoft.fabric/capacities' does not support diagnostic settings.
I have to change the solution to extract data from semantic model of Microsoft Fabric Capacity Metrics App via PowerBI REST API to ingest data into Azure Log Analytics Workspace.