Group C winners Germany closed their qualifying campaign with a 100 per cent record following a 5-1 win against Azerbaijan in Kaiserslautern.
Ramil Sheydayev cancelled out Leon Goretzka's early opener for Germany, but after the break goals from Sandro Wagner, Antonio Rudiger, Goretzka's second and Emre Can made it 10 wins from 10 for the reigning world champions.
Michal Krmencik's first-half double, Jan Kopic's effort before the break and further goals from Filip Novak and Vaclav Kadlec helped Czech Republic to a 5-0 home win against San Marino.
Poland booked their ticket for the finals as a 4-2 home win against Montenegro saw them finish top of Group E.
Montenegro gave them a scare, fighting back from two goals down to level at 2-2 in the 85th minute before Robert Lewandowski and Filip Stojkovic's own goal sealed a dramatic win for Poland.
The Poles had led 2-0 at half-time through Krzysztof Maczynski and Hull winger Kamil Grosicki, with goals from Montenegro pair Stefan Mugosa (79) and Zarko Tomasevic (85) ensuring a nervous finale.
Elsewhere in Group E, Denmark were held 1-1 by Romania in Copenhagen after Ciprian Deac's late header cancelled out Christian Eriksen's second-half penalty, but the point was enough to secure the Dane's play-off place.
Bauyrzhan Turysbek's second-half header earned Kazakhstan a 1-1 home draw against Armenia, who had taken a first-half lead through Manchester United midfielder Henrikh Mkhitaryan.
Meanwhile, Kazakhstan drew 1-1 with Armenia.