Thank you very much Marilee. The AAD configuration and permissions are in place. A user of the 425Show forum advised me that I needed to use the correct connection string.
According to https://learn.microsoft.com/en-us/sql/connect/ado-net/sql/azure-active-directory-authentication?view=sql-server-ver15#using-active-directory-managed-identity-authentication the service will get the token. I don't need to handle it in the application.
"Server=AZURESQLSERVER.database.windows.net,1433;Database=AZURE_DB;Authentication=Active Directory MSI;"