question

Craigo-2676 avatar image
0 Votes"
Craigo-2676 asked ZollnerD edited

Programatically Add Enterprise App with Graph API

We are building an enterprise application that will utilize Azure AD to authenticate users. We want to build an admin portal to this enterprise app, to build out additional enterprise applications that the users will be able to access. Is there a way to add enterprise apps without using the Azure portal?

azure-ad-graphazure-ad-enterpriseapps
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Craigo-2676


I just wanted to check in and see if you had any other questions or if you were able to resolve this issue?

If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.


Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

0 Votes 0 ·
JamesTran-MSFT avatar image
0 Votes"
JamesTran-MSFT answered JamesTran-MSFT commented

@Craigo-2676
Thank you for your question! Adding to Michev's response, you can create an App or Service principle by following the below steps, using MS Graph Explorer.

1.Create your AzureAD application

 POST https://graph.microsoft.com/v1.0/applications
 Content-type: application/json
 Content-length: 67
    
 {
   "displayName": "Display name"
 }

2.Copy the App ID from the Graph API output, or by navigating to the App within the Azure Portal.

 "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications/$entity",
 "id": "33179750-.....",
 "deletedDateTime": null,
 "appId": "0195075e-b436...", <<Copy this appId>>
 "applicationTemplateId": null,
 "createdDateTime": "2021-02-08T21:34:02.3306981Z",

3.Create your Service Principle

 POST https://graph.microsoft.com/v1.0/servicePrincipals
 Content-type: application/json
    
 {
   "appId": "65415bb1-9267-4313-bbf5-ae259732ee12"
 }


65553-addapp-addsp.gif



If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.


Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.


addapp-addsp.gif (1.8 MiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

James thanks for the message and the gif, this is great information. My issues is when creating a service principal it wants an "Enterprise App ID" in order to create the service, not just an app id. Does this make sense? Appreciate your help.

0 Votes 0 ·

@Craigo-2676
Thank you for the quick follow up!

Are you able to share a screenshot of the error you're receiving? Or how you're trying to create this enterprise app.

I'll also reach out to my team regarding this to see if they have any additional inputs.


If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.

0 Votes 0 ·
michev avatar image
0 Votes"
michev answered Craigo-2676 commented

Yes, you can create an application object or a service principal one depending on the situation: https://docs.microsoft.com/en-us/graph/api/application-post-applications?view=graph-rest-1.0&tabs=http

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks, regarding the "depending on the situation" so you can create a service principal(enterprise) app, by making a call via Graph from an enterprise app?

0 Votes 0 ·

https://docs.microsoft.com/en-us/graph/api/serviceprincipal-post-serviceprincipals?view=graph-rest-1.0&tabs=http. When creating a service principal in this doc via Graph API it requires an Enterprise APP ID. Which I dont think you can create without going through the Amazon GUI.

0 Votes 0 ·
Dalila-8914 avatar image
0 Votes"
Dalila-8914 answered Dalila-8914 edited

Hello,
@Craigo-2676, I need help please, I'm in the same situation, I need to post an Entreprise App using Graph, When I do it, my App isn't available in Entreprise App but in App registration. , even though I create a service principal it still missing in Entreprise App. Also I need to assign users to this app, Actually isn't possible with an application created through Graph.
Thank you for any help.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.