hi there Ahmed Faizan,
thanks for throwing this question out here, really appreciate it )) ok this unable to get extension index error is super annoying, especially when ur net is working fine otherwise, right? classic case of 'why just why' :)) and yes this does look like a regional thing since it works when u vpn out. Microsoft's extension feed might be getting blocked or throttled in pakistan for some reason. not cool.... I know... BUT u can try use a different endpoint sometimes the default azure cli endpoints act up. force it to use
az cloud set --name azurecloud
az extension add --name containerapp --upgrade
if that doesn't work, swap azurecloud with azurechinacloud just to test (tho u might need a china account for that). manual install if the cli can't fetch it, grab the extension manually. go azure cli extensions repo, find the containerapp extension, and install it from source. yeah it's a hassle, but it works when the net fights u ), proxy or mirror, since vpn works, maybe set up a tiny proxy just for azure cli traffic. or check if ur org can mirror the extensions feed locally. microsoft docs actually suggest this for locked-down envs azure cli proxy settings. the cache sometimes the cli's local cache goes rogue. try like this
az cache purge
rm -rf ~/.azure/
then try again. this logs u out, so u'll need to az login after.
if none of that helps, yeah it's probably a hard block in ur region. u could bug ur isp about it or just keep using the vpn workaround for now.
microsoft's docs on extensions here might give more clues too manage azure cli extensions.
hope something here unbreaks it for u! let me know what works )
Best regards,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer
PPS That is my Answer and not a Comment