Yeah, it's in the key of D minor.
The chord progression includes an A dominant 7 which allows you to resolve to the key center. ( Dm )
Because of the Dominant chord, the scale that best fits is the Harmonic minor.
But in Music Theory there is no " Harmonic minor key "...instead you place a minor key signature and the raised seventh appears as an accidental.
The F major scale that you were using has a natural C note, whereas the D Harmonic minor has a C#.
Most of the notes of the scale you were playing fit, just make sure to play the C# over the A7 chord.
.