This repository was archived by the owner on Apr 13, 2020. It is now read-only.
File tree 1 file changed +11
-6
lines changed
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 (
42
42
opts : AzureAccessOpts = { }
43
43
) : Promise < msRestNodeAuth . ApplicationTokenCredentials | undefined > => {
44
44
// 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 ;
46
49
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
+ }
52
57
53
58
if (
54
59
! verifyConfigDefined ( servicePrincipalId , servicePrincipalPassword , tenantId )
You can’t perform that action at this time.
0 commit comments