Change an employer under the Tech Visa permit

Hi, guys!
I am thinking whether to apply for a job in Portugal or not.
Is it possible to change the employer under the two-years residence permit as a Tech Visa holder?
Or probably there is a way to change residence permit to self-employment?
I am concerned what if we do not agree with the employer on some issues and things come to dismissal, will the family have to leave the country? Or this residence permit will qualified for two years regardless the employer?