@Daniel Chicchon Thanks for reaching out. From the error message it says that the access token has been obtained for wrong audience could you please replace the scope value as below
scope=https://management.core.windows.net/.default and try generating the token again.
Hope this helps!
To benefit the community find the right answers, please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’.