After Slovenian Marko Klump won the first stage from Baku to Sumqayit, the Adria Mobil rider Roglic captured victory in the second stage from Baku to Ismayilli, building a 34-second cushion on Ockeloen, compatriot Matej Mugerli and Chris Horner of the United States.
Great Britain's Joshua Edmondson won the from-and-to Qabala third stage and Czech rider Daniel Turek picked up the victory in stage four from Qabala to Mingachevir.
But Roglic was able to maintain his lead throughout the final three stages to take the overall title with Mugerli finishing third behind Ockeloen.
Kump won the sprint title while Alexander Surutkovych of Kazakhstan picked up the final mountain jersey. The 22-year-old Frantisek Sisr of the Czech Republic was named the best young rider while Maksym Averin was the best Azeri rider.
The last stage of the Tour d'Azerbaijan course will be used for the Road Race at the Baku 2015 European Games.