you are correct to more to the graph api. as you are creating a background service, you want to use app-only authentication, as the background service will not have a request to get the users token from. you will probably use an ad application clientid & secret to request the access token.
when you define the application in azure ad you will will need to add api access. when defining graph api access, you will create a service account.
to limit its access you will need to define a application access policy:
https://learn.microsoft.com/en-us/graph/auth-limit-mailbox-access