diff --git a/src/commands/deployment/onboard.ts b/src/commands/deployment/onboard.ts index 6db253139..ec5ad11a5 100644 --- a/src/commands/deployment/onboard.ts +++ b/src/commands/deployment/onboard.ts @@ -121,8 +121,16 @@ export const setConfiguration = ( ): boolean => { try { const data = readYaml(defaultConfigFile()); - data.introspection!.azure!.account_name = storageAccountName; - data.introspection!.azure!.table_name = storageTableName; + if (!data.introspection) { + data.introspection = { + azure: {} + }; + } else if (!data.introspection.azure) { + data.introspection.azure = {}; + } + + data.introspection.azure!.account_name = storageAccountName; + data.introspection.azure!.table_name = storageTableName; const jsonData = yaml.safeDump(data); logger.verbose(jsonData); fs.writeFileSync(defaultConfigFile(), jsonData);