Pass the user name and password to connect the azure in DevOps

Brass Contributor

Dear All,

I'm a learner of DevOps and need your help to connect the Azure PowerShell in DevOps.

 

Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force -AllowClobber
$Uname=$env:Name
$Uname
$Pname = $env:Password | ConvertTo-SecureString -AsPlainText -Force
$Pname
$Credentials = New-Object System.Management.Automation.PSCredential $Uname,$Pname

Connect-AzAccount -Credential $Credentials

 

$env:Name and $env:Password trying to get from DevOps variables

0 Replies