Manipulate single page application's redirect URIs with az CLI in AD's app registration

Jacky Lam 210 Reputation points
2023-06-19T04:36:56.8966667+00:00

Hi,

I need to write a script to add and remove some entries in the single page application of app registration in AD. Is it possible to do this with az rest? Any example? Thanks.

Jacky

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Accepted answer
  1. Shweta Mathur 30,301 Reputation points Microsoft Employee Moderator
    2023-06-20T06:43:19.86+00:00

    Hi @Jacky Lam ,

    Thanks for reaching out.

    Yes, it is possible to add and remove entries in the single page application of app registration in AD using script.

    You can refer the below scripts to add/ remove entries of application registration with az CLI commands.

    https://github.com/microsoft/healthcare-apis-samples/blob/main/src/scripts/appregistrationcli.http

    Reference: https://learn.microsoft.com/en-us/azure/healthcare-apis/register-application-cli-rest

    You can also use the az rest command to add/ update and delete the applications

    az rest --method post --uri https://graph.microsoft.com/v1.0/applications --headers "Content-Type=application/json" --body "{\"displayName\":\"webapi1\",\"signInAudience\":\"AzureADMyOrg\",\"web\":{\"redirectUris\":[\"https://jwt.ms\"]},\"requiredResourceAccess\":[{\"resourceAppId\":\"00000003-0000-0000-c000-000000000000\",\"resourceAccess\":[{\"id\":\"e1fe6dd8-ba31-4d61-89e7-88639da4683d\",\"type\":\"Scope\"}]}]}"
    

    Reference: https://www.azurecitadel.com/rest-api/cli/

    Hope this will help.

    Thanks,

    Shweta


    Please remember to "Accept Answer" if answer helped you.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.