@@ -35,8 +35,8 @@ async function main() {
3535 throw new Error ( "Not all values are present in the creds object. Ensure clientId, clientSecret, tenantId and subscriptionId are supplied." ) ;
3636 }
3737 // Attempting Az cli login
38- await executeAzCliCommand ( `login --service-principal -u "${ servicePrincipalId } " -p "${ servicePrincipalKey } " --tenant "${ tenantId } "` ) ;
39- await executeAzCliCommand ( `account set --subscription "${ subscriptionId } "` ) ;
38+ await executeAzCliCommand ( `login --service-principal -u "${ servicePrincipalId } " -p "${ servicePrincipalKey } " --tenant "${ tenantId } "` , true ) ;
39+ await executeAzCliCommand ( `account set --subscription "${ subscriptionId } "` , true ) ;
4040 isAzCLISuccess = true ;
4141 if ( enableAzPSSession ) {
4242 // Attempting Az PS login
@@ -45,7 +45,7 @@ async function main() {
4545 await spnlogin . initialize ( ) ;
4646 await spnlogin . login ( ) ;
4747 }
48- console . log ( "Login successful." ) ;
48+ console . log ( "Login successful." ) ;
4949 } catch ( error ) {
5050 if ( ! isAzCLISuccess ) {
5151 core . error ( "Az CLI Login failed. Please check the credentials. For more information refer https://aka.ms/create-secrets-for-GitHub-workflows" ) ;
@@ -60,9 +60,9 @@ async function main() {
6060 }
6161}
6262
63- async function executeAzCliCommand ( command : string ) {
63+ async function executeAzCliCommand ( command : string , silent ?: boolean ) {
6464 try {
65- await exec . exec ( `"${ azPath } " ${ command } ` , [ ] , { } ) ;
65+ await exec . exec ( `"${ azPath } " ${ command } ` , [ ] , { silent : ! ! silent } ) ;
6666 }
6767 catch ( error ) {
6868 throw new Error ( error ) ;
0 commit comments