Вы можете попробовать следующие шаги (я не смог протестировать его для вас, поскольку у меня нет учетной записи без поддержки MFA).
1. В DevOps перейдите к Project Settings
- > Service connections
-> New service connection
-> Azure Classic
.
Then input the information, you could get the subscription name and id in the azure portal -> Subscriptions.
Note: The Username
and Password
need to be the user account without MFA-enabled.
2.After creating the service connection, in the pipline, create a Azure powershell task with Task version 3.*
, select the Azure Connection Type
with Azure Classic
, select Azure Classic Subscription
with the service connection which was created in step 1.
Then use the script:
Select-AzureSubscription -SubscriptionName -Current
CloudServices = Get-AzureService | select ServiceName
введите описание изображения здесь