Have you considered Query packs? Depending on your use case these can be handy especially if you dont need to do it programmatically or at large scale (e.g. good to copy from one to another, but if you need to copy to 100's of workspaces you may choose the API route).
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/query-packs
Often overlooked in the UI: