This repository was archived by the owner on Apr 13, 2020. It is now read-only.
File tree 1 file changed +13
-6
lines changed
1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,21 @@ import { AzureAccessOpts } from "../../types";
13
13
export const getCredentials = async (
14
14
opts : AzureAccessOpts = { }
15
15
) : Promise < ClientSecretCredential | undefined > => {
16
+ let servicePrincipalId = opts . servicePrincipalId ;
17
+ let servicePrincipalPassword = opts . servicePrincipalPassword ;
18
+ let tenantId = opts . tenantId ;
19
+
16
20
// Load config from opts and fallback to spk config
17
- const { azure } = Config ( ) . introspection ! ;
21
+ const config = Config ( ) ;
22
+ const azure =
23
+ config && config . introspection ? config . introspection . azure : undefined ;
18
24
19
- const {
20
- servicePrincipalId = azure && azure . service_principal_id ,
21
- servicePrincipalPassword = azure && azure . service_principal_secret ,
22
- tenantId = azure && azure . tenant_id
23
- } = opts ;
25
+ if ( azure ) {
26
+ servicePrincipalId = servicePrincipalId || azure . service_principal_id ;
27
+ servicePrincipalPassword =
28
+ servicePrincipalPassword || azure . service_principal_secret ;
29
+ tenantId = tenantId || azure . tenant_id ;
30
+ }
24
31
25
32
if (
26
33
! verifyConfigDefined ( servicePrincipalId , servicePrincipalPassword , tenantId )
You can’t perform that action at this time.
0 commit comments