In SSMS, you need to beware that if you save to file, there is a max number of character per column defined in Results to Text:
I found that when I saved to file, there was a line break inserted after each 256 characters, and it went downhill from there.
Instead the correct action is to copy and paste to your text file.
In Azure Data Studio, Save as JSON looks like a good idea, but that is a general feature to save any result set as JSON. But click on the JSON document for it to open in a new window. Here you can save to a file. Or copy-paste into a window.
Neither of the methods are particularly good for automation, but if you only do it only occasionally, it may be good enough.