How to create a service principal without app, and create an app without service principal in Azure AD

1.9k Views Asked by At

Recently I watched a course on Pluralsight.com, Getting Started with Azure Active Directory for Developers. In the section, Service Principals->Apps and Service Principals, the author said that we can create a service principal without app, and it's also possible to create an app without service principal. But he didn't show how to do so, and I cannot find out online how to do so either. So how can we do so? And can we do so from the Azure Portal?

1

There are 1 best solutions below

1
On

Yes it is possible to create an azure ad app without creating a service principle(using powershell only) . Through portal if you will create it will create service princple along with app. You can view the newly created app in the App registrations blade, under All applications in the Azure portal

Powershell cmdlet.

New-AzureADApplication -DisplayName "MTS Demo App"

enter image description here enter image description here

It is not possible to create a service principle without creating an application. Service Principle will create an azure active directory as an application

# Create a service principal for a resource group using a preferred name and role
az ad sp create-for-rbac --name myServicePrincipalName \
                         --role reader \
                         --scopes /subscriptions/mySubscriptionID/resourceGroups/myResourceGroupName

Note : For creating Service Principle you need to admin role at the subscription level and Adminsitator role at Azure Active Directory Level.

Reference : https://learn.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli#code-try-0***