Cagnola was born in Milan. He was sent at the age of fourteen to the Clementine College at Rome, and afterwards studied at the University of Pavia. He was intended for the legal profession, but his passion for architecture was too strong, and after holding some government posts at Milan, he entered as a competitor for the construction of the Porta Orientale. His designs were commended, but were not selected on account of the expense their adoption would have involved.
From that time Cagnola devoted himself entirely to architecture. After the death of his father he spent two years in Verona and Venice, studying the architectural structures of these cities. In 1806 he was called upon to erect a triumphal arch for the marriage of Eugene Beauharnais with the princess of Bavaria. The arch was of wood, but was of such beauty that it was resolved to carry it out in marble. The result was the magnificent Arco della Pace (Arch of Peace) at Porta Sempione in Milan, surpassed in dimensions only by the Arc de Triomphe in Paris. Among other works executed by Cagnola are the Porta Ticinese and the chapel of Santa Marcellina in Milan, and the church tower in Urgnano.
He died in Inverigo in 1833, five years before the Arco della Pace was completed. Outside of the town of Inverigo, he built a villa for himself, named Villa La Rotonda, completed by one of his pupils.