@@ -25,19 +25,25 @@ export class KeyVaultTaskParameters {
2525 this . keyVaultName = tl . getInput ( "KeyVaultName" , true ) ;
2626 this . secretsFilter = tl . getDelimitedInput ( "SecretsFilter" , "," , true ) ;
2727 var azureKeyVaultDnsSuffix = tl . getEndpointDataParameter ( connectedService , "AzureKeyVaultDnsSuffix" , true ) ;
28+ if ( ! azureKeyVaultDnsSuffix ) {
29+ azureKeyVaultDnsSuffix = "vault.azure.net"
30+ }
2831 this . servicePrincipalId = tl . getEndpointAuthorizationParameter ( connectedService , 'serviceprincipalid' , true ) ;
2932 this . keyVaultUrl = util . format ( "https://%s.%s" , this . keyVaultName , azureKeyVaultDnsSuffix ) ;
3033 this . scheme = tl . getEndpointAuthorizationScheme ( connectedService , false ) ;
31- this . vaultCredentials = await this . getVaultCredentials ( connectedService , azureKeyVaultDnsSuffix ) ;
34+ this . vaultCredentials = await this . getVaultCredentials ( connectedService ) ;
3235 return this ;
3336 }
3437
35- private async getVaultCredentials ( connectedService : string , azureKeyVaultDnsSuffix : string ) : Promise < msRestAzure . ApplicationTokenCredentials > {
38+ private async getVaultCredentials ( connectedService : string ) : Promise < msRestAzure . ApplicationTokenCredentials > {
3639 const endpoint : AzureEndpoint = await new AzureRMEndpoint ( connectedService ) . getEndpoint ( ) ;
3740
3841 if ( ! ! endpoint . environment && endpoint . environment . toLowerCase ( ) == this . _environments . AzureStack ) {
3942 endpoint . applicationTokenCredentials . activeDirectoryResourceId = endpoint . activeDirectoryResourceID . replace ( "management" , "vault" ) ;
4043 } else {
44+ if ( ! endpoint . azureKeyVaultServiceEndpointResourceId ) {
45+ endpoint . azureKeyVaultServiceEndpointResourceId = "https://vault.azure.net" ;
46+ }
4147 endpoint . applicationTokenCredentials . baseUrl = endpoint . azureKeyVaultServiceEndpointResourceId ;
4248 endpoint . applicationTokenCredentials . activeDirectoryResourceId = endpoint . azureKeyVaultServiceEndpointResourceId ;
4349 }
0 commit comments