This repository was archived by the owner on Apr 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,18 @@ export const getManagementCredentials = async (
4242 opts : AzureAccessOpts = { }
4343) : Promise < msRestNodeAuth . ApplicationTokenCredentials | undefined > => {
4444 // Load config from opts and fallback to spk config
45- const { azure } = Config ( ) . introspection ! ;
45+ const conf = Config ( ) ;
46+ let servicePrincipalId = opts . servicePrincipalId ;
47+ let servicePrincipalPassword = opts . servicePrincipalPassword ;
48+ let tenantId = opts . tenantId ;
4649
47- const {
48- servicePrincipalId = azure && azure . service_principal_id ,
49- servicePrincipalPassword = azure && azure . service_principal_secret ,
50- tenantId = azure && azure . tenant_id
51- } = opts ;
50+ if ( conf && conf . introspection && conf . introspection . azure ) {
51+ const azure = conf . introspection . azure ;
52+ servicePrincipalId = servicePrincipalId || azure . service_principal_id ;
53+ servicePrincipalPassword =
54+ servicePrincipalPassword || azure . service_principal_secret ;
55+ tenantId = tenantId || azure . tenant_id ;
56+ }
5257
5358 if (
5459 ! verifyConfigDefined ( servicePrincipalId , servicePrincipalPassword , tenantId )
You can’t perform that action at this time.
0 commit comments