Hi @John Nickell
In a confidential client app, you are requesting a token with an audience of Graph API instead of Dynamics CRM Web API, which will throw a 401 Unauthorized error. Try changing the "scope" to "https://<ourdomain>.crm.dynamics.com/.default".
However, I noticed that Azure AD does not provide any application permissions for the Dynamics CRM Web API, so it might not support daemons yet. I suggest you retry after changing the "scope" to check the result.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.