0

Everytime I go to create a Service Principal in azure, I go through the steps of creating an Application. Which I understand, cool. My application has authentication rights.

When I create an Automation Run As account, it creates a service principal and and stores a certificate. Where is the certificate or whatever other THINGS make this a service principal? I want to find out what subscriptions my service principal has rights to by list in PowerShell, but some app ID doesn't seem like its the right path.

cool I can get the name of the service principal of the app. ONLY shows me how to do this in powershell. WHAT is the SP ?? WHERE is it

meow tho
  • 37
  • 1
  • 1
  • 6

2 Answers2

0

Service principals are not on the portal, so you can only use other tools to work with them (like powershell you mentioned).

https://learn.microsoft.com/es-es/azure/active-directory/develop/app-objects-and-service-principals
https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
0

According to my understanding, you want to get Azure AD service principal with PowerShell. You can use PowerShell command "Get-AzureRmADServicePrincipal". The script is as below.

Login-AzureRmAccount
Get-AzureRmSubscription
Select-AzureRmSubscription -SubscriptionName "<yourSubscriptionName>"
Get-AzureRmADServicePrincipal

Besides,in order to access resources that are secured by an Azure AD tenant, the entity that requires access must be represented by a security principal. This is true for both users (user principal) and applications (service principal). For more details, please refer to the document.

axfd
  • 291
  • 1
  • 6
  • Can I Login AS the service principal – meow tho Aug 07 '18 at 06:20
  • Yes you can. The Azure CLI command is that " az login --service-principal -u -p --tenant ". The Powershell command is that " $Credential = Get-Credential Connect-AzureRmAccount -Credential $Credential -Tenant "xxxx-xxxx-xxxx-xxxx" -ServicePrincipal " For more details, please refer to https://learn.microsoft.com/en-us/powershell/azure/authenticate-azureps?view=azurermps-6.6.0#sign-in-with-a-service-principal. – axfd Aug 08 '18 at 01:14