@microsoft/teamsfx-core 1.1.2 → 1.1.3-alpha.e5227bb6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/armInterface.d.ts +1 -1
- package/build/common/armInterface.d.ts.map +1 -1
- package/build/common/constants.d.ts +3 -2
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +3 -2
- package/build/common/constants.js.map +1 -1
- package/build/common/deps-checker/checkerFactory.d.ts +8 -0
- package/build/common/deps-checker/checkerFactory.d.ts.map +1 -0
- package/build/common/deps-checker/checkerFactory.js +32 -0
- package/build/common/deps-checker/checkerFactory.js.map +1 -0
- package/build/common/deps-checker/constant/helpLink.d.ts +11 -0
- package/build/common/deps-checker/constant/helpLink.d.ts.map +1 -0
- package/build/common/deps-checker/constant/helpLink.js +16 -0
- package/build/common/deps-checker/constant/helpLink.js.map +1 -0
- package/build/common/deps-checker/constant/index.d.ts +4 -0
- package/build/common/deps-checker/constant/index.d.ts.map +1 -0
- package/build/common/deps-checker/constant/index.js +9 -0
- package/build/common/deps-checker/constant/index.js.map +1 -0
- package/build/common/deps-checker/constant/message.d.ts +29 -0
- package/build/common/deps-checker/constant/message.d.ts.map +1 -0
- package/build/common/deps-checker/constant/message.js +57 -0
- package/build/common/deps-checker/constant/message.js.map +1 -0
- package/build/common/deps-checker/constant/telemetry.d.ts +43 -0
- package/build/common/deps-checker/constant/telemetry.d.ts.map +1 -0
- package/build/common/deps-checker/constant/telemetry.js +51 -0
- package/build/common/deps-checker/constant/telemetry.js.map +1 -0
- package/build/common/deps-checker/depsChecker.d.ts +24 -0
- package/build/common/deps-checker/depsChecker.d.ts.map +1 -0
- package/build/common/deps-checker/depsChecker.js +13 -0
- package/build/common/deps-checker/depsChecker.js.map +1 -0
- package/build/common/deps-checker/depsError.d.ts +17 -0
- package/build/common/deps-checker/depsError.d.ts.map +1 -0
- package/build/common/deps-checker/depsError.js +42 -0
- package/build/common/deps-checker/depsError.js.map +1 -0
- package/build/common/deps-checker/depsLogger.d.ts +11 -0
- package/build/common/deps-checker/depsLogger.d.ts.map +1 -0
- package/build/common/deps-checker/depsLogger.js +5 -0
- package/build/common/deps-checker/depsLogger.js.map +1 -0
- package/build/common/deps-checker/depsManager.d.ts +36 -0
- package/build/common/deps-checker/depsManager.d.ts.map +1 -0
- package/build/common/deps-checker/depsManager.js +83 -0
- package/build/common/deps-checker/depsManager.js.map +1 -0
- package/build/common/deps-checker/depsTelemetry.d.ts +10 -0
- package/build/common/deps-checker/depsTelemetry.d.ts.map +1 -0
- package/build/common/deps-checker/depsTelemetry.js +5 -0
- package/build/common/deps-checker/depsTelemetry.js.map +1 -0
- package/build/common/deps-checker/index.d.ts +8 -0
- package/build/common/deps-checker/index.d.ts.map +1 -0
- package/build/common/deps-checker/index.js +13 -0
- package/build/common/deps-checker/index.js.map +1 -0
- package/build/common/deps-checker/internal/dotnetChecker.d.ts +50 -0
- package/build/common/deps-checker/internal/dotnetChecker.d.ts.map +1 -0
- package/build/common/deps-checker/internal/dotnetChecker.js +406 -0
- package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -0
- package/build/common/deps-checker/internal/funcToolChecker.d.ts +40 -0
- package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -0
- package/build/common/deps-checker/internal/funcToolChecker.js +279 -0
- package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -0
- package/build/common/deps-checker/internal/ngrokChecker.d.ts +28 -0
- package/build/common/deps-checker/internal/ngrokChecker.d.ts.map +1 -0
- package/build/common/deps-checker/internal/ngrokChecker.js +183 -0
- package/build/common/deps-checker/internal/ngrokChecker.js.map +1 -0
- package/build/common/deps-checker/internal/nodeChecker.d.ts +40 -0
- package/build/common/deps-checker/internal/nodeChecker.d.ts.map +1 -0
- package/build/common/deps-checker/internal/nodeChecker.js +144 -0
- package/build/common/deps-checker/internal/nodeChecker.js.map +1 -0
- package/build/common/deps-checker/util/cpUtils.d.ts +24 -0
- package/build/common/deps-checker/util/cpUtils.d.ts.map +1 -0
- package/build/common/deps-checker/util/cpUtils.js +99 -0
- package/build/common/deps-checker/util/cpUtils.js.map +1 -0
- package/build/common/deps-checker/util/progressIndicator.d.ts +3 -0
- package/build/common/deps-checker/util/progressIndicator.d.ts.map +1 -0
- package/build/common/deps-checker/util/progressIndicator.js +18 -0
- package/build/common/deps-checker/util/progressIndicator.js.map +1 -0
- package/build/common/deps-checker/util/system.d.ts +5 -0
- package/build/common/deps-checker/util/system.d.ts.map +1 -0
- package/build/common/deps-checker/util/system.js +24 -0
- package/build/common/deps-checker/util/system.js.map +1 -0
- package/build/common/index.d.ts +4 -0
- package/build/common/index.d.ts.map +1 -1
- package/build/common/index.js +4 -0
- package/build/common/index.js.map +1 -1
- package/build/common/local/constants.d.ts +115 -0
- package/build/common/local/constants.d.ts.map +1 -0
- package/build/common/local/constants.js +122 -0
- package/build/common/local/constants.js.map +1 -0
- package/build/common/local/localEnvManager.d.ts +16 -0
- package/build/common/local/localEnvManager.d.ts.map +1 -0
- package/build/common/local/localEnvManager.js +72 -0
- package/build/common/local/localEnvManager.js.map +1 -0
- package/build/{plugins/resource/localdebug/localEnvMulti.d.ts → common/local/localEnvProvider.d.ts} +5 -4
- package/build/common/local/localEnvProvider.d.ts.map +1 -0
- package/build/{plugins/resource/localdebug/localEnvMulti.js → common/local/localEnvProvider.js} +19 -15
- package/build/common/local/localEnvProvider.js.map +1 -0
- package/build/common/local/localSettingsHelper.d.ts +3 -0
- package/build/common/local/localSettingsHelper.d.ts.map +1 -0
- package/build/common/local/localSettingsHelper.js +129 -0
- package/build/common/local/localSettingsHelper.js.map +1 -0
- package/build/common/local/npmLogHelper.d.ts +11 -0
- package/build/common/local/npmLogHelper.d.ts.map +1 -0
- package/build/common/local/npmLogHelper.js +82 -0
- package/build/common/local/npmLogHelper.js.map +1 -0
- package/build/common/local/packageJsonHelper.d.ts +4 -0
- package/build/common/local/packageJsonHelper.d.ts.map +1 -0
- package/build/common/local/packageJsonHelper.js +36 -0
- package/build/common/local/packageJsonHelper.js.map +1 -0
- package/build/common/local/portChecker.d.ts +3 -0
- package/build/common/local/portChecker.d.ts.map +1 -0
- package/build/common/local/portChecker.js +104 -0
- package/build/common/local/portChecker.js.map +1 -0
- package/build/common/local/projectSettingsHelper.d.ts +10 -0
- package/build/common/local/projectSettingsHelper.d.ts.map +1 -0
- package/build/common/local/projectSettingsHelper.js +34 -0
- package/build/common/local/projectSettingsHelper.js.map +1 -0
- package/build/common/local/taskDefinition.d.ts +37 -0
- package/build/common/local/taskDefinition.d.ts.map +1 -0
- package/build/common/local/taskDefinition.js +229 -0
- package/build/common/local/taskDefinition.js.map +1 -0
- package/build/common/localSettingsProvider.d.ts +3 -3
- package/build/common/localSettingsProvider.d.ts.map +1 -1
- package/build/common/localSettingsProvider.js +12 -10
- package/build/common/localSettingsProvider.js.map +1 -1
- package/build/common/samples-config.json +14 -0
- package/build/common/templatesActions.d.ts +2 -0
- package/build/common/templatesActions.d.ts.map +1 -1
- package/build/common/templatesActions.js +33 -1
- package/build/common/templatesActions.js.map +1 -1
- package/build/common/tools.d.ts +12 -6
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +35 -85
- package/build/common/tools.js.map +1 -1
- package/build/core/SolutionPluginContainer.d.ts +2 -1
- package/build/core/SolutionPluginContainer.d.ts.map +1 -1
- package/build/core/SolutionPluginContainer.js +9 -1
- package/build/core/SolutionPluginContainer.js.map +1 -1
- package/build/core/dependencyChecker.d.ts +1 -0
- package/build/core/dependencyChecker.d.ts.map +1 -0
- package/build/core/dependencyChecker.js +2 -0
- package/build/core/dependencyChecker.js.map +1 -0
- package/build/core/downloadSample.d.ts +9 -0
- package/build/core/downloadSample.d.ts.map +1 -0
- package/build/core/downloadSample.js +150 -0
- package/build/core/downloadSample.js.map +1 -0
- package/build/core/environment.d.ts +5 -5
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +40 -25
- package/build/core/environment.js.map +1 -1
- package/build/core/error.d.ts +2 -1
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +7 -3
- package/build/core/error.js.map +1 -1
- package/build/core/index.d.ts +53 -15
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +689 -575
- package/build/core/index.js.map +1 -1
- package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
- package/build/core/middleware/concurrentLocker.js +23 -12
- package/build/core/middleware/concurrentLocker.js.map +1 -1
- package/build/core/middleware/envInfoLoader.d.ts +5 -1
- package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
- package/build/core/middleware/envInfoLoader.js +52 -46
- package/build/core/middleware/envInfoLoader.js.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.d.ts +3 -0
- package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -0
- package/build/core/middleware/envInfoLoaderV3.js +64 -0
- package/build/core/middleware/envInfoLoaderV3.js.map +1 -0
- package/build/core/middleware/envInfoWriter.js +14 -31
- package/build/core/middleware/envInfoWriter.js.map +1 -1
- package/build/core/middleware/envInfoWriterV3.d.ts +6 -0
- package/build/core/middleware/envInfoWriterV3.d.ts.map +1 -0
- package/build/core/middleware/envInfoWriterV3.js +63 -0
- package/build/core/middleware/envInfoWriterV3.js.map +1 -0
- package/build/core/middleware/errorHandler.d.ts.map +1 -1
- package/build/core/middleware/errorHandler.js +3 -5
- package/build/core/middleware/errorHandler.js.map +1 -1
- package/build/core/middleware/localSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/localSettingsLoader.js +1 -2
- package/build/core/middleware/localSettingsLoader.js.map +1 -1
- package/build/core/middleware/localSettingsWriter.d.ts.map +1 -1
- package/build/core/middleware/localSettingsWriter.js +7 -18
- package/build/core/middleware/localSettingsWriter.js.map +1 -1
- package/build/core/middleware/projectMigrator.d.ts.map +1 -1
- package/build/core/middleware/projectMigrator.js +25 -57
- package/build/core/middleware/projectMigrator.js.map +1 -1
- package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/projectSettingsLoader.js +3 -6
- package/build/core/middleware/projectSettingsLoader.js.map +1 -1
- package/build/core/middleware/projectSettingsLoaderV3.d.ts +4 -0
- package/build/core/middleware/projectSettingsLoaderV3.d.ts.map +1 -0
- package/build/core/middleware/projectSettingsLoaderV3.js +49 -0
- package/build/core/middleware/projectSettingsLoaderV3.js.map +1 -0
- package/build/core/middleware/projectSettingsWriter.d.ts.map +1 -1
- package/build/core/middleware/projectSettingsWriter.js +5 -12
- package/build/core/middleware/projectSettingsWriter.js.map +1 -1
- package/build/core/middleware/projectUpgrader.d.ts.map +1 -1
- package/build/core/middleware/projectUpgrader.js +7 -15
- package/build/core/middleware/projectUpgrader.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts +14 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +319 -23
- package/build/core/middleware/questionModel.js.map +1 -1
- package/build/core/middleware/solutionLoader.d.ts +3 -2
- package/build/core/middleware/solutionLoader.d.ts.map +1 -1
- package/build/core/middleware/solutionLoader.js +21 -23
- package/build/core/middleware/solutionLoader.js.map +1 -1
- package/build/core/middleware/solutionLoaderV3.d.ts +4 -0
- package/build/core/middleware/solutionLoaderV3.d.ts.map +1 -0
- package/build/core/middleware/solutionLoaderV3.js +19 -0
- package/build/core/middleware/solutionLoaderV3.js.map +1 -0
- package/build/core/question.d.ts +9 -1
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +113 -3
- package/build/core/question.js.map +1 -1
- package/build/core/tools.d.ts +2 -1
- package/build/core/tools.d.ts.map +1 -1
- package/build/core/tools.js +19 -10
- package/build/core/tools.js.map +1 -1
- package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.js +3 -12
- package/build/plugins/resource/aad/plugin.js.map +1 -1
- package/build/plugins/resource/apim/index.js +2 -2
- package/build/plugins/resource/apim/index.js.map +1 -1
- package/build/plugins/resource/apim/managers/apimManager.d.ts +2 -2
- package/build/plugins/resource/apim/managers/apimManager.d.ts.map +1 -1
- package/build/plugins/resource/apim/managers/apimManager.js +26 -20
- package/build/plugins/resource/apim/managers/apimManager.js.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.d.ts +1 -1
- package/build/plugins/resource/appstudio/appStudio.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.js +106 -85
- package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
- package/build/plugins/resource/appstudio/constants.d.ts +7 -1
- package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/constants.js +8 -2
- package/build/plugins/resource/appstudio/constants.js.map +1 -1
- package/build/plugins/resource/appstudio/errors.d.ts +9 -5
- package/build/plugins/resource/appstudio/errors.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/errors.js +10 -5
- package/build/plugins/resource/appstudio/errors.js.map +1 -1
- package/build/plugins/resource/appstudio/index.d.ts +36 -1
- package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/index.js +57 -21
- package/build/plugins/resource/appstudio/index.js.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts +32 -0
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -0
- package/build/plugins/resource/appstudio/manifestTemplate.js +185 -0
- package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -0
- package/build/plugins/resource/appstudio/plugin.d.ts +2 -4
- package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +256 -465
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.js +12 -16
- package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.d.ts +73 -0
- package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -0
- package/build/plugins/resource/appstudio/v3/index.js +87 -0
- package/build/plugins/resource/appstudio/v3/index.js.map +1 -0
- package/build/plugins/resource/bot/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/index.js +5 -1
- package/build/plugins/resource/bot/index.js.map +1 -1
- package/build/plugins/resource/bot/plugin.d.ts +2 -2
- package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.js +30 -24
- package/build/plugins/resource/bot/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/constants.d.ts +1 -7
- package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/constants.js +2 -9
- package/build/plugins/resource/frontend/constants.js.map +1 -1
- package/build/plugins/resource/frontend/env.d.ts +21 -0
- package/build/plugins/resource/frontend/env.d.ts.map +1 -0
- package/build/plugins/resource/frontend/env.js +82 -0
- package/build/plugins/resource/frontend/env.js.map +1 -0
- package/build/plugins/resource/frontend/ops/deploy.d.ts +2 -1
- package/build/plugins/resource/frontend/ops/deploy.d.ts.map +1 -1
- package/build/plugins/resource/frontend/ops/deploy.js +2 -2
- package/build/plugins/resource/frontend/ops/deploy.js.map +1 -1
- package/build/plugins/resource/frontend/plugin.d.ts +2 -0
- package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.js +43 -26
- package/build/plugins/resource/frontend/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/utils/environment-utils.d.ts.map +1 -1
- package/build/plugins/resource/frontend/utils/environment-utils.js +4 -2
- package/build/plugins/resource/frontend/utils/environment-utils.js.map +1 -1
- package/build/plugins/resource/frontend/utils.d.ts +6 -1
- package/build/plugins/resource/frontend/utils.d.ts.map +1 -1
- package/build/plugins/resource/frontend/utils.js +17 -6
- package/build/plugins/resource/frontend/utils.js.map +1 -1
- package/build/plugins/resource/function/plugin.d.ts.map +1 -1
- package/build/plugins/resource/function/plugin.js +26 -21
- package/build/plugins/resource/function/plugin.js.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/checker.d.ts +0 -1
- package/build/plugins/resource/function/utils/depsChecker/checker.d.ts.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/checker.js +2 -2
- package/build/plugins/resource/function/utils/depsChecker/checker.js.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/common.d.ts +2 -2
- package/build/plugins/resource/function/utils/depsChecker/common.d.ts.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/common.js +6 -6
- package/build/plugins/resource/function/utils/depsChecker/common.js.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts +3 -2
- package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.d.ts.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js +3 -2
- package/build/plugins/resource/function/utils/depsChecker/dotnetChecker.js.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts +0 -1
- package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.d.ts.map +1 -1
- package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js +1 -23
- package/build/plugins/resource/function/utils/depsChecker/funcPluginAdapter.js.map +1 -1
- package/build/plugins/resource/identity/index.d.ts.map +1 -1
- package/build/plugins/resource/identity/index.js +21 -17
- package/build/plugins/resource/identity/index.js.map +1 -1
- package/build/plugins/resource/keyvault/plugin.d.ts.map +1 -1
- package/build/plugins/resource/keyvault/plugin.js +17 -14
- package/build/plugins/resource/keyvault/plugin.js.map +1 -1
- package/build/plugins/resource/localdebug/index.d.ts +0 -7
- package/build/plugins/resource/localdebug/index.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/index.js +3 -501
- package/build/plugins/resource/localdebug/index.js.map +1 -1
- package/build/plugins/resource/localdebug/util/error.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/util/error.js +1 -1
- package/build/plugins/resource/localdebug/util/error.js.map +1 -1
- package/build/plugins/resource/localdebug/util/localService.d.ts +0 -1
- package/build/plugins/resource/localdebug/util/localService.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/util/localService.js +1 -40
- package/build/plugins/resource/localdebug/util/localService.js.map +1 -1
- package/build/plugins/resource/localdebug/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/v2/index.js +41 -1
- package/build/plugins/resource/localdebug/v2/index.js.map +1 -1
- package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
- package/build/plugins/resource/simpleauth/plugin.js +26 -21
- package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
- package/build/plugins/resource/simpleauth/utils/common.d.ts.map +1 -1
- package/build/plugins/resource/simpleauth/utils/common.js +3 -1
- package/build/plugins/resource/simpleauth/utils/common.js.map +1 -1
- package/build/plugins/resource/sql/config.d.ts +0 -1
- package/build/plugins/resource/sql/config.d.ts.map +1 -1
- package/build/plugins/resource/sql/config.js +0 -1
- package/build/plugins/resource/sql/config.js.map +1 -1
- package/build/plugins/resource/sql/constants.d.ts +1 -0
- package/build/plugins/resource/sql/constants.d.ts.map +1 -1
- package/build/plugins/resource/sql/constants.js +2 -1
- package/build/plugins/resource/sql/constants.js.map +1 -1
- package/build/plugins/resource/sql/errors.d.ts +3 -1
- package/build/plugins/resource/sql/errors.d.ts.map +1 -1
- package/build/plugins/resource/sql/errors.js +3 -1
- package/build/plugins/resource/sql/errors.js.map +1 -1
- package/build/plugins/resource/sql/managementClient.d.ts +3 -1
- package/build/plugins/resource/sql/managementClient.d.ts.map +1 -1
- package/build/plugins/resource/sql/managementClient.js +11 -20
- package/build/plugins/resource/sql/managementClient.js.map +1 -1
- package/build/plugins/resource/sql/plugin.d.ts +3 -0
- package/build/plugins/resource/sql/plugin.d.ts.map +1 -1
- package/build/plugins/resource/sql/plugin.js +51 -40
- package/build/plugins/resource/sql/plugin.js.map +1 -1
- package/build/plugins/resource/sql/results.d.ts +2 -2
- package/build/plugins/resource/sql/results.d.ts.map +1 -1
- package/build/plugins/resource/sql/results.js +4 -4
- package/build/plugins/resource/sql/results.js.map +1 -1
- package/build/plugins/resource/sql/sqlClient.d.ts +1 -1
- package/build/plugins/resource/sql/sqlClient.d.ts.map +1 -1
- package/build/plugins/resource/sql/sqlClient.js +33 -46
- package/build/plugins/resource/sql/sqlClient.js.map +1 -1
- package/build/plugins/resource/sql/utils/checkInput.js +2 -2
- package/build/plugins/resource/sql/utils/checkInput.js.map +1 -1
- package/build/plugins/resource/sql/utils/message.d.ts +0 -1
- package/build/plugins/resource/sql/utils/message.d.ts.map +1 -1
- package/build/plugins/resource/sql/utils/message.js +0 -1
- package/build/plugins/resource/sql/utils/message.js.map +1 -1
- package/build/plugins/resource/utils4v2.d.ts.map +1 -1
- package/build/plugins/resource/utils4v2.js +0 -4
- package/build/plugins/resource/utils4v2.js.map +1 -1
- package/build/plugins/solution/fx-solution/arm.d.ts +18 -11
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +390 -131
- package/build/plugins/solution/fx-solution/arm.js.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts +13 -2
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js +24 -26
- package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/constants.d.ts +10 -0
- package/build/plugins/solution/fx-solution/debug/constants.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/constants.js +17 -0
- package/build/plugins/solution/fx-solution/debug/constants.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/error.d.ts +9 -0
- package/build/plugins/solution/fx-solution/debug/error.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/error.js +36 -0
- package/build/plugins/solution/fx-solution/debug/error.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts +4 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js +233 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts +5 -0
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/scaffolding.js +164 -0
- package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/certificate.d.ts +2 -2
- package/build/plugins/solution/fx-solution/debug/util/certificate.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/certificate.js +8 -9
- package/build/plugins/solution/fx-solution/debug/util/certificate.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/codespace.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/codespace.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/codespace.js +0 -0
- package/build/plugins/solution/fx-solution/debug/util/codespace.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/launch.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/launch.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/launch.js +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launch.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/util/localService.d.ts +3 -0
- package/build/plugins/solution/fx-solution/debug/util/localService.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/util/localService.js +52 -0
- package/build/plugins/solution/fx-solution/debug/util/localService.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/ngrok.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/ngrok.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/ngrok.js +2 -2
- package/build/plugins/solution/fx-solution/debug/util/ngrok.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/process.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/process.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/process.js +0 -0
- package/build/plugins/solution/fx-solution/debug/util/process.js.map +1 -0
- package/build/plugins/solution/fx-solution/debug/util/settings.d.ts +2 -0
- package/build/plugins/solution/fx-solution/debug/util/settings.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/debug/util/settings.js +22 -0
- package/build/plugins/solution/fx-solution/debug/util/settings.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/tasks.d.ts +0 -0
- package/build/plugins/solution/fx-solution/debug/util/tasks.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug/util}/tasks.js +11 -11
- package/build/plugins/solution/fx-solution/debug/util/tasks.js.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/telemetry.d.ts +7 -6
- package/build/plugins/solution/fx-solution/debug/util/telemetry.d.ts.map +1 -0
- package/build/plugins/{resource/localdebug → solution/fx-solution/debug}/util/telemetry.js +16 -19
- package/build/plugins/solution/fx-solution/debug/util/telemetry.js.map +1 -0
- package/build/plugins/solution/fx-solution/index.d.ts +1 -0
- package/build/plugins/solution/fx-solution/index.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/index.js +1 -0
- package/build/plugins/solution/fx-solution/index.js.map +1 -1
- package/build/plugins/solution/fx-solution/question.d.ts +2 -2
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +2 -32
- package/build/plugins/solution/fx-solution/question.js.map +1 -1
- package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/solution.js +14 -5
- package/build/plugins/solution/fx-solution/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.d.ts +2 -2
- package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.js +13 -14
- package/build/plugins/solution/fx-solution/utils/depsChecker/bicepChecker.js.map +1 -1
- package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts +2 -2
- package/build/plugins/solution/fx-solution/utils/progressHelper.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/utils/progressHelper.js +4 -4
- package/build/plugins/solution/fx-solution/utils/progressHelper.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/constants.d.ts +2 -0
- package/build/plugins/solution/fx-solution/v2/constants.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v2/constants.js +7 -0
- package/build/plugins/solution/fx-solution/v2/constants.js.map +1 -0
- package/build/plugins/solution/fx-solution/v2/createEnv.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/createEnv.js +1 -1
- package/build/plugins/solution/fx-solution/v2/createEnv.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/deploy.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/deploy.js +3 -0
- package/build/plugins/solution/fx-solution/v2/deploy.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js +7 -4
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.js +67 -25
- package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provision.js +9 -1
- package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js +12 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.js +5 -0
- package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/solution.js +2 -1
- package/build/plugins/solution/fx-solution/v2/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addModule.d.ts +6 -0
- package/build/plugins/solution/fx-solution/v3/addModule.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/addModule.js +35 -0
- package/build/plugins/solution/fx-solution/v3/addModule.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/addResource.d.ts +37 -0
- package/build/plugins/solution/fx-solution/v3/addResource.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/addResource.js +261 -0
- package/build/plugins/solution/fx-solution/v3/addResource.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/constants.d.ts +20 -0
- package/build/plugins/solution/fx-solution/v3/constants.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/constants.js +25 -0
- package/build/plugins/solution/fx-solution/v3/constants.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/deploy.d.ts +6 -0
- package/build/plugins/solution/fx-solution/v3/deploy.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/deploy.js +78 -0
- package/build/plugins/solution/fx-solution/v3/deploy.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/error.d.ts +8 -0
- package/build/plugins/solution/fx-solution/v3/error.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/error.js +17 -0
- package/build/plugins/solution/fx-solution/v3/error.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/init.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/init.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/init.js +35 -0
- package/build/plugins/solution/fx-solution/v3/init.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/provision.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/provision.js +124 -0
- package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/provisionLocal.js +13 -0
- package/build/plugins/solution/fx-solution/v3/provisionLocal.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/publish.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/publish.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/publish.js +15 -0
- package/build/plugins/solution/fx-solution/v3/publish.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/scaffold.d.ts +27 -0
- package/build/plugins/solution/fx-solution/v3/scaffold.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/scaffold.js +241 -0
- package/build/plugins/solution/fx-solution/v3/scaffold.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/solution.d.ts +32 -0
- package/build/plugins/solution/fx-solution/v3/solution.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/solution.js +45 -0
- package/build/plugins/solution/fx-solution/v3/solution.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/userTask.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v3/userTask.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/userTask.js +15 -0
- package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -0
- package/build/plugins/solution/fx-solution/v3/utils.d.ts +3 -0
- package/build/plugins/solution/fx-solution/v3/utils.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/utils.js +16 -0
- package/build/plugins/solution/fx-solution/v3/utils.js.map +1 -0
- package/build/plugins/solution/index.d.ts +1 -0
- package/build/plugins/solution/index.d.ts.map +1 -1
- package/build/plugins/solution/index.js +1 -0
- package/build/plugins/solution/index.js.map +1 -1
- package/build/plugins/solution/spfx-solution/addModule.d.ts +5 -0
- package/build/plugins/solution/spfx-solution/addModule.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/addModule.js +29 -0
- package/build/plugins/solution/spfx-solution/addModule.js.map +1 -0
- package/build/plugins/solution/spfx-solution/constants.d.ts +2 -0
- package/build/plugins/solution/spfx-solution/constants.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/constants.js +7 -0
- package/build/plugins/solution/spfx-solution/constants.js.map +1 -0
- package/build/plugins/solution/spfx-solution/error.d.ts +5 -0
- package/build/plugins/solution/spfx-solution/error.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/error.js +13 -0
- package/build/plugins/solution/spfx-solution/error.js.map +1 -0
- package/build/plugins/solution/spfx-solution/index.d.ts +2 -0
- package/build/plugins/solution/spfx-solution/index.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/index.js +7 -0
- package/build/plugins/solution/spfx-solution/index.js.map +1 -0
- package/build/plugins/solution/spfx-solution/init.d.ts +4 -0
- package/build/plugins/solution/spfx-solution/init.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/init.js +52 -0
- package/build/plugins/solution/spfx-solution/init.js.map +1 -0
- package/build/plugins/solution/spfx-solution/questions.d.ts +4 -0
- package/build/plugins/solution/spfx-solution/questions.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/questions.js +10 -0
- package/build/plugins/solution/spfx-solution/questions.js.map +1 -0
- package/build/plugins/solution/spfx-solution/scaffold.d.ts +13 -0
- package/build/plugins/solution/spfx-solution/scaffold.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/scaffold.js +105 -0
- package/build/plugins/solution/spfx-solution/scaffold.js.map +1 -0
- package/build/plugins/solution/spfx-solution/solution.d.ts +22 -0
- package/build/plugins/solution/spfx-solution/solution.d.ts.map +1 -0
- package/build/plugins/solution/spfx-solution/solution.js +31 -0
- package/build/plugins/solution/spfx-solution/solution.js.map +1 -0
- package/build/plugins/solution/utils/error.d.ts +5 -0
- package/build/plugins/solution/utils/error.d.ts.map +1 -0
- package/build/plugins/solution/utils/error.js +13 -0
- package/build/plugins/solution/utils/error.js.map +1 -0
- package/build/plugins/solution/utils/questions.d.ts +16 -0
- package/build/plugins/solution/utils/questions.d.ts.map +1 -0
- package/build/plugins/solution/utils/questions.js +86 -0
- package/build/plugins/solution/utils/questions.js.map +1 -0
- package/package.json +20 -5
- package/resource/deps-checker/dotnet-install.ps1 +1095 -0
- package/resource/deps-checker/dotnet-install.sh +1222 -0
- package/resource/strings.json +1 -2
- package/templates/plugins/resource/apim/bicep/apimConfiguration.bicep +16 -16
- package/templates/plugins/resource/apim/bicep/config.template.bicep +1 -1
- package/templates/plugins/resource/apim/bicep/provision.template.bicep +1 -1
- package/templates/plugins/resource/bot/bicep/botConfiguration.template.bicep +24 -29
- package/templates/plugins/resource/bot/bicep/config.template.bicep +1 -1
- package/templates/plugins/resource/bot/bicep/provision.template.bicep +2 -2
- package/templates/plugins/resource/frontend/bicep/provision.template.bicep +1 -1
- package/templates/plugins/resource/function/bicep/config.template.bicep +1 -1
- package/templates/plugins/resource/function/bicep/functionConfiguration.template.bicep +33 -31
- package/templates/plugins/resource/function/bicep/provision.template.bicep +2 -2
- package/templates/plugins/resource/identity/bicep/provision.template.bicep +1 -1
- package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +1 -0
- package/templates/plugins/resource/keyvault/bicep/provision.template.bicep +4 -2
- package/templates/plugins/resource/simpleauth/bicep/config.template.bicep +1 -1
- package/templates/plugins/resource/simpleauth/bicep/provision.template.bicep +2 -2
- package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +20 -24
- package/templates/plugins/resource/simpleauth/version.txt +2 -1
- package/templates/plugins/resource/sql/bicep/provision.template.bicep +1 -1
- package/build/plugins/resource/localdebug/certificate.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/certificate.js.map +0 -1
- package/build/plugins/resource/localdebug/launch.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/launch.js.map +0 -1
- package/build/plugins/resource/localdebug/legacyPlugin.d.ts +0 -6
- package/build/plugins/resource/localdebug/legacyPlugin.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/legacyPlugin.js +0 -208
- package/build/plugins/resource/localdebug/legacyPlugin.js.map +0 -1
- package/build/plugins/resource/localdebug/localEnvMulti.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/localEnvMulti.js.map +0 -1
- package/build/plugins/resource/localdebug/settings.d.ts +0 -2
- package/build/plugins/resource/localdebug/settings.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/settings.js +0 -18
- package/build/plugins/resource/localdebug/settings.js.map +0 -1
- package/build/plugins/resource/localdebug/tasks.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/tasks.js.map +0 -1
- package/build/plugins/resource/localdebug/util/codespace.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/util/codespace.js.map +0 -1
- package/build/plugins/resource/localdebug/util/ngrok.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/util/ngrok.js.map +0 -1
- package/build/plugins/resource/localdebug/util/process.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/util/process.js.map +0 -1
- package/build/plugins/resource/localdebug/util/telemetry.d.ts.map +0 -1
- package/build/plugins/resource/localdebug/util/telemetry.js.map +0 -1
- package/templates/azure/config.bicep +0 -25
- package/templates/azure/main.bicep +0 -20
- package/templates/azure/provision/azureSql.bicep +0 -39
- package/templates/azure/provision/frontendHosting.bicep +0 -23
- package/templates/azure/provision/function.bicep +0 -79
- package/templates/azure/provision/simpleAuth.bicep +0 -44
- package/templates/azure/provision.bicep +0 -58
- package/templates/azure/teamsFx/bot.bicep +0 -34
- package/templates/azure/teamsFx/function.bicep +0 -71
- package/templates/azure/teamsFx/simpleAuth.bicep +0 -40
- package/templates/plugins/resource/aad/bicep/param.template.bicep +0 -6
- package/templates/plugins/resource/aad/bicep/variables.template.bicep +0 -13
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.formattedDeploymentError = exports.ArmTemplateRenderContext = exports.getParameterJson = exports.copyParameterJson = exports.deployArmTemplates = exports.doDeployArmTemplates = exports.pollDeploymentStatus = exports.getRequiredOperation = exports.generateArmTemplate = void 0;
|
|
5
|
+
exports.formattedDeploymentError = exports.ArmTemplateRenderContext = exports.getParameterJsonV3 = exports.getParameterJson = exports.copyParameterJson = exports.deployArmTemplatesV3 = exports.deployArmTemplates = exports.doDeployArmTemplatesV3 = exports.doDeployArmTemplates = exports.pollDeploymentStatus = exports.getRequiredOperation = exports.generateArmTemplateV3 = exports.generateArmTemplate = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
|
+
const arm_resources_1 = require("@azure/arm-resources");
|
|
7
8
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
8
|
-
const ResourcePluginContainer_1 = require("./ResourcePluginContainer");
|
|
9
|
-
const util_1 = require("./utils/util");
|
|
10
|
-
const util_2 = require("util");
|
|
11
|
-
const common_1 = require("../../../common");
|
|
12
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
13
9
|
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
14
|
-
const
|
|
10
|
+
const os_1 = tslib_1.__importDefault(require("os"));
|
|
11
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
|
+
const typedi_1 = require("typedi");
|
|
13
|
+
const util_1 = require("util");
|
|
14
|
+
const constants_1 = require("./constants");
|
|
15
|
+
const environment_1 = require("../../../core/environment");
|
|
16
|
+
const common_1 = require("../../../common");
|
|
17
|
+
const constants_2 = require("../../../common/constants");
|
|
18
|
+
const cpUtils_1 = require("../../../common/cpUtils");
|
|
15
19
|
const tools_1 = require("../../../common/tools");
|
|
16
|
-
const __1 = require("../../..");
|
|
17
|
-
const constants_2 = require("./constants");
|
|
18
|
-
const arm_resources_1 = require("@azure/arm-resources");
|
|
19
|
-
const progressHelper_1 = require("./utils/progressHelper");
|
|
20
20
|
const folder_1 = require("../../../folder");
|
|
21
|
+
const ResourcePluginContainer_1 = require("./ResourcePluginContainer");
|
|
21
22
|
const bicepChecker_1 = require("./utils/depsChecker/bicepChecker");
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const os_1 = tslib_1.__importDefault(require("os"));
|
|
23
|
+
const progressHelper_1 = require("./utils/progressHelper");
|
|
24
|
+
const util_2 = require("./utils/util");
|
|
25
25
|
const adaptor_1 = require("./v2/adaptor");
|
|
26
26
|
const bicepOrchestrationFileName = "main.bicep";
|
|
27
27
|
const bicepOrchestrationProvisionFileName = "provision.bicep";
|
|
@@ -38,28 +38,53 @@ const InvalidTemplateErrorCode = "InvalidTemplate";
|
|
|
38
38
|
async function generateArmTemplate(ctx, selectedPlugins = []) {
|
|
39
39
|
var _a, _b;
|
|
40
40
|
let result;
|
|
41
|
-
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(
|
|
42
|
-
[
|
|
41
|
+
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GenerateArmTemplateStart, {
|
|
42
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
43
43
|
});
|
|
44
44
|
try {
|
|
45
45
|
result = await doGenerateArmTemplate(ctx, selectedPlugins);
|
|
46
46
|
if (result.isOk()) {
|
|
47
|
-
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(
|
|
48
|
-
[
|
|
49
|
-
[
|
|
47
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, {
|
|
48
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
49
|
+
[constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
|
|
53
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, result.error, ctx.telemetryReporter);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
catch (error) {
|
|
57
|
-
result = teamsfx_api_1.err(teamsfx_api_1.returnSystemError(error,
|
|
58
|
-
|
|
57
|
+
result = teamsfx_api_1.err(teamsfx_api_1.returnSystemError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToGenerateArmTemplates));
|
|
58
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, result.error, ctx.telemetryReporter);
|
|
59
59
|
}
|
|
60
60
|
return result;
|
|
61
61
|
}
|
|
62
62
|
exports.generateArmTemplate = generateArmTemplate;
|
|
63
|
+
async function generateArmTemplateV3(ctx, inputs, activatedPlugins, addedPlugins) {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
let result;
|
|
66
|
+
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GenerateArmTemplateStart, {
|
|
67
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
68
|
+
});
|
|
69
|
+
try {
|
|
70
|
+
result = await doGenerateArmTemplateV3(ctx, inputs, activatedPlugins, addedPlugins);
|
|
71
|
+
if (result.isOk()) {
|
|
72
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, {
|
|
73
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
74
|
+
[constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, result.error, ctx.telemetryReporter);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
result = teamsfx_api_1.err(teamsfx_api_1.returnSystemError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToGenerateArmTemplates));
|
|
83
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, result.error, ctx.telemetryReporter);
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
exports.generateArmTemplateV3 = generateArmTemplateV3;
|
|
63
88
|
function getRequiredOperation(operation, deployCtx) {
|
|
64
89
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
65
90
|
if (((_b = (_a = operation.properties) === null || _a === void 0 ? void 0 : _a.targetResource) === null || _b === void 0 ? void 0 : _b.resourceName) &&
|
|
@@ -92,7 +117,7 @@ async function pollDeploymentStatus(deployCtx) {
|
|
|
92
117
|
let tryCount = 0;
|
|
93
118
|
let previousStatus = {};
|
|
94
119
|
let polledOperations = [];
|
|
95
|
-
(_a = deployCtx.
|
|
120
|
+
(_a = deployCtx.logProvider) === null || _a === void 0 ? void 0 : _a.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.PollDeploymentStatusNotice, constants_2.PluginDisplayName.Solution));
|
|
96
121
|
while (!deployCtx.finished) {
|
|
97
122
|
await tools_1.waitSeconds(10);
|
|
98
123
|
try {
|
|
@@ -110,7 +135,7 @@ async function pollDeploymentStatus(deployCtx) {
|
|
|
110
135
|
polledOperations.push(operation.resourceName);
|
|
111
136
|
let client = deployCtx.client;
|
|
112
137
|
if (operation.subscriptionId !== deployCtx.client.subscriptionId) {
|
|
113
|
-
const azureToken = await ((_a = deployCtx.
|
|
138
|
+
const azureToken = await ((_a = deployCtx.azureAccountProvider) === null || _a === void 0 ? void 0 : _a.getAccountCredentialAsync());
|
|
114
139
|
client = new arm_resources_1.ResourceManagementClient(azureToken, operation.subscriptionId);
|
|
115
140
|
}
|
|
116
141
|
const subOperations = await client.deploymentOperations.list(operation.resourceGroupName, operation.resourceName);
|
|
@@ -125,7 +150,7 @@ async function pollDeploymentStatus(deployCtx) {
|
|
|
125
150
|
}));
|
|
126
151
|
for (const key in currentStatus) {
|
|
127
152
|
if (currentStatus[key] !== previousStatus[key]) {
|
|
128
|
-
(_b = deployCtx.
|
|
153
|
+
(_b = deployCtx.logProvider) === null || _b === void 0 ? void 0 : _b.info(`[${constants_2.PluginDisplayName.Solution}] ${key} -> ${currentStatus[key]}`);
|
|
129
154
|
}
|
|
130
155
|
}
|
|
131
156
|
previousStatus = currentStatus;
|
|
@@ -136,30 +161,31 @@ async function pollDeploymentStatus(deployCtx) {
|
|
|
136
161
|
if (tryCount > failedCount) {
|
|
137
162
|
throw error;
|
|
138
163
|
}
|
|
139
|
-
(_c = deployCtx.
|
|
164
|
+
(_c = deployCtx.logProvider) === null || _c === void 0 ? void 0 : _c.warning(`[${constants_2.PluginDisplayName.Solution}] ${deployCtx.deploymentName} -> waiting to get deplomyment status [${tryCount}]`);
|
|
140
165
|
}
|
|
141
166
|
}
|
|
142
167
|
}
|
|
143
168
|
exports.pollDeploymentStatus = pollDeploymentStatus;
|
|
144
169
|
async function doDeployArmTemplates(ctx) {
|
|
145
170
|
var _a, _b, _c;
|
|
146
|
-
const progressHandler = await progressHelper_1.ProgressHelper.startDeployArmTemplatesProgressHandler(
|
|
171
|
+
const progressHandler = await progressHelper_1.ProgressHelper.startDeployArmTemplatesProgressHandler(ctx.ui);
|
|
147
172
|
await (progressHandler === null || progressHandler === void 0 ? void 0 : progressHandler.next(progressHelper_1.DeployArmTemplatesSteps.ExecuteDeployment));
|
|
148
173
|
// update parameters
|
|
149
174
|
const parameterJson = await getParameterJson(ctx);
|
|
150
|
-
const resourceGroupName = (_a = ctx.envInfo.state.get(
|
|
175
|
+
const resourceGroupName = (_a = ctx.envInfo.state.get(constants_1.GLOBAL_CONFIG)) === null || _a === void 0 ? void 0 : _a.getString(constants_1.RESOURCE_GROUP_NAME);
|
|
151
176
|
if (!resourceGroupName) {
|
|
152
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnSystemError(new Error("Failed to get resource group from project solution settings."),
|
|
177
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnSystemError(new Error("Failed to get resource group from project solution settings."), constants_1.SolutionSource, "NoResourceGroupFound"));
|
|
153
178
|
}
|
|
154
|
-
const bicepCommand = await bicepChecker_1.ensureBicep(ctx);
|
|
179
|
+
const bicepCommand = await bicepChecker_1.ensureBicep(ctx, ctx.answers);
|
|
155
180
|
// Compile bicep file to json
|
|
156
181
|
const templateDir = path_1.default.join(ctx.root, templatesFolder);
|
|
157
182
|
const bicepOrchestrationFilePath = path_1.default.join(templateDir, bicepOrchestrationFileName);
|
|
158
183
|
const armTemplateJson = await compileBicepToJson(bicepCommand, bicepOrchestrationFilePath, ctx.logProvider);
|
|
159
|
-
(_b = ctx.logProvider) === null || _b === void 0 ? void 0 : _b.info(
|
|
184
|
+
(_b = ctx.logProvider) === null || _b === void 0 ? void 0 : _b.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.CompileBicepSuccessNotice, constants_2.PluginDisplayName.Solution));
|
|
160
185
|
// deploy arm templates to azure
|
|
161
|
-
const
|
|
162
|
-
const
|
|
186
|
+
const subscriptionId = (_c = ctx.envInfo.state.get(constants_1.GLOBAL_CONFIG)) === null || _c === void 0 ? void 0 : _c.get(constants_1.SUBSCRIPTION_ID);
|
|
187
|
+
const client = await getResourceManagementClientForArmDeployment(ctx.azureAccountProvider, subscriptionId);
|
|
188
|
+
const deploymentName = `${constants_2.PluginDisplayName.Solution}_deployment`.replace(" ", "_").toLowerCase();
|
|
163
189
|
const deploymentParameters = {
|
|
164
190
|
properties: {
|
|
165
191
|
parameters: parameterJson.parameters,
|
|
@@ -168,7 +194,8 @@ async function doDeployArmTemplates(ctx) {
|
|
|
168
194
|
},
|
|
169
195
|
};
|
|
170
196
|
const deployCtx = {
|
|
171
|
-
|
|
197
|
+
azureAccountProvider: ctx.azureAccountProvider,
|
|
198
|
+
logProvider: ctx.logProvider,
|
|
172
199
|
finished: false,
|
|
173
200
|
deploymentStartTime: Date.now(),
|
|
174
201
|
client: client,
|
|
@@ -180,8 +207,8 @@ async function doDeployArmTemplates(ctx) {
|
|
|
180
207
|
.createOrUpdate(resourceGroupName, deploymentName, deploymentParameters)
|
|
181
208
|
.then((result) => {
|
|
182
209
|
var _a, _b;
|
|
183
|
-
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(
|
|
184
|
-
syncArmOutput(ctx, (_b = result.properties) === null || _b === void 0 ? void 0 : _b.outputs);
|
|
210
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.SuccessNotice, constants_2.PluginDisplayName.Solution, resourceGroupName, deploymentName));
|
|
211
|
+
syncArmOutput(ctx.envInfo, (_b = result.properties) === null || _b === void 0 ? void 0 : _b.outputs);
|
|
185
212
|
return result;
|
|
186
213
|
})
|
|
187
214
|
.finally(() => {
|
|
@@ -194,7 +221,7 @@ async function doDeployArmTemplates(ctx) {
|
|
|
194
221
|
catch (error) {
|
|
195
222
|
// return the error if the template is invalid
|
|
196
223
|
if (error.code === InvalidTemplateErrorCode) {
|
|
197
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error,
|
|
224
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToValidateArmTemplates));
|
|
198
225
|
}
|
|
199
226
|
// try to get deployment error
|
|
200
227
|
const result = await wrapGetDeploymentError(deployCtx, resourceGroupName, deploymentName);
|
|
@@ -202,21 +229,14 @@ async function doDeployArmTemplates(ctx) {
|
|
|
202
229
|
const deploymentError = result.value;
|
|
203
230
|
// return thrown error if deploymentError is empty
|
|
204
231
|
if (!deploymentError) {
|
|
205
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error,
|
|
232
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure));
|
|
206
233
|
}
|
|
207
234
|
const deploymentErrorObj = formattedDeploymentError(deploymentError);
|
|
208
235
|
const deploymentErrorMessage = JSON.stringify(deploymentErrorObj, undefined, 2);
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (deploymentError.subErrors) {
|
|
214
|
-
failedDeployments = Object.keys(deploymentError.subErrors);
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
failedDeployments.push(deploymentName);
|
|
218
|
-
}
|
|
219
|
-
const returnError = formattedDeploymentName(failedDeployments);
|
|
236
|
+
let errorMessage = util_1.format(common_1.getStrings().solution.DeployArmTemplates.FailNotice, constants_2.PluginDisplayName.Solution, resourceGroupName, deploymentName);
|
|
237
|
+
errorMessage += `\nError message: ${error.message}\nDetailed message: \n${deploymentErrorMessage}\nGet toolkit help from ${constants_2.HelpLinks.ArmHelpLink}.`;
|
|
238
|
+
const notificationMessage = getNotificationMessage(deploymentError, deploymentName);
|
|
239
|
+
const returnError = new teamsfx_api_1.UserError(new Error(errorMessage), constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure, constants_2.HelpLinks.ArmHelpLink, notificationMessage);
|
|
220
240
|
returnError.innerError = JSON.stringify(deploymentErrorObj);
|
|
221
241
|
return teamsfx_api_1.err(returnError);
|
|
222
242
|
}
|
|
@@ -226,7 +246,87 @@ async function doDeployArmTemplates(ctx) {
|
|
|
226
246
|
}
|
|
227
247
|
}
|
|
228
248
|
exports.doDeployArmTemplates = doDeployArmTemplates;
|
|
229
|
-
function
|
|
249
|
+
async function doDeployArmTemplatesV3(ctx, inputs, envInfo, azureAccountProvider) {
|
|
250
|
+
var _a;
|
|
251
|
+
const progressHandler = await progressHelper_1.ProgressHelper.startDeployArmTemplatesProgressHandler(ctx.userInteraction);
|
|
252
|
+
await (progressHandler === null || progressHandler === void 0 ? void 0 : progressHandler.next(progressHelper_1.DeployArmTemplatesSteps.ExecuteDeployment));
|
|
253
|
+
// update parameters
|
|
254
|
+
const parameterJson = await getParameterJsonV3(ctx, inputs.projectPath, envInfo);
|
|
255
|
+
const envState = envInfo.state;
|
|
256
|
+
const resourceGroupName = envState.solution.resourceGroupName;
|
|
257
|
+
if (!resourceGroupName) {
|
|
258
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnSystemError(new Error("Failed to get resource group from project solution settings."), constants_1.SolutionSource, "NoResourceGroupFound"));
|
|
259
|
+
}
|
|
260
|
+
const bicepCommand = await bicepChecker_1.ensureBicep(ctx, inputs);
|
|
261
|
+
// Compile bicep file to json
|
|
262
|
+
const templateDir = path_1.default.join(inputs.projectPath, templatesFolder);
|
|
263
|
+
const bicepOrchestrationFilePath = path_1.default.join(templateDir, bicepOrchestrationFileName);
|
|
264
|
+
const armTemplateJson = await compileBicepToJson(bicepCommand, bicepOrchestrationFilePath, ctx.logProvider);
|
|
265
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.CompileBicepSuccessNotice, constants_2.PluginDisplayName.Solution));
|
|
266
|
+
// deploy arm templates to azure
|
|
267
|
+
const client = await getResourceManagementClientForArmDeployment(azureAccountProvider, envState.solution.subscriptionId);
|
|
268
|
+
const deploymentName = `${constants_2.PluginDisplayName.Solution}_deployment`.replace(" ", "_").toLowerCase();
|
|
269
|
+
const deploymentParameters = {
|
|
270
|
+
properties: {
|
|
271
|
+
parameters: parameterJson.parameters,
|
|
272
|
+
template: armTemplateJson,
|
|
273
|
+
mode: "Incremental",
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
const deployCtx = {
|
|
277
|
+
azureAccountProvider: azureAccountProvider,
|
|
278
|
+
logProvider: ctx.logProvider,
|
|
279
|
+
finished: false,
|
|
280
|
+
deploymentStartTime: Date.now(),
|
|
281
|
+
client: client,
|
|
282
|
+
resourceGroupName: resourceGroupName,
|
|
283
|
+
deploymentName: deploymentName,
|
|
284
|
+
};
|
|
285
|
+
try {
|
|
286
|
+
const result = client.deployments
|
|
287
|
+
.createOrUpdate(resourceGroupName, deploymentName, deploymentParameters)
|
|
288
|
+
.then((result) => {
|
|
289
|
+
var _a, _b;
|
|
290
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.SuccessNotice, constants_2.PluginDisplayName.Solution, resourceGroupName, deploymentName));
|
|
291
|
+
syncArmOutput(envInfo, (_b = result.properties) === null || _b === void 0 ? void 0 : _b.outputs);
|
|
292
|
+
return result;
|
|
293
|
+
})
|
|
294
|
+
.finally(() => {
|
|
295
|
+
deployCtx.finished = true;
|
|
296
|
+
});
|
|
297
|
+
await pollDeploymentStatus(deployCtx);
|
|
298
|
+
await result;
|
|
299
|
+
return teamsfx_api_1.ok(undefined);
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
// return the error if the template is invalid
|
|
303
|
+
if (error.code === InvalidTemplateErrorCode) {
|
|
304
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToValidateArmTemplates));
|
|
305
|
+
}
|
|
306
|
+
// try to get deployment error
|
|
307
|
+
const result = await wrapGetDeploymentError(deployCtx, resourceGroupName, deploymentName);
|
|
308
|
+
if (result.isOk()) {
|
|
309
|
+
const deploymentError = result.value;
|
|
310
|
+
// return thrown error if deploymentError is empty
|
|
311
|
+
if (!deploymentError) {
|
|
312
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure));
|
|
313
|
+
}
|
|
314
|
+
const deploymentErrorObj = formattedDeploymentError(deploymentError);
|
|
315
|
+
const deploymentErrorMessage = JSON.stringify(deploymentErrorObj, undefined, 2);
|
|
316
|
+
let errorMessage = util_1.format(common_1.getStrings().solution.DeployArmTemplates.FailNotice, constants_2.PluginDisplayName.Solution, resourceGroupName, deploymentName);
|
|
317
|
+
errorMessage += `\nError message: ${error.message}\nDetailed message: \n${deploymentErrorMessage}\nGet toolkit help from ${constants_2.HelpLinks.ArmHelpLink}.`;
|
|
318
|
+
const notificationMessage = getNotificationMessage(deploymentError, deploymentName);
|
|
319
|
+
const returnError = new teamsfx_api_1.UserError(new Error(errorMessage), constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure, constants_2.HelpLinks.ArmHelpLink, notificationMessage);
|
|
320
|
+
returnError.innerError = JSON.stringify(deploymentErrorObj);
|
|
321
|
+
return teamsfx_api_1.err(returnError);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
return result;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
exports.doDeployArmTemplatesV3 = doDeployArmTemplatesV3;
|
|
329
|
+
function syncArmOutput(envInfo, armOutput) {
|
|
230
330
|
var _a;
|
|
231
331
|
if (armOutput instanceof Object) {
|
|
232
332
|
const armOutputKeys = Object.keys(armOutput);
|
|
@@ -237,13 +337,19 @@ function syncArmOutput(ctx, armOutput) {
|
|
|
237
337
|
for (const moduleOutputKey of moduleOutputKeys) {
|
|
238
338
|
const pluginOutput = moduleOutput[moduleOutputKey].value;
|
|
239
339
|
if (pluginOutput instanceof Object) {
|
|
240
|
-
const pluginId = pluginOutput[
|
|
340
|
+
const pluginId = pluginOutput[constants_1.TEAMS_FX_RESOURCE_ID_KEY];
|
|
241
341
|
if (pluginId) {
|
|
242
342
|
const pluginOutputKeys = Object.keys(pluginOutput);
|
|
243
343
|
for (const pluginOutputKey of pluginOutputKeys) {
|
|
244
|
-
if (pluginOutputKey !=
|
|
245
|
-
(
|
|
246
|
-
|
|
344
|
+
if (pluginOutputKey != constants_1.TEAMS_FX_RESOURCE_ID_KEY) {
|
|
345
|
+
if (envInfo.state instanceof Map) {
|
|
346
|
+
(_a = envInfo.state
|
|
347
|
+
.get(pluginId)) === null || _a === void 0 ? void 0 : _a.set(pluginOutputKey, pluginOutput[pluginOutputKey]);
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
envInfo.state[pluginId][pluginOutputKey] =
|
|
351
|
+
pluginOutput[pluginOutputKey];
|
|
352
|
+
}
|
|
247
353
|
}
|
|
248
354
|
}
|
|
249
355
|
}
|
|
@@ -255,58 +361,88 @@ function syncArmOutput(ctx, armOutput) {
|
|
|
255
361
|
}
|
|
256
362
|
async function deployArmTemplates(ctx) {
|
|
257
363
|
var _a, _b, _c;
|
|
258
|
-
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(
|
|
364
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.StartNotice, constants_2.PluginDisplayName.Solution));
|
|
259
365
|
let result;
|
|
260
|
-
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(
|
|
261
|
-
[
|
|
366
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ArmDeploymentStart, {
|
|
367
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
262
368
|
});
|
|
263
369
|
try {
|
|
264
370
|
result = await doDeployArmTemplates(ctx);
|
|
265
371
|
if (result.isOk()) {
|
|
266
|
-
(_c = ctx.telemetryReporter) === null || _c === void 0 ? void 0 : _c.sendTelemetryEvent(
|
|
267
|
-
[
|
|
268
|
-
[
|
|
372
|
+
(_c = ctx.telemetryReporter) === null || _c === void 0 ? void 0 : _c.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ArmDeployment, {
|
|
373
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
374
|
+
[constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
|
|
269
375
|
});
|
|
270
376
|
}
|
|
271
377
|
else {
|
|
272
378
|
const errorProperties = {};
|
|
273
379
|
if (result.error.innerError) {
|
|
274
|
-
errorProperties[
|
|
380
|
+
errorProperties[constants_1.SolutionTelemetryProperty.ArmDeploymentError] = result.error.innerError;
|
|
275
381
|
}
|
|
276
|
-
|
|
382
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ArmDeployment, result.error, ctx.telemetryReporter, errorProperties);
|
|
277
383
|
}
|
|
278
384
|
}
|
|
279
385
|
catch (error) {
|
|
280
|
-
result = teamsfx_api_1.err(teamsfx_api_1.returnUserError(error,
|
|
281
|
-
|
|
386
|
+
result = teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure));
|
|
387
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ArmDeployment, result.error, ctx.telemetryReporter);
|
|
282
388
|
}
|
|
283
389
|
await progressHelper_1.ProgressHelper.endDeployArmTemplatesProgress(result.isOk());
|
|
284
390
|
return result;
|
|
285
391
|
}
|
|
286
392
|
exports.deployArmTemplates = deployArmTemplates;
|
|
287
|
-
async function
|
|
393
|
+
async function deployArmTemplatesV3(ctx, inputs, envInfo, azureAccountProvider) {
|
|
394
|
+
var _a, _b, _c;
|
|
395
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.StartNotice, constants_2.PluginDisplayName.Solution));
|
|
396
|
+
let result;
|
|
397
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ArmDeploymentStart, {
|
|
398
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
399
|
+
});
|
|
400
|
+
try {
|
|
401
|
+
result = await doDeployArmTemplatesV3(ctx, inputs, envInfo, azureAccountProvider);
|
|
402
|
+
if (result.isOk()) {
|
|
403
|
+
(_c = ctx.telemetryReporter) === null || _c === void 0 ? void 0 : _c.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ArmDeployment, {
|
|
404
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
405
|
+
[constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
const errorProperties = {};
|
|
410
|
+
if (result.error.innerError) {
|
|
411
|
+
errorProperties[constants_1.SolutionTelemetryProperty.ArmDeploymentError] = result.error.innerError;
|
|
412
|
+
}
|
|
413
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ArmDeployment, result.error, ctx.telemetryReporter, errorProperties);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
result = teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure));
|
|
418
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ArmDeployment, result.error, ctx.telemetryReporter);
|
|
419
|
+
}
|
|
420
|
+
await progressHelper_1.ProgressHelper.endDeployArmTemplatesProgress(result.isOk());
|
|
421
|
+
return result;
|
|
422
|
+
}
|
|
423
|
+
exports.deployArmTemplatesV3 = deployArmTemplatesV3;
|
|
424
|
+
async function copyParameterJson(projectPath, appName, targetEnvName, sourceEnvName) {
|
|
288
425
|
var _a, _b, _c;
|
|
289
426
|
if (!targetEnvName || !sourceEnvName) {
|
|
290
427
|
return;
|
|
291
428
|
}
|
|
292
|
-
const parameterFolderPath = path_1.default.join(
|
|
429
|
+
const parameterFolderPath = path_1.default.join(projectPath, configsFolder);
|
|
293
430
|
const targetParameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, targetEnvName);
|
|
294
431
|
const sourceParameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, sourceEnvName);
|
|
295
432
|
const targetParameterFilePath = path_1.default.join(parameterFolderPath, targetParameterFileName);
|
|
296
433
|
const sourceParameterFilePath = path_1.default.join(parameterFolderPath, sourceParameterFileName);
|
|
297
434
|
const targetParameterContent = await fs.readJson(sourceParameterFilePath);
|
|
298
435
|
if ((_c = (_b = (_a = targetParameterContent[parameterName]) === null || _a === void 0 ? void 0 : _a.provisionParameters) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.resourceBaseName) {
|
|
299
|
-
const appName = ctx.projectSettings.appName;
|
|
300
436
|
targetParameterContent[parameterName].provisionParameters.value.resourceBaseName =
|
|
301
437
|
generateResourceBaseName(appName, targetEnvName);
|
|
302
438
|
}
|
|
303
439
|
await fs.ensureDir(parameterFolderPath);
|
|
304
|
-
await fs.writeFile(targetParameterFilePath, JSON.stringify(targetParameterContent, undefined, 4));
|
|
440
|
+
await fs.writeFile(targetParameterFilePath, JSON.stringify(targetParameterContent, undefined, 4).replace(/\r?\n/g, os_1.default.EOL));
|
|
305
441
|
}
|
|
306
442
|
exports.copyParameterJson = copyParameterJson;
|
|
307
443
|
async function getParameterJson(ctx) {
|
|
308
|
-
var _a
|
|
309
|
-
if (!
|
|
444
|
+
var _a;
|
|
445
|
+
if (!ctx.envInfo.envName) {
|
|
310
446
|
throw new Error("Failed to get target environment name from solution context.");
|
|
311
447
|
}
|
|
312
448
|
const parameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, ctx.envInfo.envName);
|
|
@@ -316,14 +452,34 @@ async function getParameterJson(ctx) {
|
|
|
316
452
|
await fs.stat(parameterFilePath);
|
|
317
453
|
}
|
|
318
454
|
catch (err) {
|
|
319
|
-
(
|
|
320
|
-
const returnError = new Error(`[${
|
|
321
|
-
throw teamsfx_api_1.returnUserError(returnError,
|
|
455
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] ${parameterFilePath} does not exist.`);
|
|
456
|
+
const returnError = new Error(`[${constants_2.PluginDisplayName.Solution}] ${parameterFilePath} does not exist.`);
|
|
457
|
+
throw teamsfx_api_1.returnUserError(returnError, constants_1.SolutionSource, "ParameterFileNotExist");
|
|
322
458
|
}
|
|
323
459
|
const parameterJson = await getExpandedParameter(ctx, parameterFilePath); // only expand secrets in memory
|
|
324
460
|
return parameterJson;
|
|
325
461
|
}
|
|
326
462
|
exports.getParameterJson = getParameterJson;
|
|
463
|
+
async function getParameterJsonV3(ctx, projectPath, envInfo) {
|
|
464
|
+
var _a;
|
|
465
|
+
if (!(envInfo === null || envInfo === void 0 ? void 0 : envInfo.envName)) {
|
|
466
|
+
throw new Error("Failed to get target environment name from solution context.");
|
|
467
|
+
}
|
|
468
|
+
const parameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, envInfo.envName);
|
|
469
|
+
const parameterFolderPath = path_1.default.join(projectPath, configsFolder);
|
|
470
|
+
const parameterFilePath = path_1.default.join(parameterFolderPath, parameterFileName);
|
|
471
|
+
try {
|
|
472
|
+
await fs.stat(parameterFilePath);
|
|
473
|
+
}
|
|
474
|
+
catch (err) {
|
|
475
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] ${parameterFilePath} does not exist.`);
|
|
476
|
+
const returnError = new Error(`[${constants_2.PluginDisplayName.Solution}] ${parameterFilePath} does not exist.`);
|
|
477
|
+
throw teamsfx_api_1.returnUserError(returnError, constants_1.SolutionSource, "ParameterFileNotExist");
|
|
478
|
+
}
|
|
479
|
+
const parameterJson = await getExpandedParameterV3(ctx, envInfo, parameterFilePath); // only expand secrets in memory
|
|
480
|
+
return parameterJson;
|
|
481
|
+
}
|
|
482
|
+
exports.getParameterJsonV3 = getParameterJsonV3;
|
|
327
483
|
function generateArmFromResult(result, bicepOrchestrationTemplate, pluginWithArm, moduleProvisionFiles, moduleConfigFiles) {
|
|
328
484
|
var _a, _b;
|
|
329
485
|
bicepOrchestrationTemplate.applyTemplate(pluginWithArm.name, result);
|
|
@@ -346,16 +502,14 @@ async function doGenerateArmTemplate(ctx, selectedPlugins) {
|
|
|
346
502
|
var _a, _b, _c;
|
|
347
503
|
const azureSolutionSettings = (_a = ctx.projectSettings) === null || _a === void 0 ? void 0 : _a.solutionSettings;
|
|
348
504
|
const baseName = generateResourceBaseName(ctx.projectSettings.appName, ctx.envInfo.envName);
|
|
349
|
-
const plugins =
|
|
350
|
-
? ResourcePluginContainer_1.getActivatedV2ResourcePlugins(azureSolutionSettings).map((p) => new adaptor_1.NamedArmResourcePluginAdaptor(p))
|
|
351
|
-
: ResourcePluginContainer_1.getActivatedResourcePlugins(azureSolutionSettings); // This function ensures return result won't be empty
|
|
505
|
+
const plugins = ResourcePluginContainer_1.getActivatedV2ResourcePlugins(azureSolutionSettings).map((p) => new adaptor_1.NamedArmResourcePluginAdaptor(p)); // This function ensures return result won't be empty
|
|
352
506
|
const bicepOrchestrationTemplate = new BicepOrchestrationContent(plugins.map((p) => p.name), baseName);
|
|
353
507
|
const moduleProvisionFiles = new Map();
|
|
354
508
|
const moduleConfigFiles = new Map();
|
|
355
509
|
// Get bicep content from each resource plugin
|
|
356
510
|
for (const plugin of plugins) {
|
|
357
511
|
const pluginWithArm = plugin; // Temporary solution before adding it to teamsfx-api
|
|
358
|
-
const pluginContext =
|
|
512
|
+
const pluginContext = util_2.getPluginContext(ctx, pluginWithArm.name);
|
|
359
513
|
let result;
|
|
360
514
|
let errMessage = "";
|
|
361
515
|
if (pluginWithArm.updateArmTemplates &&
|
|
@@ -375,19 +529,60 @@ async function doGenerateArmTemplate(ctx, selectedPlugins) {
|
|
|
375
529
|
generateArmFromResult(result.value, bicepOrchestrationTemplate, pluginWithArm, moduleProvisionFiles, moduleConfigFiles);
|
|
376
530
|
}
|
|
377
531
|
else {
|
|
378
|
-
const msg =
|
|
532
|
+
const msg = util_1.format(errMessage, (_b = ctx.projectSettings) === null || _b === void 0 ? void 0 : _b.appName);
|
|
379
533
|
(_c = ctx.logProvider) === null || _c === void 0 ? void 0 : _c.error(msg);
|
|
380
534
|
return result;
|
|
381
535
|
}
|
|
382
536
|
}
|
|
537
|
+
await persistBicepTemplates(bicepOrchestrationTemplate, moduleProvisionFiles, moduleConfigFiles, ctx.root);
|
|
538
|
+
return teamsfx_api_1.ok(undefined); // Nothing to return when success
|
|
539
|
+
}
|
|
540
|
+
async function doGenerateArmTemplateV3(ctx, inputs, activatedPlugins, addedPlugins) {
|
|
541
|
+
var _a;
|
|
542
|
+
const baseName = generateResourceBaseName(ctx.projectSetting.appName, "");
|
|
543
|
+
const bicepOrchestrationTemplate = new BicepOrchestrationContent(activatedPlugins.map((p) => p.name), baseName);
|
|
544
|
+
const moduleProvisionFiles = new Map();
|
|
545
|
+
const moduleConfigFiles = new Map();
|
|
546
|
+
for (const plugin of activatedPlugins) {
|
|
547
|
+
let result;
|
|
548
|
+
let errMessage = "";
|
|
549
|
+
if (plugin.updateResourceTemplate &&
|
|
550
|
+
!addedPlugins.find((pluginItem) => pluginItem.name === plugin.name)) {
|
|
551
|
+
result = await plugin.updateResourceTemplate(ctx, inputs);
|
|
552
|
+
errMessage = common_1.getStrings().solution.UpdateArmTemplateFailNotice;
|
|
553
|
+
}
|
|
554
|
+
else if (plugin.generateResourceTemplate &&
|
|
555
|
+
addedPlugins.find((pluginItem) => pluginItem.name === plugin.name)) {
|
|
556
|
+
result = await plugin.generateResourceTemplate(ctx, inputs);
|
|
557
|
+
errMessage = common_1.getStrings().solution.GenerateArmTemplateFailNotice;
|
|
558
|
+
}
|
|
559
|
+
else {
|
|
560
|
+
continue;
|
|
561
|
+
}
|
|
562
|
+
if (result.isOk()) {
|
|
563
|
+
if (result.value.kind === "bicep") {
|
|
564
|
+
const armTemplate = result.value.template;
|
|
565
|
+
generateArmFromResult(armTemplate, bicepOrchestrationTemplate, plugin, moduleProvisionFiles, moduleConfigFiles);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
const msg = util_1.format(errMessage, ctx.projectSetting.appName);
|
|
570
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(msg);
|
|
571
|
+
return result;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
await persistBicepTemplates(bicepOrchestrationTemplate, moduleProvisionFiles, moduleConfigFiles, inputs.projectPath);
|
|
575
|
+
return teamsfx_api_1.ok(undefined); // Nothing to return when success
|
|
576
|
+
}
|
|
577
|
+
async function persistBicepTemplates(bicepOrchestrationTemplate, moduleProvisionFiles, moduleConfigFiles, projectaPath) {
|
|
383
578
|
// Write bicep content to project folder
|
|
384
579
|
if (bicepOrchestrationTemplate.needsGenerateTemplate()) {
|
|
385
580
|
// Output parameter file
|
|
386
|
-
const envListResult = await
|
|
581
|
+
const envListResult = await environment_1.environmentManager.listEnvConfigs(projectaPath);
|
|
387
582
|
if (envListResult.isErr()) {
|
|
388
583
|
return teamsfx_api_1.err(envListResult.error);
|
|
389
584
|
}
|
|
390
|
-
const parameterEnvFolderPath = path_1.default.join(
|
|
585
|
+
const parameterEnvFolderPath = path_1.default.join(projectaPath, configsFolder);
|
|
391
586
|
await fs.ensureDir(parameterEnvFolderPath);
|
|
392
587
|
for (const env of envListResult.value) {
|
|
393
588
|
const parameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, env);
|
|
@@ -401,33 +596,33 @@ async function doGenerateArmTemplate(ctx, selectedPlugins) {
|
|
|
401
596
|
const duplicateParam = Object.keys(parameterObj).filter((val) => Object.keys(appendParam).includes(val));
|
|
402
597
|
if (duplicateParam && duplicateParam.length != 0) {
|
|
403
598
|
const duplicateParamError = new Error(`There are some duplicate parameters in ${parameterEnvFilePath}, to avoid the conflict, please modify these parameter names: ${duplicateParam}`);
|
|
404
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(duplicateParamError,
|
|
599
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(duplicateParamError, constants_1.SolutionSource, constants_1.SolutionError.FailedToUpdateArmParameters, constants_2.HelpLinks.ArmHelpLink));
|
|
405
600
|
}
|
|
406
601
|
parameterFile.parameters.provisionParameters.value = Object.assign(parameterObj, appendParam);
|
|
407
602
|
parameterFileContent = JSON.stringify(parameterFile, undefined, 2);
|
|
408
603
|
}
|
|
409
604
|
catch (error) {
|
|
410
605
|
const parameterFileError = new Error(`There are some errors in ${parameterEnvFilePath}, please make sure this file is valid. The error message is ${error.message}`);
|
|
411
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(parameterFileError,
|
|
606
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(parameterFileError, constants_1.SolutionSource, constants_1.SolutionError.FailedToUpdateArmParameters, constants_2.HelpLinks.ArmHelpLink));
|
|
412
607
|
}
|
|
413
608
|
}
|
|
414
609
|
else {
|
|
415
610
|
parameterFileContent = bicepOrchestrationTemplate.getParameterFileContent();
|
|
416
611
|
}
|
|
417
|
-
await fs.writeFile(parameterEnvFilePath, parameterFileContent);
|
|
612
|
+
await fs.writeFile(parameterEnvFilePath, parameterFileContent.replace(/\r?\n/g, os_1.default.EOL));
|
|
418
613
|
}
|
|
419
614
|
// Generate main.bicep, config.bicep, provision.bicep
|
|
420
|
-
const templateFolderPath = path_1.default.join(
|
|
615
|
+
const templateFolderPath = path_1.default.join(projectaPath, templatesFolder);
|
|
421
616
|
await fs.ensureDir(templateFolderPath);
|
|
422
617
|
await fs.ensureDir(path_1.default.join(templateFolderPath, "teamsFx"));
|
|
423
618
|
await fs.ensureDir(path_1.default.join(templateFolderPath, "provision"));
|
|
424
619
|
let bicepOrchestrationProvisionContent = "";
|
|
425
620
|
let bicepOrchestrationConfigContent = "";
|
|
426
621
|
if (!(await fs.pathExists(path_1.default.join(templateFolderPath, bicepOrchestrationProvisionFileName)))) {
|
|
427
|
-
bicepOrchestrationProvisionContent = await fs.readFile(path_1.default.join(folder_1.getTemplatesFolder(), "plugins", "solution", "provision.bicep"),
|
|
622
|
+
bicepOrchestrationProvisionContent = await fs.readFile(path_1.default.join(folder_1.getTemplatesFolder(), "plugins", "solution", "provision.bicep"), constants_2.ConstantString.UTF8Encoding);
|
|
428
623
|
}
|
|
429
624
|
if (!(await fs.pathExists(path_1.default.join(templateFolderPath, bicepOrchestrationConfigFileName)))) {
|
|
430
|
-
bicepOrchestrationConfigContent = await fs.readFile(path_1.default.join(folder_1.getTemplatesFolder(), "plugins", "solution", "config.bicep"),
|
|
625
|
+
bicepOrchestrationConfigContent = await fs.readFile(path_1.default.join(folder_1.getTemplatesFolder(), "plugins", "solution", "config.bicep"), constants_2.ConstantString.UTF8Encoding);
|
|
431
626
|
}
|
|
432
627
|
bicepOrchestrationProvisionContent +=
|
|
433
628
|
os_1.default.EOL + bicepOrchestrationTemplate.getOrchestractionProvisionContent();
|
|
@@ -437,42 +632,51 @@ async function doGenerateArmTemplate(ctx, selectedPlugins) {
|
|
|
437
632
|
if (!(await fs.pathExists(path_1.default.join(templateFolderPath, bicepOrchestrationFileName)))) {
|
|
438
633
|
await fs.copyFile(path_1.default.join(templateSolitionPath, bicepOrchestrationFileName), path_1.default.join(templateFolderPath, bicepOrchestrationFileName));
|
|
439
634
|
}
|
|
440
|
-
await fs.appendFile(path_1.default.join(templateFolderPath, bicepOrchestrationProvisionFileName), bicepOrchestrationProvisionContent);
|
|
441
|
-
await fs.appendFile(path_1.default.join(templateFolderPath, bicepOrchestrationConfigFileName), bicepOrchestrationConfigContent);
|
|
635
|
+
await fs.appendFile(path_1.default.join(templateFolderPath, bicepOrchestrationProvisionFileName), bicepOrchestrationProvisionContent.replace(/\r?\n/g, os_1.default.EOL));
|
|
636
|
+
await fs.appendFile(path_1.default.join(templateFolderPath, bicepOrchestrationConfigFileName), bicepOrchestrationConfigContent.replace(/\r?\n/g, os_1.default.EOL));
|
|
442
637
|
// Generate module provision bicep files
|
|
443
638
|
for (const module of moduleProvisionFiles) {
|
|
444
639
|
const res = bicepOrchestrationTemplate.applyReference(module[1]);
|
|
445
|
-
await fs.appendFile(path_1.default.join(templateFolderPath, module[0]), res);
|
|
640
|
+
await fs.appendFile(path_1.default.join(templateFolderPath, module[0]), res.replace(/\r?\n/g, os_1.default.EOL));
|
|
446
641
|
}
|
|
447
642
|
// Generate module configuration bicep files
|
|
448
643
|
for (const module of moduleConfigFiles) {
|
|
449
644
|
const res = bicepOrchestrationTemplate.applyReference(module[1]);
|
|
450
|
-
await fs.writeFile(path_1.default.join(templateFolderPath, module[0]), res);
|
|
645
|
+
await fs.writeFile(path_1.default.join(templateFolderPath, module[0]), res.replace(/\r?\n/g, os_1.default.EOL));
|
|
451
646
|
}
|
|
452
647
|
}
|
|
453
|
-
return teamsfx_api_1.ok(undefined); // Nothing to return when success
|
|
454
648
|
}
|
|
455
649
|
async function getExpandedParameter(ctx, filePath) {
|
|
456
650
|
var _a;
|
|
457
651
|
try {
|
|
458
|
-
const parameterTemplate = await fs.readFile(filePath,
|
|
652
|
+
const parameterTemplate = await fs.readFile(filePath, constants_2.ConstantString.UTF8Encoding);
|
|
459
653
|
const parameterJsonString = expandParameterPlaceholders(ctx, parameterTemplate);
|
|
460
654
|
return JSON.parse(parameterJsonString);
|
|
461
655
|
}
|
|
462
656
|
catch (err) {
|
|
463
|
-
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${
|
|
657
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] Failed to get expanded parameter from ${filePath}.`);
|
|
464
658
|
throw err;
|
|
465
659
|
}
|
|
466
660
|
}
|
|
467
|
-
async function
|
|
468
|
-
var _a
|
|
469
|
-
|
|
661
|
+
async function getExpandedParameterV3(ctx, envInfo, filePath) {
|
|
662
|
+
var _a;
|
|
663
|
+
try {
|
|
664
|
+
const parameterTemplate = await fs.readFile(filePath, constants_2.ConstantString.UTF8Encoding);
|
|
665
|
+
const parameterJsonString = expandParameterPlaceholdersV3(ctx, envInfo, parameterTemplate);
|
|
666
|
+
return JSON.parse(parameterJsonString);
|
|
667
|
+
}
|
|
668
|
+
catch (err) {
|
|
669
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] Failed to get expanded parameter from ${filePath}.`);
|
|
670
|
+
throw err;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
async function getResourceManagementClientForArmDeployment(azureAccountProvider, subscriptionId) {
|
|
674
|
+
const azureToken = await azureAccountProvider.getAccountCredentialAsync();
|
|
470
675
|
if (!azureToken) {
|
|
471
|
-
throw teamsfx_api_1.returnSystemError(new Error("Azure Credential is invalid."),
|
|
676
|
+
throw teamsfx_api_1.returnSystemError(new Error("Azure Credential is invalid."), constants_2.PluginDisplayName.Solution, constants_1.SolutionError.FailedToGetAzureCredential);
|
|
472
677
|
}
|
|
473
|
-
const subscriptionId = (_b = ctx.envInfo.state.get(constants_2.GLOBAL_CONFIG)) === null || _b === void 0 ? void 0 : _b.get(constants_2.SUBSCRIPTION_ID);
|
|
474
678
|
if (!subscriptionId) {
|
|
475
|
-
throw teamsfx_api_1.returnSystemError(new Error(`Failed to get subscription id.`),
|
|
679
|
+
throw teamsfx_api_1.returnSystemError(new Error(`Failed to get subscription id.`), constants_2.PluginDisplayName.Solution, constants_1.SolutionError.NoSubscriptionSelected);
|
|
476
680
|
}
|
|
477
681
|
return new arm_resources_1.ResourceManagementClient(azureToken, subscriptionId);
|
|
478
682
|
}
|
|
@@ -488,32 +692,34 @@ async function compileBicepToJson(bicepCommand, bicepOrchestrationFilePath, logg
|
|
|
488
692
|
// Context used by handlebars to render the main.bicep file
|
|
489
693
|
class ArmTemplateRenderContext {
|
|
490
694
|
constructor(pluginNames) {
|
|
491
|
-
this.Plugins =
|
|
492
|
-
|
|
695
|
+
this.Plugins = {};
|
|
696
|
+
for (const plugin of pluginNames) {
|
|
697
|
+
this.Plugins[plugin] = {};
|
|
698
|
+
}
|
|
493
699
|
}
|
|
494
700
|
addPluginOutput(pluginName, armResult) {
|
|
495
|
-
var _a, _b
|
|
496
|
-
const
|
|
701
|
+
var _a, _b;
|
|
702
|
+
const PluginContext = {
|
|
497
703
|
Provision: {},
|
|
498
704
|
Configuration: {},
|
|
499
705
|
References: {},
|
|
500
706
|
};
|
|
501
707
|
const provision = (_a = armResult.Provision) === null || _a === void 0 ? void 0 : _a.Modules;
|
|
502
|
-
const references =
|
|
503
|
-
const configs = (
|
|
708
|
+
const references = armResult.Reference;
|
|
709
|
+
const configs = (_b = armResult.Configuration) === null || _b === void 0 ? void 0 : _b.Modules;
|
|
504
710
|
if (provision) {
|
|
505
711
|
for (const module of Object.entries(provision)) {
|
|
506
712
|
const moduleFileName = module[0];
|
|
507
|
-
|
|
508
|
-
|
|
713
|
+
PluginContext.Provision[moduleFileName] = {
|
|
714
|
+
path: generateBicepModuleProvisionFilePath(moduleFileName),
|
|
509
715
|
};
|
|
510
716
|
}
|
|
511
717
|
}
|
|
512
718
|
if (configs) {
|
|
513
719
|
for (const module of Object.entries(configs)) {
|
|
514
720
|
const moduleFileName = module[0];
|
|
515
|
-
|
|
516
|
-
|
|
721
|
+
PluginContext.Configuration[moduleFileName] = {
|
|
722
|
+
path: generateBicepModuleConfigFilePath(moduleFileName),
|
|
517
723
|
};
|
|
518
724
|
}
|
|
519
725
|
}
|
|
@@ -521,10 +727,10 @@ class ArmTemplateRenderContext {
|
|
|
521
727
|
for (const output of Object.entries(references)) {
|
|
522
728
|
const outputKey = output[0];
|
|
523
729
|
const outputValue = output[1];
|
|
524
|
-
|
|
730
|
+
PluginContext.References[outputKey] = outputValue;
|
|
525
731
|
}
|
|
526
732
|
}
|
|
527
|
-
this.
|
|
733
|
+
this.Plugins[pluginName] = PluginContext;
|
|
528
734
|
}
|
|
529
735
|
}
|
|
530
736
|
exports.ArmTemplateRenderContext = ArmTemplateRenderContext;
|
|
@@ -536,25 +742,25 @@ class BicepOrchestrationContent {
|
|
|
536
742
|
this.ProvisionTemplate = "";
|
|
537
743
|
this.ConfigTemplate = "";
|
|
538
744
|
this.ParameterJsonTemplate[resourceBaseName] = baseName;
|
|
539
|
-
this.
|
|
745
|
+
this.RenderContext = new ArmTemplateRenderContext(pluginNames);
|
|
540
746
|
}
|
|
541
747
|
applyTemplate(pluginName, armResult) {
|
|
542
748
|
var _a, _b;
|
|
543
749
|
this.ProvisionTemplate += this.normalizeTemplateSnippet((_a = armResult.Provision) === null || _a === void 0 ? void 0 : _a.Orchestration);
|
|
544
750
|
this.ConfigTemplate += this.normalizeTemplateSnippet((_b = armResult.Configuration) === null || _b === void 0 ? void 0 : _b.Orchestration);
|
|
545
|
-
this.
|
|
751
|
+
this.RenderContext.addPluginOutput(pluginName, armResult);
|
|
546
752
|
Object.assign(this.ParameterJsonTemplate, armResult.Parameters);
|
|
547
753
|
}
|
|
548
754
|
applyReference(configContent) {
|
|
549
|
-
return common_1.compileHandlebarsTemplateString(configContent, this.
|
|
755
|
+
return common_1.compileHandlebarsTemplateString(configContent, this.RenderContext.Plugins);
|
|
550
756
|
}
|
|
551
757
|
getOrchestractionProvisionContent() {
|
|
552
|
-
const orchestrationTemplate = this.normalizeTemplateSnippet(this.ProvisionTemplate, false) +
|
|
553
|
-
return common_1.compileHandlebarsTemplateString(orchestrationTemplate, this.
|
|
758
|
+
const orchestrationTemplate = this.normalizeTemplateSnippet(this.ProvisionTemplate, false) + os_1.default.EOL;
|
|
759
|
+
return common_1.compileHandlebarsTemplateString(orchestrationTemplate, this.RenderContext.Plugins).trim();
|
|
554
760
|
}
|
|
555
761
|
getOrchestractionConfigContent() {
|
|
556
|
-
const orchestrationTemplate = this.normalizeTemplateSnippet(this.ConfigTemplate, false) +
|
|
557
|
-
return common_1.compileHandlebarsTemplateString(orchestrationTemplate, this.
|
|
762
|
+
const orchestrationTemplate = this.normalizeTemplateSnippet(this.ConfigTemplate, false) + os_1.default.EOL;
|
|
763
|
+
return common_1.compileHandlebarsTemplateString(orchestrationTemplate, this.RenderContext.Plugins).trim();
|
|
558
764
|
}
|
|
559
765
|
getParameterFileContent() {
|
|
560
766
|
const parameterObject = {
|
|
@@ -579,7 +785,7 @@ class BicepOrchestrationContent {
|
|
|
579
785
|
if (updateTemplateChangeFlag) {
|
|
580
786
|
this.TemplateAdded = true;
|
|
581
787
|
}
|
|
582
|
-
return snippet.trim() +
|
|
788
|
+
return snippet.trim() + os_1.default.EOL;
|
|
583
789
|
}
|
|
584
790
|
return "";
|
|
585
791
|
}
|
|
@@ -593,14 +799,12 @@ function generateBicepModuleConfigFilePath(moduleFileName) {
|
|
|
593
799
|
function expandParameterPlaceholders(ctx, parameterContent) {
|
|
594
800
|
var _a;
|
|
595
801
|
const azureSolutionSettings = (_a = ctx.projectSettings) === null || _a === void 0 ? void 0 : _a.solutionSettings;
|
|
596
|
-
const plugins =
|
|
597
|
-
? ResourcePluginContainer_1.getActivatedV2ResourcePlugins(azureSolutionSettings).map((p) => new adaptor_1.NamedArmResourcePluginAdaptor(p))
|
|
598
|
-
: ResourcePluginContainer_1.getActivatedResourcePlugins(azureSolutionSettings); // This function ensures return result won't be empty
|
|
802
|
+
const plugins = ResourcePluginContainer_1.getActivatedV2ResourcePlugins(azureSolutionSettings).map((p) => new adaptor_1.NamedArmResourcePluginAdaptor(p)); // This function ensures return result won't be empty
|
|
599
803
|
const stateVariables = {};
|
|
600
804
|
const availableVariables = { state: stateVariables };
|
|
601
805
|
// Add plugin contexts to available variables
|
|
602
806
|
for (const plugin of plugins) {
|
|
603
|
-
const pluginContext =
|
|
807
|
+
const pluginContext = util_2.getPluginContext(ctx, plugin.name);
|
|
604
808
|
const pluginVariables = {};
|
|
605
809
|
for (const configItem of pluginContext.config) {
|
|
606
810
|
if (typeof configItem[1] === "string") {
|
|
@@ -611,7 +815,7 @@ function expandParameterPlaceholders(ctx, parameterContent) {
|
|
|
611
815
|
stateVariables[plugin.name] = pluginVariables;
|
|
612
816
|
}
|
|
613
817
|
// Add solution config to available variables
|
|
614
|
-
const solutionConfig = ctx.envInfo.state.get(
|
|
818
|
+
const solutionConfig = ctx.envInfo.state.get(constants_1.GLOBAL_CONFIG);
|
|
615
819
|
if (solutionConfig) {
|
|
616
820
|
const solutionVariables = {};
|
|
617
821
|
for (const configItem of solutionConfig) {
|
|
@@ -630,6 +834,45 @@ function expandParameterPlaceholders(ctx, parameterContent) {
|
|
|
630
834
|
availableVariables["$env"] = processVariables;
|
|
631
835
|
return common_1.compileHandlebarsTemplateString(parameterContent, availableVariables);
|
|
632
836
|
}
|
|
837
|
+
function expandParameterPlaceholdersV3(ctx, envInfo, parameterContent) {
|
|
838
|
+
const azureSolutionSettings = ctx.projectSetting.solutionSettings;
|
|
839
|
+
const plugins = azureSolutionSettings.activeResourcePlugins.map((p) => typedi_1.Container.get(p));
|
|
840
|
+
const stateVariables = {};
|
|
841
|
+
const availableVariables = { state: stateVariables };
|
|
842
|
+
const envState = envInfo.state;
|
|
843
|
+
// Add plugin contexts to available variables
|
|
844
|
+
for (const plugin of plugins) {
|
|
845
|
+
const resourceState = envState[plugin.name] || {};
|
|
846
|
+
// const pluginContext = getPluginContext(ctx, plugin.name);
|
|
847
|
+
const pluginVariables = {};
|
|
848
|
+
for (const key of Object.keys(resourceState)) {
|
|
849
|
+
if (typeof resourceState[key] === "string") {
|
|
850
|
+
// Currently we only config with string type
|
|
851
|
+
pluginVariables[key] = resourceState[key];
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
stateVariables[plugin.name] = pluginVariables;
|
|
855
|
+
}
|
|
856
|
+
// Add solution config to available variables
|
|
857
|
+
const solutionConfig = envState.solution;
|
|
858
|
+
if (solutionConfig) {
|
|
859
|
+
const solutionVariables = {};
|
|
860
|
+
for (const key of Object.keys(solutionConfig)) {
|
|
861
|
+
if (typeof solutionConfig[key] === "string") {
|
|
862
|
+
// Currently we only config with string type
|
|
863
|
+
solutionVariables[key] = solutionConfig[key];
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
stateVariables[solutionName] = solutionVariables;
|
|
867
|
+
}
|
|
868
|
+
// Add environment variable to available variables
|
|
869
|
+
const processVariables = Object.keys(process.env).reduce((obj, key) => {
|
|
870
|
+
obj[key] = process.env[key];
|
|
871
|
+
return obj;
|
|
872
|
+
}, {});
|
|
873
|
+
availableVariables["$env"] = processVariables;
|
|
874
|
+
return common_1.compileHandlebarsTemplateString(parameterContent, availableVariables);
|
|
875
|
+
}
|
|
633
876
|
function generateResourceBaseName(appName, envName) {
|
|
634
877
|
const maxAppNameLength = 10;
|
|
635
878
|
const maxEnvNameLength = 4;
|
|
@@ -646,9 +889,9 @@ async function wrapGetDeploymentError(deployCtx, resourceGroupName, deploymentNa
|
|
|
646
889
|
return teamsfx_api_1.ok(deploymentError);
|
|
647
890
|
}
|
|
648
891
|
catch (error) {
|
|
649
|
-
(_a = deployCtx.
|
|
892
|
+
(_a = deployCtx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] Failed to get deployment error for ${error.message}.`);
|
|
650
893
|
const returnError = new Error(`resource deployments (${deployCtx.deploymentName} module) for your project failed and get the error message failed. Please refer to the resource group ${deployCtx.resourceGroupName} in portal for deployment error.`);
|
|
651
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(returnError,
|
|
894
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(returnError, constants_1.SolutionSource, "GetDeploymentErrorFailed"));
|
|
652
895
|
}
|
|
653
896
|
}
|
|
654
897
|
async function getDeploymentError(deployCtx, resourceGroupName, deploymentName) {
|
|
@@ -659,7 +902,7 @@ async function getDeploymentError(deployCtx, resourceGroupName, deploymentName)
|
|
|
659
902
|
}
|
|
660
903
|
catch (error) {
|
|
661
904
|
if (deploymentName !== deployCtx.deploymentName &&
|
|
662
|
-
error.code ===
|
|
905
|
+
error.code === constants_2.ConstantString.DeploymentNotFound) {
|
|
663
906
|
return undefined;
|
|
664
907
|
}
|
|
665
908
|
throw error;
|
|
@@ -681,7 +924,7 @@ async function getDeploymentError(deployCtx, resourceGroupName, deploymentName)
|
|
|
681
924
|
error: operation.properties.statusMessage.error,
|
|
682
925
|
};
|
|
683
926
|
if (((_g = operation.properties.targetResource) === null || _g === void 0 ? void 0 : _g.resourceType) ===
|
|
684
|
-
|
|
927
|
+
constants_2.ConstantString.DeploymentResourceType &&
|
|
685
928
|
((_h = operation.properties.targetResource) === null || _h === void 0 ? void 0 : _h.resourceName) &&
|
|
686
929
|
((_j = operation.properties.targetResource) === null || _j === void 0 ? void 0 : _j.id)) {
|
|
687
930
|
const resourceGroupName = tools_1.getResourceGroupNameFromResourceId(operation.properties.targetResource.id);
|
|
@@ -694,10 +937,16 @@ async function getDeploymentError(deployCtx, resourceGroupName, deploymentName)
|
|
|
694
937
|
}
|
|
695
938
|
return deploymentError;
|
|
696
939
|
}
|
|
697
|
-
function
|
|
940
|
+
function getNotificationMessage(deploymentError, deploymentName) {
|
|
941
|
+
let failedDeployments = [];
|
|
942
|
+
if (deploymentError.subErrors) {
|
|
943
|
+
failedDeployments = Object.keys(deploymentError.subErrors);
|
|
944
|
+
}
|
|
945
|
+
else {
|
|
946
|
+
failedDeployments.push(deploymentName);
|
|
947
|
+
}
|
|
698
948
|
const format = failedDeployments.map((deployment) => deployment + " module");
|
|
699
|
-
|
|
700
|
-
return teamsfx_api_1.returnUserError(returnError, constants_2.SolutionSource, constants_2.SolutionError.FailedToDeployArmTemplatesToAzure, constants_1.HelpLinks.ArmHelpLink);
|
|
949
|
+
return `resource deployments (${format.join(", ")}) for your project failed. Please refer to output channel for more error details.`;
|
|
701
950
|
}
|
|
702
951
|
function formattedDeploymentError(deploymentError) {
|
|
703
952
|
var _a, _b, _c;
|
|
@@ -723,4 +972,14 @@ function formattedDeploymentError(deploymentError) {
|
|
|
723
972
|
}
|
|
724
973
|
}
|
|
725
974
|
exports.formattedDeploymentError = formattedDeploymentError;
|
|
975
|
+
class Arm {
|
|
976
|
+
async generateArmTemplate(ctx, inputs, activatedPlugins, addedPlugins) {
|
|
977
|
+
return generateArmTemplateV3(ctx, inputs, activatedPlugins, addedPlugins);
|
|
978
|
+
}
|
|
979
|
+
async deployArmTemplates(ctx, inputs, envInfo, azureAccountProvider) {
|
|
980
|
+
return deployArmTemplatesV3(ctx, inputs, envInfo, azureAccountProvider);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
const arm = new Arm();
|
|
984
|
+
exports.default = arm;
|
|
726
985
|
//# sourceMappingURL=arm.js.map
|