Of Navarrese origin, Viana started his military career in 1735 and fought in Italy during the War of the Austrian Succession (1740–1748), reaching the rank of colonel.
On his return from that campaign, he was named first governor of Montevideo by King Ferdinand VI of Spain, in 1750, taking office in that city on March 14, 1751.
Viana's appointment took place in the course of certain political circumstances in the Río de la Plata by the Treaty of Madrid in 1750, by which the government of Fernando VI ceded to Portugal the Jesuit missions of upper Uruguay, in exchange for the delivery of Colonia del Sacramento.
This fact is part of the second pacifist policy of the Spanish Bourbons, who tried to approach Portugal diplomatically to end the border disputes at various points in the Americas, especially in the Río de la Plata.
Upon returning, Viana founded the city of Salto, Uruguay in November 1756[1] and San Fernando de Maldonado, in 1757, which was so named in honor of King Ferdinand VI.