You will need to have a Tax Number (in portuguese Número de Contribuinte) as it is demanded by immigration services to get your resident permit.
To get your Tax Number you will need your passport and a legal representative who must be a local resident. If you don't have anyone that can be your legal representative, M-ITI can arrange one for you. Please pass by the staff office, room #1 at M-ITI.
To obtain the tax number you will need to go to Loja do Cidadão in the city center, along with your legal representative. Both have to present identification card.