Flickering headlights are a common problem on Audi's equipped with xenon. There are several causes but the most frequent ones are a faulty ballast, a dying xenon bulb or bad/loose wiring/connections.
If youre Handy, it might be worth checking some things out yourself before heading to the dealer. First off, check the connection on the bulb inside the headlight. If that doesn't help, try switching the xenon bulbs from one side to another (if now the other side turns all black on you, its probably the bulb itself) . Then, try and find someone with the same type of xenon bulb and replace them. If youre still in the dark, at least you now know the bulbs itself dont need replacing. In that case the best guess is a dying ballast
I had the same problem on mine and was able to fix the problem by changing the dying bulb with another one. When doing so, it is recommended to changed both because xenon bulbs change color over time. If you need new bulbs, do not buy them at Audi, they will charge you an arm and a leg. Instead, get them off eBay (I got mine from this
seller).
I realize that in your cause the problem happened on both sides, however, it might be worth trying the switch. If it works, you will end up saving a lot of money by not having to go to the Audi dealer.
PS. ALWAYS disconnect the battery when working on xenon lights!