azure - Using AzureAD PowerShell CmdLets on TFS Release Manager -
i want execute powershell scripts on our tfs release manager environment use azuread module provision azure ad groups. scripts executed using azure powershell task. i've installed azuread module, azuread powershell cmdlets recognized.
however, them work scripts first needs connect azuread using connect-azuread cmdlet. cmdlet wants show modal dialog entering credentials, isn't possible in release manager task. cannot supply credentials using command line parameters. want connect-azuread somehow use current user context connection. possible?
you use -credential option of connect-azuread.
in azuread task, can use following code: ```
$pass=convertto-securestring $env:password -asplaintext -force $credential=new-object pscredential($env:login, $pass) connect-azuread -credential $credential
``` login , password stored in secret variable in release definition.
alternatively might password previous task in build definition. case, in script arguments of task, pass password -password "$(password)"
, in `script or script inline have, time: ``
param([string]$password) $pass=convertto-securestring $password -asplaintext -force $credential = new-object pscredential($env:login, $pass) connect-azuread -credential $credential
``
i password keyvault azure keyvault task, might not option if on premise.
Comments
Post a Comment