Azure Pipelines is it possible to run bash command with sudo?

So I tried bash task and powershell task and everytime I need to run as elevated sudo user it will fail stating:

"sudo: no tty present and no askpass program specified"

lets say I want to run sudo apt-get update using powershell task.
Is there an option of doing these things? So far we were only using windows deployment group but we need to use ubuntu this time and I cannot find a solution to that.