You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-conceptual/azps-1.3.0/authenticate-azureps.md
+43-4Lines changed: 43 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.author: sttramer
6
6
manager: carmonm
7
7
ms.devlang: powershell
8
8
ms.topic: conceptual
9
-
ms.date: 10/29/2018
9
+
ms.date: 02/20/2019
10
10
---
11
11
# Sign in with Azure PowerShell
12
12
@@ -43,18 +43,57 @@ $creds = Get-Credential
43
43
Connect-AzAccount -Credential $creds
44
44
```
45
45
46
-
## Sign in with a service principal
46
+
## Sign in with a service principal <aname="sp-signin"/>
47
47
48
48
Service principals are non-interactive Azure accounts. Like other user accounts, their permissions are managed with Azure Active Directory. By granting a service principal only the permissions it needs, your automation scripts stay secure.
49
49
50
50
To learn how to create a service principal for use with Azure PowerShell, see [Create an Azure service principal with Azure PowerShell](create-azure-service-principal-azureps.md).
51
51
52
52
To sign in with a service principal, use the `-ServicePrincipal` argument with the `Connect-AzAccount` cmdlet. You'll also need the service principal's application ID,
53
-
sign-in credentials, and the tenant ID associate with the service principal. To get the service principal's credentials as the appropriate object, use the [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential) cmdlet. This cmdlet will present a prompt for the service principal user ID and password.
53
+
sign-in credentials, and the tenant ID associate with the service principal. How you sign in with a service principal will depend on whether it's configured for password-based or certificate-based authentication.
54
+
55
+
### Password-based authentication
56
+
57
+
To get the service principal's credentials as the appropriate object, use the [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential) cmdlet. This cmdlet will present a prompt for a username and password. Use the service principal ID for the username.
In PowerShell 5, the certificate store can be managed and inspected with the [PKI](/powershell/module/pkiclient) module. For PowerShell 6, the process is more complicated. The following scripts show you how to import an existing certificate into the certificate store accessible by PowerShell.
0 commit comments