I have two applications (ui and api) in Azure Active Directory. How do I add ui application id to knownClientApplications list in api application manifest via PowerShell script?
Asked
Active
Viewed 172 times
0
-
Could you include additional details like what you tried and where you stuck with code and errors by editing your question? – Sridevi Mar 11 '23 at 07:18
-
Currently I added the id manually. But I would like to add it automatically via a script. – user989988 Mar 14 '23 at 16:55
1 Answers
0
I tried to reproduce the same in my environment and got below results:
I created one App registration named API App
like below:
Now, I registered one Azure AD registration named UI App
like below:
To add this UI App
application id to knownClientApplications list in API App
application manifest via PowerShell, you can use below script:
$UIAppId = "c94e5f5f-c2b6-4a14-82a4-xxxxxxx"
$API0bjectId = "861f810d-a48f-4cb0-9b71-xxxxxxxx"
Set-AzureADApplication -ObjectId $API0bjectId -KnownClientApplications $UIAppId
Response:
When I checked the same in Portal, UI App
ID added successfully to knownClientApplications list in API App
application manifest like below:
If you want to set Authorized client applications from PowerShell, you can refer below link:
How do you set preAuthorizedApplications using Powershell by SaurabhSharma-MSFT

Sridevi
- 10,599
- 1
- 4
- 17
-
-
1I ran the script without exposing the API and added known client applications. Please check the updated answer. – Sridevi Mar 16 '23 at 05:36