0
votes

I am able to set the azure application ("Read Directory Data") permissions using the below but how can I set the same using New-AzureRmADApplication.

$appPermission1 = New-Object -TypeName 
   "Microsoft.Open.AzureAD.Model.ResourceAccess" -ArgumentList "5778995a-e1bf- 
   45b8-affa-663a9f3f4d04","Role" #Read Directory data

$reqGraph.ResourceAccess = $appPermission1

$myApp = New-AzureADApplication -DisplayName $applicationName -IdentifierUris 
    $applicationURI -Homepage $appHomePageUrl -ReplyUrls $appReplyURLs -ErrorUrl 
    $applicationURI -LogoutUrl $applicationURI  -PasswordCredentials 
    $PasswordCredential -RequiredResourceAccess $reqGraph
1

1 Answers

0
votes

AFAIK, you could not do that with New-AzureRmADApplication.

New-AzureRmADApplication belongs to Azure RM powershell module. New-AzureADApplication belongs to Azure AD powershell module.

They are different, not all the things AD module can do that RM module also can. You could find all the command and their properties related to ad in RM module, check this link. There is no property like RequiredResourceAccess.