-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update doc for service principal certificate authentication #4756
Conversation
```azurecli-interactive | ||
az login --service-principal -u <app-id> -p <password-or-cert> --tenant <tenant> | ||
az login --service-principal --username APP_ID --certificate /path/to/cert.pem --tenant TENANT_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full argument names should be preferred.
Learn Build status updates of commit 9661197: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Learn Build status updates of commit 9661197: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
--username myServicePrincipalID \ | ||
--tenant myOwnerOrganizationId \ | ||
--password /path/to/cert | ||
az login --service-principal --username APP_ID --certificate /path/to/cert.pem --tenant TENANT_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a very long command, so no need to break it into several lines.
--username myServicePrincipalID \ | ||
--tenant myOwnerOrganizationId \ | ||
--password /path/to/cert | ||
az login --service-principal --username APP_ID --certificate /path/to/cert.pem --tenant TENANT_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the placeholders are changed to align with those in docs-ref-conceptual/authenticate-azure-cli-service-principal.md
.
@@ -102,8 +102,6 @@ az keyvault secret download --file /path/to/cert.pfx \ | |||
--name CertName \ | |||
--encoding base64 | |||
openssl pkcs12 -in cert.pfx -passin pass: -passout pass: -out cert.pem -nodes | |||
|
|||
az login --service-principal -u "<myAppClientID>" -p cert.pem --tenant "<myTenantID>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to mention az login
command here. It is later mentioned in "Sign in with a service principal using a certificate" section.
Learn Build status updates of commit 5efda54: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Learn Build status updates of commit b6cdc4b: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Learn Build status updates of commit 433a5f0: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look at my comments
> ``` | ||
> | ||
> Under PowerShell, use the `Get-Credential` cmdlet. | ||
> | ||
> ```powershell | ||
> $AzCred = Get-Credential -UserName <app-id> | ||
> az login --service-principal -u $AzCred.UserName -p $AzCred.GetNetworkCredential().Password --tenant <tenant> | ||
> az login --service-principal --username $AzCred.UserName --password $AzCred.GetNetworkCredential().Password --tenant <tenant> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikefrobbins any thoughts on using $Cred.GetNetworkCredential
vs $Cred.Password
?
Co-authored-by: Damien Caro <dcaro@microsoft.com>
Learn Build status updates of commit d7fb0de: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Update doc according to Azure/azure-cli#30283