[英]How to create PasswordCredentials object and pass in New-AzADApplication using Azure PowerShell
I want to create Azure Active Directory Application with PasswordCredentials. 我想使用PasswordCredentials创建Azure Active Directory应用程序。 The following doc uses Password and not PasswordCredentials https://docs.microsoft.com/en-us/powershell/module/az.resources/new-azadapplication?view=azps-2.4.0
以下文档使用密码而不使用密码凭据https://docs.microsoft.com/zh-cn/powershell/module/az.resources/new-azadapplication?view=azps-2.4.0
Could anyone suggest how do i create PasswordCredentials object using Az module and pass in the New-AzADApplication
任何人都可以建议我如何使用Az模块创建PasswordCredentials对象并传递
New-AzADApplication
New-AzADApplication -DisplayName "xxx" -IdentifierUris "xxx" -PasswordCredentials
Try the following: 请尝试以下操作:
$passwordCred = [Microsoft.Azure.Commands.ActiveDirectory.PSADPasswordCredential]@{
"StartDate" = [DateTime]::UtcNow
"EndDate" = [DateTime]::UtcNow.AddYears(1)
"Password" = "{password-here}"
}
New-AzADApplication -DisplayName "My_app" `
-IdentifierUris "https://example.com/api" `
-PasswordCredentials @($passwordCred)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.