简体   繁体   English

使用Powershell创建新的AzureAD应用程序

[英]Creation of new AzureAD application with powershell

I'm trying to create a new AzureAD application by using the Azure Active Directory Powershell 2.0 module, however after calling the New- AzureADApplication I get a HTTP Bad requset with the following error. 我正在尝试使用Azure Active Directory Powershell 2.0模块创建一个新的AzureAD应用程序,但是在调用New-AzureADApplication之后,我收到了HTTP Bad requset,出现以下错误。

+ New-AzureADApplication -DisplayName "Umbraco-domea" -IdentifierUris $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [New-AzureADApplication], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.NewApplication

I found the following github issue with a bit of googling, however even by including the -IdentifierUris in my cmdlet call I still get the error. 我发现了以下github问题并进行了一些谷歌搜索,但是即使在我的cmdlet调用中包含-IdentifierUris,我仍然会收到错误。

New-AzureADApplication -DisplayName $displayName -IdentifierUris $URIs -GroupMembershipClaims "SecurityGroup" -ReplyUrls @($Live",$Dev,"http://localhost:4198/")

The following script works for me, maybe you could test. 以下脚本对我有用,也许您可​​以进行测试。

$displayName="shuitest"
$URIs="http://mynewapp.contoso.com"
$Live="https://localhost:8080"
$Dev="https://localhost:8081"
New-AzureADApplication -DisplayName $displayName -IdentifierUris $URIs -GroupMembershipClaims "SecurityGroup" -ReplyUrls @($Live,$Dev,"http://localhost:4198/")

If you also get same error log, begin your script add $DebugPreference="Continue" to produce additional debugging information. 如果您还收到相同的错误日志,请在脚本开始添加$DebugPreference="Continue"以生成其他调试信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM