Skip to content

Commit 5e03ac4

Browse files
authored
Update example for Connect-AzAccount (#22158)
* Update example for Connect-AzAccount To address #22069 * Address review comments
1 parent 3be2043 commit 5e03ac4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Accounts/Accounts/help/Connect-AzAccount.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ command connects the specified Azure tenant using the service principal credenti
134134
authenticates as a service principal.
135135

136136
```powershell
137+
$SecurePassword = ConvertTo-SecureString -String "Password123!" -AsPlainText -Force
138+
$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy'
139+
$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz'
137140
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $SecuredPassword
138141
Connect-AzAccount -ServicePrincipal -TenantId $TenantId -Credential $Credential
139142
```
@@ -239,7 +242,7 @@ This example connects to an Azure account using certificate-based service princi
239242
The certificate file, which is specified by `CertficatePath`, should contains both certificate and private key as the input.
240243

241244
```powershell
242-
$securePassword = $plainPassword | ConvertTo-SecureString -AsPlainText -Force
245+
$SecurePassword = ConvertTo-SecureString -String "Password123!" -AsPlainText -Force
243246
$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy'
244247
$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz'
245248
Connect-AzAccount -ServicePrincipal -ApplicationId $ApplicationId -TenantId $TenantId -CertificatePath './certificatefortest.pfx' -CertificatePassword $securePassword

0 commit comments

Comments
 (0)