@@ -36,7 +36,17 @@ function main() {
3636 core . exportVariable ( 'AZURE_HTTP_USER_AGENT' , userAgentString ) ;
3737 core . exportVariable ( 'AZUREPS_HOST_ENVIRONMENT' , azurePSHostEnv ) ;
3838 azPath = yield io . which ( "az" , true ) ;
39- yield executeAzCliCommand ( "--version" ) ;
39+ let output = "" ;
40+ const options = {
41+ listeners : {
42+ stdout : ( data ) => {
43+ output += data . toString ( ) ;
44+ }
45+ }
46+ } ;
47+ yield executeAzCliCommand ( "--version" , true , options ) ;
48+ core . debug ( `az cli version used:\n${ output } ` ) ;
49+
4050 let creds = core . getInput ( 'creds' , { required : true } ) ;
4151 let secrets = new actions_secret_parser_1 . SecretParser ( creds , actions_secret_parser_1 . FormatType . JSON ) ;
4252 let servicePrincipalId = secrets . getSecret ( "$.clientId" , false ) ;
@@ -45,6 +55,7 @@ function main() {
4555 let subscriptionId = secrets . getSecret ( "$.subscriptionId" , false ) ;
4656 const enableAzPSSession = core . getInput ( 'enable-AzPSSession' ) . toLowerCase ( ) === "true" ;
4757 const allowNoSubscriptionsLogin = core . getInput ( 'allow-no-subscriptions' ) . toLowerCase ( ) === "true" ;
58+
4859 if ( ! servicePrincipalId || ! servicePrincipalKey || ! tenantId ) {
4960 throw new Error ( "Not all values are present in the creds object. Ensure clientId, clientSecret and tenantId are supplied." ) ;
5061 }
@@ -85,10 +96,12 @@ function main() {
8596 }
8697 } ) ;
8798}
88- function executeAzCliCommand ( command , silent ) {
99+
100+ function executeAzCliCommand ( command , silent , options = { } ) {
89101 return __awaiter ( this , void 0 , void 0 , function * ( ) {
102+ options . silent = ! ! silent ;
90103 try {
91- yield exec . exec ( `"${ azPath } " ${ command } ` , [ ] , { silent : ! ! silent } ) ;
104+ yield exec . exec ( `"${ azPath } " ${ command } ` , [ ] , options ) ;
92105 }
93106 catch ( error ) {
94107 throw new Error ( error ) ;
0 commit comments