Question: what key is dmaj7 in?
Answer: What key is this chord progression in: Dmaj7, Bdom7, Em7, A, Dmaj7. Everyone of these chords fits into the key of D except the B7, which is a secondary dominant to Em. You can use D major scale for the most part, with perhaps E melodic minor over the B7 and Em7 chords.