Although the dating of Bach's three sonatas for viola da gamba and cembalo has presented problems for musicologists, because only an autograph score of the first sonata BWV 1027 survives, there is now general consensus that the works were written in Leipzig at some time in the late 1730s and early 1740s. Prior to that commentators had suggested that they dated from an earlier period when Bach was in Cöthen or even beforehand: the viola da gamba player Christian Ferdinand Abel was one of the court musicians of Prince Leopold at Cöthen. Bach moved to Leipzig as Thomaskantor in 1723 and in 1729 was appointed director of the Collegium Musicum, a chamber music society that put on weekly concerts at the Café Zimmermann. Other versions of BWV 1027 exist: there is a trio sonata for two transverse flutes and continuo ; as well as a trio sonata for organ in three movements. Russell Stinson has determined that the organ work, with the first two movements transcribed from BWV 1039/i and BWV 1039/ii and the last from BWV 1027/iv, is not by Bach but most probably by Johann Peter Kellner. In the late 1980s four new editions of the sonatas appeared, including the Urtext edition of Laurence Dreyfus for C.F. Peters; in a long accompanying text Dreyfus presented detailed arguments for the works to be dated to Bach's period in Leipzig. In a subsequent study of Bach's chamber music, came to the same conclusion and gave provisional dates for many of Bach's chamber music and concertos in his Leipzig period. No precedence had been given to BWV 1027 or BWV 1039, beyond the fact that long notes are easier to sustain on a transverse flute than a harpsichord. The dating of BWV 1027–1028 is explained in detail by in his analysis of Bach's instrumental works. including his flute sonata in E major, the triple concerto in A minor for flute, violin and harpsichord and the trio sonata for flute, violin and continuo from the Musical Offering.
The last contrapuntal movement, although not labelled as a bourrée, makes reference to this dance form by commencing with a quaver figure on the fourth beat of the bar.
The first movement begins with the gamba introducing a thematic fragment repeated by the harpsichord. The following movement includes echos and from the first one, especially of the latter half of the first movement. The third movement is in the rhythm of a siciliano, followed by a fast movement in time. Parts of this sonata were used in Bach's St Matthew Passion.
The musicologist Philipp Spitta has described this sonata as being "of the greatest beauty and most striking originality." The sonata begins with a theme by the viola da gamba, which is soon joined by the harpsichord. This is driven forward with lively figuration. The middle movement, in B major, allows the parts to intertwine even more, ending with the allegro, which begins with repeated notes in the gamba part soon to be taken up by the lower harpsichord part.