The behavior when using Sudo with Bash on Azure CLI as indicated in the screenshot provided by you is a known limitation by the design.
You can refer more details from the below reference
azure-cloud-shell-limitations
----------
--please don't forget to upvote
and Accept as answer
if the reply is helpful--