Hi SharathchandraGajjela,
This is likely because your org is expecting 2FA for authentication.
(jump to the end for another alternative)
Have you tried testing your connection manually?
From a powershell window, type: Connect-AzAccount
You'll very likey to be prompted to authenticate for 2FA.
This is probably the issue.
You can also test this by mapping your credentials out and trying to login:
$User = "xxx@xxxxxxxxxxxxx .onmicrosoft.com"
$PWord = ConvertTo-SecureString -String "<Password>" -AsPlainText -Force
$tenant = "<tenant id>"
$subscription = "<subscription id>"
$Credential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User,$PWord
Connect-AzAccount -Credential $Credential -Tenant $tenant -Subscription $subscription
Again, you'll likely see an error expecting 2FA:
Connect-AzAccount: You must use multi-factor authentication to access tenant xxxxx, ...
Using passwords to connect to Azure is generally considered insecure.
A better way to run your script is within the Azure CLI.
From here you can run:
Connect Az-Account -Identity
This allows Azure to use Managed Identities so a password is never exposed.
It would require some tweaks to your script but it might be a better solution for you.
Hope that helps.