
Thanks for posting your question in the Microsoft Q&A forum.
You can achieve this by using the OAuth 2.0 client credentials flow in Azure AD. This flow allows your application (acting as a confidential client) to obtain an access token directly using its own credentials (client ID and client secret), without involving a user.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **