0
votes

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.

+ 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.

New-AzureADApplication -DisplayName $displayName -IdentifierUris $URIs -GroupMembershipClaims "SecurityGroup" -ReplyUrls @($Live",$Dev,"http://localhost:4198/")
1
Try including the -Debug flag, you might be able to see the exact error there.juunas
Does not make a difference in the output of the error :/William BenEmbarek
Hmm, you could also try inspecting the traffic with Fiddler.juunas
Here's an example I used: github.com/Azure-Samples/powerbi-powershell/blob/master/… It's specifically for PowerBI, so may not directly apply but note that it uses a native app because powershell is a client app, and also note that the redirect URI is urn:ietf:wg:oauth:2.0:oob. This might be a complete red herring or it might give you somewhere else to lookNick.McDermaid

1 Answers

0
votes

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.