The sortie button is to coordinate a sortie from the inside with the arrival of a friendly army to the region and attack together the besieger.
If there is no relief army to coordinate with, just drag your army outside of the structure and they will attack the besiegers on the next turn.
The problem is that then you will be the attacker and the besieger will be defending with entrechments and all...

Personally, i hardly ever keep a medium/big army inside a structure because of the danger of being besieged. I only put small garrisons inside, small forces that i'm prepared to lose just to delay or deny supply to the enemy.
You can make some exceptions with extremely important locations and special situations, but as a rule of thumb, usually it's better to keep the army than the city
