Forum Discussion

Sagar_Lad's avatar
Sagar_Lad
Brass Contributor
May 15, 2020

Change User Assignment required to Yes using powershell/azure CLI for enterprise application

Hi Team,

 

I would like to enable User Assignment required to Yes using powershell/azure CLI for enterprise application.

 

Could you suggest how can I enable it?

 

Thank You.

  • You can use PowerShell to set the appRoleAssignmentRequired property on the service principal.
    Reference: https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/what-is-access-management#requiring-user-assignment-for-an-app

    #Get current value first
    Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | select displayname, AppRoleAssignmentRequired
    #Change value to yes
    Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | set-AzureADServicePrincipal -AppRoleAssignmentRequired $true
    #Confirm the value changed
    Get-AzureADServicePrincipal -Filter "displayname eq 'My Test App'" | select displayname, AppRoleAssignmentRequired

    If this helped you please mark as best answer. thank you.

Resources