Work permit: Which City to get - city of the workplace or residence?

I just have a question regarding where to request for work permit - Should it be on City where my workplace/Employer is located or City where I currently live or whether it doesn't matter?

Lets take for instance, I work in a Company in Stuttgart however, I am living in Leinfelden-Ectherdingen. Should I apply for work permit in Ausländerbehörde in Stuttgart or in Echtherdingen?

I hope that you can enlighten me on this matter.

As far as I know, it is always the Ausländeramt of your residence which is in charge of you. But you better confirm this with the Amt!