@Wille Christian (IOB/OPS2) Welcome to Microsoft Q & A Community Forum. I understand that you are trying to enable monitoring agent using az cli. I have tested the same on Ubuntu 20.04 os from my end using similar commands and I was able to provision without any issues. Here are the commands I have used.
az monitor data-collection rule create --resource-group "rg" --location "eastus" --name "myCollectionRule2" --data-flows destinations="workspace-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-eus2" streams="Microsoft-Perf" streams="Microsoft-Syslog" streams="Microsoft-WindowsEvent" --log-analytics name="workspace-f66926b3-210c-4b3d-b5f2-fc789f2308b1-eus2" resource-id="/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/rg/providers/microsoft.operationalinsights/workspaces/workspace-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-eus2" --performance-counters name="cloudTeamCoreCounters" counter-specifiers="\\Processor(_Total)\\% Processor Time" counter-specifiers="\\Memory\\Committed Bytes" counter-specifiers="\\LogicalDisk(_Total)\\Free Megabytes" counter-specifiers="\\PhysicalDisk(_Total)\\Avg. Disk Queue Length" sampling-frequency=15 transfer-period="PT1M" streams="Microsoft-Perf" --performance-counters name="appTeamExtraCounters" counter-specifiers="\\Process(_Total)\\Thread Count" sampling-frequency=30 transfer-period="PT5M" streams="Microsoft-Perf" --syslog name="cronSyslog" facility-names="cron" log-levels="Debug" log-levels="Critical" log-levels="Emergency" streams="Microsoft-Syslog" --syslog name="syslogBase" facility-names="syslog" log-levels="Alert" log-levels="Critical" log-levels="Emergency" streams="Microsoft-Syslog" --windows-event-logs name="cloudSecurityTeamEvents" transfer-period="PT1M" streams="Microsoft-WindowsEvent" x-path-queries="Security!" --windows-event-logs name="appTeam1AppEvents" transfer-period="PT5M" streams="Microsoft-WindowsEvent" x-path-queries="System!*[System[(Level = 1 or Level = 2 or Level = 3)]]" x-path-queries="Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]"
az monitor data-collection rule association create --name "DefaultMetrics" --rule-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/rg/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule2 --resource /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/rg/providers/Microsoft.Compute/virtualMachines/swnu
May I know what operating system you are using and also were you prompted with any error when executing commands?