You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to add Application Permissions to an App Registration, I am running into an issue where the permission is added as a GUID and is unable to verified.
For example, adding the Microsoft Graph Directory.Read.All permission, I am running the following:
When attempting to validate through the web interface, I get the following:
I've tried the New-AzureADServiceAppRoleAssignment as well, but get an error when I try to use the ID of the required resource. The only way I can get the command to complete is with the following:
create the service principal to assign application permissions to
It still generates the Consent Validation Failed message from above.
From what I can see, none of these cmdlets have examples loaded into them, in either a Docs page or using the Get-Help -examples commands.
As a note, I tried using the Azure Bash CLI commands of az ad app permission grant --id 00000000-0000-0000-0000-000000000000 --api 0000-0000-c000-000000000000 --api-permission 06da0dbc-49e2-44d2-8312-53f166ab848a=Scope generates the same result in the web interface as the screen shot above, with the same Consent Validation Failed message when trying to grant access.
Let me know if I can provide any further information.
The text was updated successfully, but these errors were encountered:
Hello,
When trying to add Application Permissions to an App Registration, I am running into an issue where the permission is added as a GUID and is unable to verified.
For example, adding the Microsoft Graph Directory.Read.All permission, I am running the following:
Get the service principal
$graph = Get-AzureADServicePrincipal -SearchString "Microsoft Graph"
Create the access opject
$readAll = New-Object Microsoft.Open.AzureAd.Model.ResourceAccess
Application permission instead of delegated
$readAll.Type = "Role"
Permission ID
$readAll.Id = ($graph.Oauth2Permissions | where {$_.Value -eq 'Directory.Read.All'}).Id
$graphRequiredAccess = New-Object Microsoft.Open.AzureAd.Model.RequiredResourceAccess
$graphRequiredAccess.ResourceAppId = $graph.AppId
$graphRequiredAccess.ResourceAccess = New-Object System.Collections.Generic.List[Microsoft.Open.AzureAD.Model.ResourceAccess]
$graphRequiredAccess.ResourceAccess.Add($readAll)
$requiredPermissions = New-Object System.Collections.Generic.List[Microsoft.Open.AzureAd.Model.RequiredResourceAccess]
$requiredPermissions.Add($graphRequiredAccess)
create the application
$app = New-AzureADApplication -DisplayName "Test Application" -AvailableToOtherTenants $false -RequiredResourceAccess $requiredPermissions
This creates the following permission in the app:
When attempting to validate through the web interface, I get the following:
I've tried the New-AzureADServiceAppRoleAssignment as well, but get an error when I try to use the ID of the required resource. The only way I can get the command to complete is with the following:
create the service principal to assign application permissions to
$sp = New-AzureADServicePrincipal -AppId $app.AppId
assign the permissions to the service prinicpal
foreach ($requiredApp in $app.RequiredResourceAccess)
{
New-AzureADServiceAppRoleAssignment -ObjectId $sp.ObjectId -PrincipalId $sp.ObjectId `
-ResourceId ($sps | where {$_.AppId -eq $requiredApp.ResourceAppId}).ObjectId -Id ([Guid]::Empty)
}
It still generates the Consent Validation Failed message from above.
From what I can see, none of these cmdlets have examples loaded into them, in either a Docs page or using the Get-Help -examples commands.
As a note, I tried using the Azure Bash CLI commands of az ad app permission grant --id 00000000-0000-0000-0000-000000000000 --api 0000-0000-c000-000000000000 --api-permission 06da0dbc-49e2-44d2-8312-53f166ab848a=Scope generates the same result in the web interface as the screen shot above, with the same Consent Validation Failed message when trying to grant access.
Let me know if I can provide any further information.
The text was updated successfully, but these errors were encountered: