Vienna has around 68km² of roof surface.
But there are two nice facts that make the whole calculation easier:
- Resources used in a city don't need to be produced inside the city. Imagine we had to grow all the crops and lifestock consumed in a city also inside of the city borders. Or gas, oil, coal, water or any other resource. Cities can only exist by importing resources from the outside. And luckily power cables are a thing, so it's quite easy to import electricity from outside of the city.
- Solar isn't the only kind of renewable energy. The area north east of Vienna is dotted with wind turbines. There's a huge amount of hydropower all over Austria. In fact, 87.5% of the electricity generated in Austria is generated by renewable energy, and the remaining 12.5% are pretty much only to cover the times when renewables don't output enough power.
So the whole point is kinda moot. If we would put solar on all rooftops in Vienna, it would be enough to cover for the entire remaining fossil-based electricity generation in Austria if we had the means to store that excess energy.

