How hard is it to replace the battery on a B8 A4?

I googled it and some people say you have to code the battery?
My battery died and Audi wants 350$ to install a new one. Where I could buy it from parts for 135$. Makes no sense to pay 215$ for someone to just put a battery in :crazy: