@microsoft/teamsfx-core 1.1.2 → 1.1.3-alpha.12edbb86.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 +25 -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 +80 -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 +9 -0
- package/build/common/deps-checker/index.d.ts.map +1 -0
- package/build/common/deps-checker/index.js +14 -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 +280 -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 +181 -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/extensionInstaller.d.ts +3 -0
- package/build/common/deps-checker/util/extensionInstaller.d.ts.map +1 -0
- package/build/common/deps-checker/util/extensionInstaller.js +47 -0
- package/build/common/deps-checker/util/extensionInstaller.js.map +1 -0
- package/build/common/deps-checker/util/index.d.ts +5 -0
- package/build/common/deps-checker/util/index.d.ts.map +1 -0
- package/build/common/deps-checker/util/index.js +10 -0
- package/build/common/deps-checker/util/index.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/depsAdapter.d.ts +27 -0
- package/build/common/local/depsAdapter.d.ts.map +1 -0
- package/build/common/local/depsAdapter.js +86 -0
- package/build/common/local/depsAdapter.js.map +1 -0
- package/build/common/local/localEnvManager.d.ts +24 -0
- package/build/common/local/localEnvManager.d.ts.map +1 -0
- package/build/common/local/localEnvManager.js +113 -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 +133 -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 +11 -0
- package/build/common/local/projectSettingsHelper.d.ts.map +1 -0
- package/build/common/local/projectSettingsHelper.js +37 -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 +231 -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 +11 -5
- 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 +54 -15
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +693 -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/aadAppClient.d.ts +2 -2
- package/build/plugins/resource/aad/aadAppClient.d.ts.map +1 -1
- package/build/plugins/resource/aad/aadAppClient.js +3 -4
- package/build/plugins/resource/aad/aadAppClient.js.map +1 -1
- package/build/plugins/resource/aad/interfaces/IAADDefinition.d.ts +4 -0
- package/build/plugins/resource/aad/interfaces/IAADDefinition.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.js +18 -17
- package/build/plugins/resource/aad/plugin.js.map +1 -1
- package/build/plugins/resource/aad/utils/common.d.ts +2 -0
- package/build/plugins/resource/aad/utils/common.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/common.js +10 -0
- package/build/plugins/resource/aad/utils/common.js.map +1 -1
- package/build/plugins/resource/aad/utils/configs.d.ts +1 -0
- package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/configs.js +7 -0
- package/build/plugins/resource/aad/utils/configs.js.map +1 -1
- package/build/plugins/resource/apim/config.d.ts +2 -1
- package/build/plugins/resource/apim/config.d.ts.map +1 -1
- package/build/plugins/resource/apim/config.js +5 -0
- package/build/plugins/resource/apim/config.js.map +1 -1
- package/build/plugins/resource/apim/constants.d.ts +1 -0
- package/build/plugins/resource/apim/constants.d.ts.map +1 -1
- package/build/plugins/resource/apim/constants.js +1 -0
- package/build/plugins/resource/apim/constants.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 -6
- package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/constants.js +8 -152
- 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 +37 -1
- package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/index.js +58 -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 +190 -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 +40 -37
- package/build/plugins/resource/bot/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/configs.d.ts.map +1 -1
- package/build/plugins/resource/frontend/configs.js +3 -9
- package/build/plugins/resource/frontend/configs.js.map +1 -1
- package/build/plugins/resource/frontend/constants.d.ts +2 -15
- package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/constants.js +3 -19
- package/build/plugins/resource/frontend/constants.js.map +1 -1
- package/build/plugins/resource/frontend/{blazor → dotnet}/constants.d.ts +7 -24
- package/build/plugins/resource/frontend/{blazor → dotnet}/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/constants.js +81 -0
- package/build/plugins/resource/frontend/{blazor → dotnet}/constants.js.map +1 -1
- package/build/plugins/resource/frontend/{blazor → dotnet}/enum.d.ts +1 -1
- package/build/plugins/resource/frontend/{blazor → dotnet}/enum.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/enum.js +39 -0
- package/build/plugins/resource/frontend/{blazor → dotnet}/enum.js.map +1 -1
- package/build/plugins/resource/frontend/{blazor → dotnet}/error-factory.d.ts +0 -0
- package/build/plugins/resource/frontend/{blazor → dotnet}/error-factory.d.ts.map +1 -1
- package/build/plugins/resource/frontend/{blazor → dotnet}/error-factory.js +3 -3
- package/build/plugins/resource/frontend/{blazor → dotnet}/error-factory.js.map +1 -1
- package/build/plugins/resource/frontend/{blazor → dotnet}/ops/deploy.d.ts +0 -0
- package/build/plugins/resource/frontend/{blazor → dotnet}/ops/deploy.d.ts.map +1 -1
- package/build/plugins/resource/frontend/{blazor → dotnet}/ops/deploy.js +2 -2
- package/build/plugins/resource/frontend/{blazor → dotnet}/ops/deploy.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.d.ts +26 -0
- package/build/plugins/resource/frontend/dotnet/plugin.d.ts.map +1 -0
- package/build/plugins/resource/frontend/dotnet/plugin.js +69 -0
- package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -0
- package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts +35 -0
- package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts.map +1 -0
- package/build/plugins/resource/frontend/{blazor → dotnet}/resources/errors.js +10 -22
- package/build/plugins/resource/frontend/dotnet/resources/errors.js.map +1 -0
- package/build/plugins/resource/frontend/{blazor → dotnet}/resources/messages.d.ts +0 -4
- package/build/plugins/resource/frontend/dotnet/resources/messages.d.ts.map +1 -0
- package/build/plugins/resource/frontend/{blazor → dotnet}/resources/messages.js +0 -4
- package/build/plugins/resource/frontend/dotnet/resources/messages.js.map +1 -0
- package/build/plugins/resource/frontend/dotnet/utils/azure-client.d.ts +6 -0
- package/build/plugins/resource/frontend/dotnet/utils/azure-client.d.ts.map +1 -0
- package/build/plugins/resource/frontend/dotnet/utils/azure-client.js +11 -0
- package/build/plugins/resource/frontend/dotnet/utils/azure-client.js.map +1 -0
- package/build/plugins/resource/frontend/env.d.ts +22 -0
- package/build/plugins/resource/frontend/env.d.ts.map +1 -0
- package/build/plugins/resource/frontend/env.js +103 -0
- package/build/plugins/resource/frontend/env.js.map +1 -0
- package/build/plugins/resource/frontend/index.d.ts +2 -2
- package/build/plugins/resource/frontend/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/index.js +8 -20
- package/build/plugins/resource/frontend/index.js.map +1 -1
- package/build/plugins/resource/frontend/ops/deploy.d.ts +5 -4
- package/build/plugins/resource/frontend/ops/deploy.d.ts.map +1 -1
- package/build/plugins/resource/frontend/ops/deploy.js +35 -29
- package/build/plugins/resource/frontend/ops/deploy.js.map +1 -1
- package/build/plugins/resource/frontend/plugin.d.ts +2 -3
- package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.js +50 -75
- package/build/plugins/resource/frontend/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.d.ts +3 -18
- package/build/plugins/resource/frontend/resources/errors.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.js +7 -39
- package/build/plugins/resource/frontend/resources/errors.js.map +1 -1
- package/build/plugins/resource/frontend/resources/messages.d.ts +2 -0
- package/build/plugins/resource/frontend/resources/messages.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/messages.js +2 -0
- package/build/plugins/resource/frontend/resources/messages.js.map +1 -1
- package/build/plugins/resource/frontend/utils/progress-helper.d.ts +0 -8
- package/build/plugins/resource/frontend/utils/progress-helper.d.ts.map +1 -1
- package/build/plugins/resource/frontend/utils/progress-helper.js +1 -19
- package/build/plugins/resource/frontend/utils/progress-helper.js.map +1 -1
- package/build/plugins/resource/frontend/utils/telemetry-helper.d.ts +1 -1
- package/build/plugins/resource/frontend/utils/telemetry-helper.d.ts.map +1 -1
- package/build/plugins/resource/frontend/utils/telemetry-helper.js +8 -2
- package/build/plugins/resource/frontend/utils/telemetry-helper.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/index.d.ts +1 -1
- package/build/plugins/resource/function/index.d.ts.map +1 -1
- package/build/plugins/resource/function/index.js +8 -12
- package/build/plugins/resource/function/index.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/spfx/plugin.d.ts.map +1 -1
- package/build/plugins/resource/spfx/plugin.js +14 -9
- package/build/plugins/resource/spfx/plugin.js.map +1 -1
- package/build/plugins/resource/spfx/utils/constants.d.ts +5 -4
- package/build/plugins/resource/spfx/utils/constants.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/constants.js +5 -4
- package/build/plugins/resource/spfx/utils/constants.js.map +1 -1
- package/build/plugins/resource/spfx/utils/progress-helper.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/progress-helper.js +1 -1
- package/build/plugins/resource/spfx/utils/progress-helper.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 +26 -10
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +429 -146
- 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/constants.d.ts +2 -0
- package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/constants.js +2 -0
- package/build/plugins/solution/fx-solution/constants.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 +237 -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 +165 -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 +3 -3
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +4 -36
- 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 +19 -10
- 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/adaptor.js +1 -1
- package/build/plugins/solution/fx-solution/v2/adaptor.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 +2 -2
- package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js +199 -124
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.d.ts +3 -1
- package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.js +9 -14
- package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.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 +142 -120
- 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 +13 -3
- 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 +11 -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 +264 -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 +21 -6
- package/resource/deps-checker/dotnet-install.ps1 +1095 -0
- package/resource/deps-checker/dotnet-install.sh +1222 -0
- package/resource/strings.json +18 -9
- 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 +33 -38
- package/templates/plugins/resource/bot/bicep/botProvision.template.bicep +15 -11
- package/templates/plugins/resource/bot/bicep/config.template.bicep +3 -1
- package/templates/plugins/resource/bot/bicep/provision.template.bicep +2 -2
- package/templates/plugins/resource/frontend/bicep/frontendHostingProvision.bicep +3 -2
- package/templates/plugins/resource/frontend/bicep/provision.template.bicep +1 -1
- package/templates/plugins/resource/function/bicep/config.template.bicep +3 -1
- package/templates/plugins/resource/function/bicep/functionConfiguration.template.bicep +44 -42
- package/templates/plugins/resource/function/bicep/functionProvision.template.bicep +17 -14
- package/templates/plugins/resource/function/bicep/provision.template.bicep +2 -2
- package/templates/plugins/resource/identity/bicep/identityProvision.template.bicep +2 -1
- package/templates/plugins/resource/identity/bicep/provision.template.bicep +1 -1
- package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +10 -7
- package/templates/plugins/resource/keyvault/bicep/provision.template.bicep +4 -2
- package/templates/plugins/resource/simpleauth/bicep/config.template.bicep +3 -1
- package/templates/plugins/resource/simpleauth/bicep/provision.template.bicep +2 -2
- package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +27 -31
- package/templates/plugins/resource/simpleauth/bicep/simpleAuthProvision.template.bicep +9 -6
- package/templates/plugins/resource/simpleauth/version.txt +2 -1
- package/templates/plugins/resource/sql/bicep/provision.template.bicep +1 -1
- package/templates/plugins/resource/sql/bicep/sqlProvision.template.bicep +8 -5
- package/build/plugins/resource/frontend/blazor/constants.js +0 -98
- package/build/plugins/resource/frontend/blazor/enum.js +0 -39
- package/build/plugins/resource/frontend/blazor/ops/provision.d.ts +0 -8
- package/build/plugins/resource/frontend/blazor/ops/provision.d.ts.map +0 -1
- package/build/plugins/resource/frontend/blazor/ops/provision.js +0 -42
- package/build/plugins/resource/frontend/blazor/ops/provision.js.map +0 -1
- package/build/plugins/resource/frontend/blazor/plugin.d.ts +0 -35
- package/build/plugins/resource/frontend/blazor/plugin.d.ts.map +0 -1
- package/build/plugins/resource/frontend/blazor/plugin.js +0 -190
- package/build/plugins/resource/frontend/blazor/plugin.js.map +0 -1
- package/build/plugins/resource/frontend/blazor/resources/errors.d.ts +0 -41
- package/build/plugins/resource/frontend/blazor/resources/errors.d.ts.map +0 -1
- package/build/plugins/resource/frontend/blazor/resources/errors.js.map +0 -1
- package/build/plugins/resource/frontend/blazor/resources/messages.d.ts.map +0 -1
- package/build/plugins/resource/frontend/blazor/resources/messages.js.map +0 -1
- package/build/plugins/resource/frontend/blazor/utils/azure-client.d.ts +0 -21
- package/build/plugins/resource/frontend/blazor/utils/azure-client.d.ts.map +0 -1
- package/build/plugins/resource/frontend/blazor/utils/azure-client.js +0 -47
- package/build/plugins/resource/frontend/blazor/utils/azure-client.js.map +0 -1
- package/build/plugins/resource/frontend/utils/azure-client.d.ts +0 -12
- package/build/plugins/resource/frontend/utils/azure-client.d.ts.map +0 -1
- package/build/plugins/resource/frontend/utils/azure-client.js +0 -29
- package/build/plugins/resource/frontend/utils/azure-client.js.map +0 -1
- package/build/plugins/resource/frontend/utils/environment-utils.d.ts +0 -9
- package/build/plugins/resource/frontend/utils/environment-utils.d.ts.map +0 -1
- package/build/plugins/resource/frontend/utils/environment-utils.js +0 -36
- package/build/plugins/resource/frontend/utils/environment-utils.js.map +0 -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.armV2 = 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";
|
|
@@ -29,6 +29,8 @@ const bicepOrchestrationConfigFileName = "config.bicep";
|
|
|
29
29
|
const templatesFolder = "./templates/azure";
|
|
30
30
|
const configsFolder = `.${teamsfx_api_1.ConfigFolderName}/configs`;
|
|
31
31
|
const parameterFileNameTemplate = `azure.parameters.${teamsfx_api_1.EnvNamePlaceholder}.json`;
|
|
32
|
+
const pollWaitSeconds = 10;
|
|
33
|
+
const maxRetryTimes = 4;
|
|
32
34
|
// constant string
|
|
33
35
|
const resourceBaseName = "resourceBaseName";
|
|
34
36
|
const parameterName = "parameters";
|
|
@@ -38,28 +40,53 @@ const InvalidTemplateErrorCode = "InvalidTemplate";
|
|
|
38
40
|
async function generateArmTemplate(ctx, selectedPlugins = []) {
|
|
39
41
|
var _a, _b;
|
|
40
42
|
let result;
|
|
41
|
-
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(
|
|
42
|
-
[
|
|
43
|
+
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GenerateArmTemplateStart, {
|
|
44
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
43
45
|
});
|
|
44
46
|
try {
|
|
45
47
|
result = await doGenerateArmTemplate(ctx, selectedPlugins);
|
|
46
48
|
if (result.isOk()) {
|
|
47
|
-
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(
|
|
48
|
-
[
|
|
49
|
-
[
|
|
49
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, {
|
|
50
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
51
|
+
[constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
54
|
else {
|
|
53
|
-
|
|
55
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, result.error, ctx.telemetryReporter);
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
catch (error) {
|
|
57
|
-
result = teamsfx_api_1.err(teamsfx_api_1.returnSystemError(error,
|
|
58
|
-
|
|
59
|
+
result = teamsfx_api_1.err(teamsfx_api_1.returnSystemError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToGenerateArmTemplates));
|
|
60
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, result.error, ctx.telemetryReporter);
|
|
59
61
|
}
|
|
60
62
|
return result;
|
|
61
63
|
}
|
|
62
64
|
exports.generateArmTemplate = generateArmTemplate;
|
|
65
|
+
async function generateArmTemplateV3(ctx, inputs, activatedPlugins, addedPlugins) {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
let result;
|
|
68
|
+
(_a = ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GenerateArmTemplateStart, {
|
|
69
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
70
|
+
});
|
|
71
|
+
try {
|
|
72
|
+
result = await doGenerateArmTemplateV3(ctx, inputs, activatedPlugins, addedPlugins);
|
|
73
|
+
if (result.isOk()) {
|
|
74
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, {
|
|
75
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
76
|
+
[constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, result.error, ctx.telemetryReporter);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
result = teamsfx_api_1.err(teamsfx_api_1.returnSystemError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToGenerateArmTemplates));
|
|
85
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GenerateArmTemplate, result.error, ctx.telemetryReporter);
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
exports.generateArmTemplateV3 = generateArmTemplateV3;
|
|
63
90
|
function getRequiredOperation(operation, deployCtx) {
|
|
64
91
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
65
92
|
if (((_b = (_a = operation.properties) === null || _a === void 0 ? void 0 : _a.targetResource) === null || _b === void 0 ? void 0 : _b.resourceName) &&
|
|
@@ -74,6 +101,7 @@ function getRequiredOperation(operation, deployCtx) {
|
|
|
74
101
|
resourceName: (_g = (_f = operation.properties) === null || _f === void 0 ? void 0 : _f.targetResource) === null || _g === void 0 ? void 0 : _g.resourceName,
|
|
75
102
|
resourceGroupName: resourceGroupName,
|
|
76
103
|
subscriptionId: subscriptionId,
|
|
104
|
+
resourceType: operation.properties.targetResource.resourceType,
|
|
77
105
|
status: operation.properties.provisioningState,
|
|
78
106
|
};
|
|
79
107
|
}
|
|
@@ -88,13 +116,12 @@ function getRequiredOperation(operation, deployCtx) {
|
|
|
88
116
|
exports.getRequiredOperation = getRequiredOperation;
|
|
89
117
|
async function pollDeploymentStatus(deployCtx) {
|
|
90
118
|
var _a, _b, _c;
|
|
91
|
-
const failedCount = 4;
|
|
92
119
|
let tryCount = 0;
|
|
93
120
|
let previousStatus = {};
|
|
94
121
|
let polledOperations = [];
|
|
95
|
-
(_a = deployCtx.ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(
|
|
122
|
+
(_a = deployCtx.ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.PollDeploymentStatusNotice, constants_2.PluginDisplayName.Solution));
|
|
96
123
|
while (!deployCtx.finished) {
|
|
97
|
-
await tools_1.waitSeconds(
|
|
124
|
+
await tools_1.waitSeconds(pollWaitSeconds);
|
|
98
125
|
try {
|
|
99
126
|
const operations = await deployCtx.client.deploymentOperations.list(deployCtx.resourceGroupName, deployCtx.deploymentName);
|
|
100
127
|
if (deployCtx.finished) {
|
|
@@ -108,24 +135,27 @@ async function pollDeploymentStatus(deployCtx) {
|
|
|
108
135
|
currentStatus[operation.resourceName] = operation.status;
|
|
109
136
|
if (!polledOperations.includes(operation.resourceName)) {
|
|
110
137
|
polledOperations.push(operation.resourceName);
|
|
111
|
-
|
|
112
|
-
if (operation.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
subOperations.forEach((sub) => {
|
|
118
|
-
const subOperation = getRequiredOperation(sub, deployCtx);
|
|
119
|
-
if (subOperation) {
|
|
120
|
-
currentStatus[subOperation.resourceName] = subOperation.status;
|
|
138
|
+
// get sub operations when resource type is deployments.
|
|
139
|
+
if (operation.resourceType === constants_2.ConstantString.DeploymentResourceType) {
|
|
140
|
+
let client = deployCtx.client;
|
|
141
|
+
if (operation.subscriptionId !== deployCtx.client.subscriptionId) {
|
|
142
|
+
const azureToken = await ((_a = deployCtx.ctx.azureAccountProvider) === null || _a === void 0 ? void 0 : _a.getAccountCredentialAsync());
|
|
143
|
+
client = new arm_resources_1.ResourceManagementClient(azureToken, operation.subscriptionId);
|
|
121
144
|
}
|
|
122
|
-
|
|
145
|
+
const subOperations = await client.deploymentOperations.list(operation.resourceGroupName, operation.resourceName);
|
|
146
|
+
subOperations.forEach((sub) => {
|
|
147
|
+
const subOperation = getRequiredOperation(sub, deployCtx);
|
|
148
|
+
if (subOperation) {
|
|
149
|
+
currentStatus[subOperation.resourceName] = subOperation.status;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
123
153
|
}
|
|
124
154
|
}
|
|
125
155
|
}));
|
|
126
156
|
for (const key in currentStatus) {
|
|
127
157
|
if (currentStatus[key] !== previousStatus[key]) {
|
|
128
|
-
(_b = deployCtx.ctx.logProvider) === null || _b === void 0 ? void 0 : _b.info(`[${
|
|
158
|
+
(_b = deployCtx.ctx.logProvider) === null || _b === void 0 ? void 0 : _b.info(`[${constants_2.PluginDisplayName.Solution}] ${key} -> ${currentStatus[key]}`);
|
|
129
159
|
}
|
|
130
160
|
}
|
|
131
161
|
previousStatus = currentStatus;
|
|
@@ -133,33 +163,37 @@ async function pollDeploymentStatus(deployCtx) {
|
|
|
133
163
|
}
|
|
134
164
|
catch (error) {
|
|
135
165
|
tryCount++;
|
|
136
|
-
if (tryCount
|
|
137
|
-
|
|
166
|
+
if (tryCount < maxRetryTimes) {
|
|
167
|
+
(_c = deployCtx.ctx.logProvider) === null || _c === void 0 ? void 0 : _c.warning(`[${constants_2.PluginDisplayName.Solution}] ${deployCtx.deploymentName} -> waiting to get deplomyment status [Retry time: ${tryCount}]`);
|
|
168
|
+
}
|
|
169
|
+
else if (tryCount === maxRetryTimes) {
|
|
170
|
+
const pollError = teamsfx_api_1.returnSystemError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToPollArmDeploymentStatus);
|
|
171
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ArmDeployment, pollError, deployCtx.ctx.telemetryReporter);
|
|
138
172
|
}
|
|
139
|
-
(_c = deployCtx.ctx.logProvider) === null || _c === void 0 ? void 0 : _c.warning(`[${constants_1.PluginDisplayName.Solution}] ${deployCtx.deploymentName} -> waiting to get deplomyment status [${tryCount}]`);
|
|
140
173
|
}
|
|
141
174
|
}
|
|
142
175
|
}
|
|
143
176
|
exports.pollDeploymentStatus = pollDeploymentStatus;
|
|
144
177
|
async function doDeployArmTemplates(ctx) {
|
|
145
178
|
var _a, _b, _c;
|
|
146
|
-
const progressHandler = await progressHelper_1.ProgressHelper.startDeployArmTemplatesProgressHandler(
|
|
179
|
+
const progressHandler = await progressHelper_1.ProgressHelper.startDeployArmTemplatesProgressHandler(ctx.ui);
|
|
147
180
|
await (progressHandler === null || progressHandler === void 0 ? void 0 : progressHandler.next(progressHelper_1.DeployArmTemplatesSteps.ExecuteDeployment));
|
|
148
181
|
// update parameters
|
|
149
182
|
const parameterJson = await getParameterJson(ctx);
|
|
150
|
-
const resourceGroupName = (_a = ctx.envInfo.state.get(
|
|
183
|
+
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
184
|
if (!resourceGroupName) {
|
|
152
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnSystemError(new Error("Failed to get resource group from project solution settings."),
|
|
185
|
+
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
186
|
}
|
|
154
|
-
const bicepCommand = await bicepChecker_1.ensureBicep(ctx);
|
|
187
|
+
const bicepCommand = await bicepChecker_1.ensureBicep(ctx, ctx.answers);
|
|
155
188
|
// Compile bicep file to json
|
|
156
189
|
const templateDir = path_1.default.join(ctx.root, templatesFolder);
|
|
157
190
|
const bicepOrchestrationFilePath = path_1.default.join(templateDir, bicepOrchestrationFileName);
|
|
158
191
|
const armTemplateJson = await compileBicepToJson(bicepCommand, bicepOrchestrationFilePath, ctx.logProvider);
|
|
159
|
-
(_b = ctx.logProvider) === null || _b === void 0 ? void 0 : _b.info(
|
|
192
|
+
(_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
193
|
// deploy arm templates to azure
|
|
161
|
-
const
|
|
162
|
-
const
|
|
194
|
+
const subscriptionId = (_c = ctx.envInfo.state.get(constants_1.GLOBAL_CONFIG)) === null || _c === void 0 ? void 0 : _c.get(constants_1.SUBSCRIPTION_ID);
|
|
195
|
+
const client = await getResourceManagementClientForArmDeployment(ctx.azureAccountProvider, subscriptionId);
|
|
196
|
+
const deploymentName = `${constants_2.PluginDisplayName.Solution}_deployment`.replace(" ", "_").toLowerCase();
|
|
163
197
|
const deploymentParameters = {
|
|
164
198
|
properties: {
|
|
165
199
|
parameters: parameterJson.parameters,
|
|
@@ -180,8 +214,8 @@ async function doDeployArmTemplates(ctx) {
|
|
|
180
214
|
.createOrUpdate(resourceGroupName, deploymentName, deploymentParameters)
|
|
181
215
|
.then((result) => {
|
|
182
216
|
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);
|
|
217
|
+
(_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));
|
|
218
|
+
syncArmOutput(ctx.envInfo, (_b = result.properties) === null || _b === void 0 ? void 0 : _b.outputs);
|
|
185
219
|
return result;
|
|
186
220
|
})
|
|
187
221
|
.finally(() => {
|
|
@@ -194,7 +228,7 @@ async function doDeployArmTemplates(ctx) {
|
|
|
194
228
|
catch (error) {
|
|
195
229
|
// return the error if the template is invalid
|
|
196
230
|
if (error.code === InvalidTemplateErrorCode) {
|
|
197
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error,
|
|
231
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToValidateArmTemplates));
|
|
198
232
|
}
|
|
199
233
|
// try to get deployment error
|
|
200
234
|
const result = await wrapGetDeploymentError(deployCtx, resourceGroupName, deploymentName);
|
|
@@ -202,21 +236,14 @@ async function doDeployArmTemplates(ctx) {
|
|
|
202
236
|
const deploymentError = result.value;
|
|
203
237
|
// return thrown error if deploymentError is empty
|
|
204
238
|
if (!deploymentError) {
|
|
205
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error,
|
|
239
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure));
|
|
206
240
|
}
|
|
207
241
|
const deploymentErrorObj = formattedDeploymentError(deploymentError);
|
|
208
242
|
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);
|
|
243
|
+
let errorMessage = util_1.format(common_1.getStrings().solution.DeployArmTemplates.FailNotice, constants_2.PluginDisplayName.Solution, resourceGroupName, deploymentName);
|
|
244
|
+
errorMessage += `\nError message: ${error.message}\nDetailed message: \n${deploymentErrorMessage}\nGet toolkit help from ${constants_2.HelpLinks.ArmHelpLink}.`;
|
|
245
|
+
const notificationMessage = getNotificationMessage(deploymentError, deploymentName);
|
|
246
|
+
const returnError = new teamsfx_api_1.UserError(new Error(errorMessage), constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure, constants_2.HelpLinks.ArmHelpLink, notificationMessage);
|
|
220
247
|
returnError.innerError = JSON.stringify(deploymentErrorObj);
|
|
221
248
|
return teamsfx_api_1.err(returnError);
|
|
222
249
|
}
|
|
@@ -226,7 +253,86 @@ async function doDeployArmTemplates(ctx) {
|
|
|
226
253
|
}
|
|
227
254
|
}
|
|
228
255
|
exports.doDeployArmTemplates = doDeployArmTemplates;
|
|
229
|
-
function
|
|
256
|
+
async function doDeployArmTemplatesV3(ctx, inputs, envInfo, azureAccountProvider) {
|
|
257
|
+
var _a;
|
|
258
|
+
const progressHandler = await progressHelper_1.ProgressHelper.startDeployArmTemplatesProgressHandler(ctx.userInteraction);
|
|
259
|
+
await (progressHandler === null || progressHandler === void 0 ? void 0 : progressHandler.next(progressHelper_1.DeployArmTemplatesSteps.ExecuteDeployment));
|
|
260
|
+
// update parameters
|
|
261
|
+
const parameterJson = await getParameterJsonV3(ctx, inputs.projectPath, envInfo);
|
|
262
|
+
const envState = envInfo.state;
|
|
263
|
+
const resourceGroupName = envState.solution.resourceGroupName;
|
|
264
|
+
if (!resourceGroupName) {
|
|
265
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnSystemError(new Error("Failed to get resource group from project solution settings."), constants_1.SolutionSource, "NoResourceGroupFound"));
|
|
266
|
+
}
|
|
267
|
+
const bicepCommand = await bicepChecker_1.ensureBicep(ctx, inputs);
|
|
268
|
+
// Compile bicep file to json
|
|
269
|
+
const templateDir = path_1.default.join(inputs.projectPath, templatesFolder);
|
|
270
|
+
const bicepOrchestrationFilePath = path_1.default.join(templateDir, bicepOrchestrationFileName);
|
|
271
|
+
const armTemplateJson = await compileBicepToJson(bicepCommand, bicepOrchestrationFilePath, ctx.logProvider);
|
|
272
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.CompileBicepSuccessNotice, constants_2.PluginDisplayName.Solution));
|
|
273
|
+
// deploy arm templates to azure
|
|
274
|
+
const client = await getResourceManagementClientForArmDeployment(azureAccountProvider, envState.solution.subscriptionId);
|
|
275
|
+
const deploymentName = `${constants_2.PluginDisplayName.Solution}_deployment`.replace(" ", "_").toLowerCase();
|
|
276
|
+
const deploymentParameters = {
|
|
277
|
+
properties: {
|
|
278
|
+
parameters: parameterJson.parameters,
|
|
279
|
+
template: armTemplateJson,
|
|
280
|
+
mode: "Incremental",
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
const deployCtx = {
|
|
284
|
+
ctx: ctx,
|
|
285
|
+
finished: false,
|
|
286
|
+
deploymentStartTime: Date.now(),
|
|
287
|
+
client: client,
|
|
288
|
+
resourceGroupName: resourceGroupName,
|
|
289
|
+
deploymentName: deploymentName,
|
|
290
|
+
};
|
|
291
|
+
try {
|
|
292
|
+
const result = client.deployments
|
|
293
|
+
.createOrUpdate(resourceGroupName, deploymentName, deploymentParameters)
|
|
294
|
+
.then((result) => {
|
|
295
|
+
var _a, _b;
|
|
296
|
+
(_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));
|
|
297
|
+
syncArmOutput(envInfo, (_b = result.properties) === null || _b === void 0 ? void 0 : _b.outputs);
|
|
298
|
+
return result;
|
|
299
|
+
})
|
|
300
|
+
.finally(() => {
|
|
301
|
+
deployCtx.finished = true;
|
|
302
|
+
});
|
|
303
|
+
await pollDeploymentStatus(deployCtx);
|
|
304
|
+
await result;
|
|
305
|
+
return teamsfx_api_1.ok(undefined);
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
// return the error if the template is invalid
|
|
309
|
+
if (error.code === InvalidTemplateErrorCode) {
|
|
310
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToValidateArmTemplates));
|
|
311
|
+
}
|
|
312
|
+
// try to get deployment error
|
|
313
|
+
const result = await wrapGetDeploymentError(deployCtx, resourceGroupName, deploymentName);
|
|
314
|
+
if (result.isOk()) {
|
|
315
|
+
const deploymentError = result.value;
|
|
316
|
+
// return thrown error if deploymentError is empty
|
|
317
|
+
if (!deploymentError) {
|
|
318
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure));
|
|
319
|
+
}
|
|
320
|
+
const deploymentErrorObj = formattedDeploymentError(deploymentError);
|
|
321
|
+
const deploymentErrorMessage = JSON.stringify(deploymentErrorObj, undefined, 2);
|
|
322
|
+
let errorMessage = util_1.format(common_1.getStrings().solution.DeployArmTemplates.FailNotice, constants_2.PluginDisplayName.Solution, resourceGroupName, deploymentName);
|
|
323
|
+
errorMessage += `\nError message: ${error.message}\nDetailed message: \n${deploymentErrorMessage}\nGet toolkit help from ${constants_2.HelpLinks.ArmHelpLink}.`;
|
|
324
|
+
const notificationMessage = getNotificationMessage(deploymentError, deploymentName);
|
|
325
|
+
const returnError = new teamsfx_api_1.UserError(new Error(errorMessage), constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure, constants_2.HelpLinks.ArmHelpLink, notificationMessage);
|
|
326
|
+
returnError.innerError = JSON.stringify(deploymentErrorObj);
|
|
327
|
+
return teamsfx_api_1.err(returnError);
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
return result;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
exports.doDeployArmTemplatesV3 = doDeployArmTemplatesV3;
|
|
335
|
+
function syncArmOutput(envInfo, armOutput) {
|
|
230
336
|
var _a;
|
|
231
337
|
if (armOutput instanceof Object) {
|
|
232
338
|
const armOutputKeys = Object.keys(armOutput);
|
|
@@ -237,13 +343,19 @@ function syncArmOutput(ctx, armOutput) {
|
|
|
237
343
|
for (const moduleOutputKey of moduleOutputKeys) {
|
|
238
344
|
const pluginOutput = moduleOutput[moduleOutputKey].value;
|
|
239
345
|
if (pluginOutput instanceof Object) {
|
|
240
|
-
const pluginId = pluginOutput[
|
|
346
|
+
const pluginId = pluginOutput[constants_1.TEAMS_FX_RESOURCE_ID_KEY];
|
|
241
347
|
if (pluginId) {
|
|
242
348
|
const pluginOutputKeys = Object.keys(pluginOutput);
|
|
243
349
|
for (const pluginOutputKey of pluginOutputKeys) {
|
|
244
|
-
if (pluginOutputKey !=
|
|
245
|
-
(
|
|
246
|
-
|
|
350
|
+
if (pluginOutputKey != constants_1.TEAMS_FX_RESOURCE_ID_KEY) {
|
|
351
|
+
if (envInfo.state instanceof Map) {
|
|
352
|
+
(_a = envInfo.state
|
|
353
|
+
.get(pluginId)) === null || _a === void 0 ? void 0 : _a.set(pluginOutputKey, pluginOutput[pluginOutputKey]);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
envInfo.state[pluginId][pluginOutputKey] =
|
|
357
|
+
pluginOutput[pluginOutputKey];
|
|
358
|
+
}
|
|
247
359
|
}
|
|
248
360
|
}
|
|
249
361
|
}
|
|
@@ -255,58 +367,88 @@ function syncArmOutput(ctx, armOutput) {
|
|
|
255
367
|
}
|
|
256
368
|
async function deployArmTemplates(ctx) {
|
|
257
369
|
var _a, _b, _c;
|
|
258
|
-
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(
|
|
370
|
+
(_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
371
|
let result;
|
|
260
|
-
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(
|
|
261
|
-
[
|
|
372
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ArmDeploymentStart, {
|
|
373
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
262
374
|
});
|
|
263
375
|
try {
|
|
264
376
|
result = await doDeployArmTemplates(ctx);
|
|
265
377
|
if (result.isOk()) {
|
|
266
|
-
(_c = ctx.telemetryReporter) === null || _c === void 0 ? void 0 : _c.sendTelemetryEvent(
|
|
267
|
-
[
|
|
268
|
-
[
|
|
378
|
+
(_c = ctx.telemetryReporter) === null || _c === void 0 ? void 0 : _c.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ArmDeployment, {
|
|
379
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
380
|
+
[constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
|
|
269
381
|
});
|
|
270
382
|
}
|
|
271
383
|
else {
|
|
272
384
|
const errorProperties = {};
|
|
273
385
|
if (result.error.innerError) {
|
|
274
|
-
errorProperties[
|
|
386
|
+
errorProperties[constants_1.SolutionTelemetryProperty.ArmDeploymentError] = result.error.innerError;
|
|
275
387
|
}
|
|
276
|
-
|
|
388
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ArmDeployment, result.error, ctx.telemetryReporter, errorProperties);
|
|
277
389
|
}
|
|
278
390
|
}
|
|
279
391
|
catch (error) {
|
|
280
|
-
result = teamsfx_api_1.err(teamsfx_api_1.returnUserError(error,
|
|
281
|
-
|
|
392
|
+
result = teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure));
|
|
393
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ArmDeployment, result.error, ctx.telemetryReporter);
|
|
282
394
|
}
|
|
283
395
|
await progressHelper_1.ProgressHelper.endDeployArmTemplatesProgress(result.isOk());
|
|
284
396
|
return result;
|
|
285
397
|
}
|
|
286
398
|
exports.deployArmTemplates = deployArmTemplates;
|
|
287
|
-
async function
|
|
399
|
+
async function deployArmTemplatesV3(ctx, inputs, envInfo, azureAccountProvider) {
|
|
400
|
+
var _a, _b, _c;
|
|
401
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.info(util_1.format(common_1.getStrings().solution.DeployArmTemplates.StartNotice, constants_2.PluginDisplayName.Solution));
|
|
402
|
+
let result;
|
|
403
|
+
(_b = ctx.telemetryReporter) === null || _b === void 0 ? void 0 : _b.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ArmDeploymentStart, {
|
|
404
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
405
|
+
});
|
|
406
|
+
try {
|
|
407
|
+
result = await doDeployArmTemplatesV3(ctx, inputs, envInfo, azureAccountProvider);
|
|
408
|
+
if (result.isOk()) {
|
|
409
|
+
(_c = ctx.telemetryReporter) === null || _c === void 0 ? void 0 : _c.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ArmDeployment, {
|
|
410
|
+
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
411
|
+
[constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
const errorProperties = {};
|
|
416
|
+
if (result.error.innerError) {
|
|
417
|
+
errorProperties[constants_1.SolutionTelemetryProperty.ArmDeploymentError] = result.error.innerError;
|
|
418
|
+
}
|
|
419
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ArmDeployment, result.error, ctx.telemetryReporter, errorProperties);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
catch (error) {
|
|
423
|
+
result = teamsfx_api_1.err(teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToDeployArmTemplatesToAzure));
|
|
424
|
+
util_2.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ArmDeployment, result.error, ctx.telemetryReporter);
|
|
425
|
+
}
|
|
426
|
+
await progressHelper_1.ProgressHelper.endDeployArmTemplatesProgress(result.isOk());
|
|
427
|
+
return result;
|
|
428
|
+
}
|
|
429
|
+
exports.deployArmTemplatesV3 = deployArmTemplatesV3;
|
|
430
|
+
async function copyParameterJson(projectPath, appName, targetEnvName, sourceEnvName) {
|
|
288
431
|
var _a, _b, _c;
|
|
289
432
|
if (!targetEnvName || !sourceEnvName) {
|
|
290
433
|
return;
|
|
291
434
|
}
|
|
292
|
-
const parameterFolderPath = path_1.default.join(
|
|
435
|
+
const parameterFolderPath = path_1.default.join(projectPath, configsFolder);
|
|
293
436
|
const targetParameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, targetEnvName);
|
|
294
437
|
const sourceParameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, sourceEnvName);
|
|
295
438
|
const targetParameterFilePath = path_1.default.join(parameterFolderPath, targetParameterFileName);
|
|
296
439
|
const sourceParameterFilePath = path_1.default.join(parameterFolderPath, sourceParameterFileName);
|
|
297
440
|
const targetParameterContent = await fs.readJson(sourceParameterFilePath);
|
|
298
441
|
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
442
|
targetParameterContent[parameterName].provisionParameters.value.resourceBaseName =
|
|
301
443
|
generateResourceBaseName(appName, targetEnvName);
|
|
302
444
|
}
|
|
303
445
|
await fs.ensureDir(parameterFolderPath);
|
|
304
|
-
await fs.writeFile(targetParameterFilePath, JSON.stringify(targetParameterContent, undefined, 4));
|
|
446
|
+
await fs.writeFile(targetParameterFilePath, JSON.stringify(targetParameterContent, undefined, 4).replace(/\r?\n/g, os_1.default.EOL));
|
|
305
447
|
}
|
|
306
448
|
exports.copyParameterJson = copyParameterJson;
|
|
307
449
|
async function getParameterJson(ctx) {
|
|
308
|
-
var _a
|
|
309
|
-
if (!
|
|
450
|
+
var _a;
|
|
451
|
+
if (!ctx.envInfo.envName) {
|
|
310
452
|
throw new Error("Failed to get target environment name from solution context.");
|
|
311
453
|
}
|
|
312
454
|
const parameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, ctx.envInfo.envName);
|
|
@@ -316,14 +458,34 @@ async function getParameterJson(ctx) {
|
|
|
316
458
|
await fs.stat(parameterFilePath);
|
|
317
459
|
}
|
|
318
460
|
catch (err) {
|
|
319
|
-
(
|
|
320
|
-
const returnError = new Error(`[${
|
|
321
|
-
throw teamsfx_api_1.returnUserError(returnError,
|
|
461
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] ${parameterFilePath} does not exist.`);
|
|
462
|
+
const returnError = new Error(`[${constants_2.PluginDisplayName.Solution}] ${parameterFilePath} does not exist.`);
|
|
463
|
+
throw teamsfx_api_1.returnUserError(returnError, constants_1.SolutionSource, "ParameterFileNotExist");
|
|
322
464
|
}
|
|
323
465
|
const parameterJson = await getExpandedParameter(ctx, parameterFilePath); // only expand secrets in memory
|
|
324
466
|
return parameterJson;
|
|
325
467
|
}
|
|
326
468
|
exports.getParameterJson = getParameterJson;
|
|
469
|
+
async function getParameterJsonV3(ctx, projectPath, envInfo) {
|
|
470
|
+
var _a;
|
|
471
|
+
if (!(envInfo === null || envInfo === void 0 ? void 0 : envInfo.envName)) {
|
|
472
|
+
throw new Error("Failed to get target environment name from solution context.");
|
|
473
|
+
}
|
|
474
|
+
const parameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, envInfo.envName);
|
|
475
|
+
const parameterFolderPath = path_1.default.join(projectPath, configsFolder);
|
|
476
|
+
const parameterFilePath = path_1.default.join(parameterFolderPath, parameterFileName);
|
|
477
|
+
try {
|
|
478
|
+
await fs.stat(parameterFilePath);
|
|
479
|
+
}
|
|
480
|
+
catch (err) {
|
|
481
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] ${parameterFilePath} does not exist.`);
|
|
482
|
+
const returnError = new Error(`[${constants_2.PluginDisplayName.Solution}] ${parameterFilePath} does not exist.`);
|
|
483
|
+
throw teamsfx_api_1.returnUserError(returnError, constants_1.SolutionSource, "ParameterFileNotExist");
|
|
484
|
+
}
|
|
485
|
+
const parameterJson = await getExpandedParameterV3(ctx, envInfo, parameterFilePath); // only expand secrets in memory
|
|
486
|
+
return parameterJson;
|
|
487
|
+
}
|
|
488
|
+
exports.getParameterJsonV3 = getParameterJsonV3;
|
|
327
489
|
function generateArmFromResult(result, bicepOrchestrationTemplate, pluginWithArm, moduleProvisionFiles, moduleConfigFiles) {
|
|
328
490
|
var _a, _b;
|
|
329
491
|
bicepOrchestrationTemplate.applyTemplate(pluginWithArm.name, result);
|
|
@@ -343,28 +505,29 @@ function generateArmFromResult(result, bicepOrchestrationTemplate, pluginWithArm
|
|
|
343
505
|
}
|
|
344
506
|
}
|
|
345
507
|
async function doGenerateArmTemplate(ctx, selectedPlugins) {
|
|
346
|
-
var _a, _b, _c;
|
|
508
|
+
var _a, _b, _c, _d;
|
|
347
509
|
const azureSolutionSettings = (_a = ctx.projectSettings) === null || _a === void 0 ? void 0 : _a.solutionSettings;
|
|
348
510
|
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
|
|
511
|
+
const plugins = ResourcePluginContainer_1.getActivatedV2ResourcePlugins(azureSolutionSettings).map((p) => new adaptor_1.NamedArmResourcePluginAdaptor(p)); // This function ensures return result won't be empty
|
|
352
512
|
const bicepOrchestrationTemplate = new BicepOrchestrationContent(plugins.map((p) => p.name), baseName);
|
|
353
513
|
const moduleProvisionFiles = new Map();
|
|
354
514
|
const moduleConfigFiles = new Map();
|
|
355
515
|
// Get bicep content from each resource plugin
|
|
356
516
|
for (const plugin of plugins) {
|
|
357
517
|
const pluginWithArm = plugin; // Temporary solution before adding it to teamsfx-api
|
|
358
|
-
const pluginContext =
|
|
518
|
+
const pluginContext = util_2.getPluginContext(ctx, pluginWithArm.name);
|
|
359
519
|
let result;
|
|
360
520
|
let errMessage = "";
|
|
521
|
+
let method = "";
|
|
361
522
|
if (pluginWithArm.updateArmTemplates &&
|
|
362
523
|
!selectedPlugins.find((pluginItem) => pluginItem.name === pluginWithArm.name)) {
|
|
524
|
+
method = "updateArmTemplates";
|
|
363
525
|
result = (await pluginWithArm.updateArmTemplates(pluginContext));
|
|
364
526
|
errMessage = common_1.getStrings().solution.UpdateArmTemplateFailNotice;
|
|
365
527
|
}
|
|
366
528
|
else if (pluginWithArm.generateArmTemplates &&
|
|
367
529
|
selectedPlugins.find((pluginItem) => pluginItem.name === pluginWithArm.name)) {
|
|
530
|
+
method = "generateArmTemplates";
|
|
368
531
|
result = (await pluginWithArm.generateArmTemplates(pluginContext));
|
|
369
532
|
errMessage = common_1.getStrings().solution.GenerateArmTemplateFailNotice;
|
|
370
533
|
}
|
|
@@ -372,22 +535,69 @@ async function doGenerateArmTemplate(ctx, selectedPlugins) {
|
|
|
372
535
|
continue;
|
|
373
536
|
}
|
|
374
537
|
if (result.isOk()) {
|
|
538
|
+
(_b = ctx.logProvider) === null || _b === void 0 ? void 0 : _b.info(`[arm] ${plugin.name}.${method} success!`);
|
|
375
539
|
generateArmFromResult(result.value, bicepOrchestrationTemplate, pluginWithArm, moduleProvisionFiles, moduleConfigFiles);
|
|
376
540
|
}
|
|
377
541
|
else {
|
|
378
|
-
const msg =
|
|
379
|
-
(
|
|
542
|
+
const msg = util_1.format(errMessage, (_c = ctx.projectSettings) === null || _c === void 0 ? void 0 : _c.appName);
|
|
543
|
+
(_d = ctx.logProvider) === null || _d === void 0 ? void 0 : _d.error(msg);
|
|
380
544
|
return result;
|
|
381
545
|
}
|
|
382
546
|
}
|
|
547
|
+
await persistBicepTemplates(bicepOrchestrationTemplate, moduleProvisionFiles, moduleConfigFiles, ctx.root);
|
|
548
|
+
return teamsfx_api_1.ok(undefined); // Nothing to return when success
|
|
549
|
+
}
|
|
550
|
+
async function doGenerateArmTemplateV3(ctx, inputs, activatedPlugins, addedPlugins) {
|
|
551
|
+
var _a;
|
|
552
|
+
const baseName = generateResourceBaseName(ctx.projectSetting.appName, "");
|
|
553
|
+
const bicepOrchestrationTemplate = new BicepOrchestrationContent(activatedPlugins.map((p) => p.name), baseName);
|
|
554
|
+
const moduleProvisionFiles = new Map();
|
|
555
|
+
const moduleConfigFiles = new Map();
|
|
556
|
+
const addedSet = new Set();
|
|
557
|
+
addedPlugins.forEach((p) => addedSet.add(p.name));
|
|
558
|
+
for (const plugin of activatedPlugins) {
|
|
559
|
+
let result;
|
|
560
|
+
let errMessage = "";
|
|
561
|
+
let method = "";
|
|
562
|
+
const isAdd = addedSet.has(plugin.name);
|
|
563
|
+
if (plugin.updateResourceTemplate && !isAdd) {
|
|
564
|
+
result = await plugin.updateResourceTemplate(ctx, inputs);
|
|
565
|
+
errMessage = common_1.getStrings().solution.UpdateArmTemplateFailNotice;
|
|
566
|
+
method = "updateResourceTemplate";
|
|
567
|
+
}
|
|
568
|
+
else if (plugin.generateResourceTemplate && isAdd) {
|
|
569
|
+
result = await plugin.generateResourceTemplate(ctx, inputs);
|
|
570
|
+
errMessage = common_1.getStrings().solution.GenerateArmTemplateFailNotice;
|
|
571
|
+
method = "generateResourceTemplate";
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
continue;
|
|
575
|
+
}
|
|
576
|
+
if (result.isOk()) {
|
|
577
|
+
ctx.logProvider.info(`[arm] ${plugin.name}.${method} success!`);
|
|
578
|
+
if (result.value.kind === "bicep") {
|
|
579
|
+
const armTemplate = result.value.template;
|
|
580
|
+
generateArmFromResult(armTemplate, bicepOrchestrationTemplate, plugin, moduleProvisionFiles, moduleConfigFiles);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
else {
|
|
584
|
+
const msg = util_1.format(errMessage, ctx.projectSetting.appName);
|
|
585
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(msg);
|
|
586
|
+
return result;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
await persistBicepTemplates(bicepOrchestrationTemplate, moduleProvisionFiles, moduleConfigFiles, inputs.projectPath);
|
|
590
|
+
return teamsfx_api_1.ok(undefined); // Nothing to return when success
|
|
591
|
+
}
|
|
592
|
+
async function persistBicepTemplates(bicepOrchestrationTemplate, moduleProvisionFiles, moduleConfigFiles, projectaPath) {
|
|
383
593
|
// Write bicep content to project folder
|
|
384
594
|
if (bicepOrchestrationTemplate.needsGenerateTemplate()) {
|
|
385
595
|
// Output parameter file
|
|
386
|
-
const envListResult = await
|
|
596
|
+
const envListResult = await environment_1.environmentManager.listEnvConfigs(projectaPath);
|
|
387
597
|
if (envListResult.isErr()) {
|
|
388
598
|
return teamsfx_api_1.err(envListResult.error);
|
|
389
599
|
}
|
|
390
|
-
const parameterEnvFolderPath = path_1.default.join(
|
|
600
|
+
const parameterEnvFolderPath = path_1.default.join(projectaPath, configsFolder);
|
|
391
601
|
await fs.ensureDir(parameterEnvFolderPath);
|
|
392
602
|
for (const env of envListResult.value) {
|
|
393
603
|
const parameterFileName = parameterFileNameTemplate.replace(teamsfx_api_1.EnvNamePlaceholder, env);
|
|
@@ -401,33 +611,33 @@ async function doGenerateArmTemplate(ctx, selectedPlugins) {
|
|
|
401
611
|
const duplicateParam = Object.keys(parameterObj).filter((val) => Object.keys(appendParam).includes(val));
|
|
402
612
|
if (duplicateParam && duplicateParam.length != 0) {
|
|
403
613
|
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,
|
|
614
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(duplicateParamError, constants_1.SolutionSource, constants_1.SolutionError.FailedToUpdateArmParameters, constants_2.HelpLinks.ArmHelpLink));
|
|
405
615
|
}
|
|
406
616
|
parameterFile.parameters.provisionParameters.value = Object.assign(parameterObj, appendParam);
|
|
407
617
|
parameterFileContent = JSON.stringify(parameterFile, undefined, 2);
|
|
408
618
|
}
|
|
409
619
|
catch (error) {
|
|
410
620
|
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,
|
|
621
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(parameterFileError, constants_1.SolutionSource, constants_1.SolutionError.FailedToUpdateArmParameters, constants_2.HelpLinks.ArmHelpLink));
|
|
412
622
|
}
|
|
413
623
|
}
|
|
414
624
|
else {
|
|
415
625
|
parameterFileContent = bicepOrchestrationTemplate.getParameterFileContent();
|
|
416
626
|
}
|
|
417
|
-
await fs.writeFile(parameterEnvFilePath, parameterFileContent);
|
|
627
|
+
await fs.writeFile(parameterEnvFilePath, parameterFileContent.replace(/\r?\n/g, os_1.default.EOL));
|
|
418
628
|
}
|
|
419
629
|
// Generate main.bicep, config.bicep, provision.bicep
|
|
420
|
-
const templateFolderPath = path_1.default.join(
|
|
630
|
+
const templateFolderPath = path_1.default.join(projectaPath, templatesFolder);
|
|
421
631
|
await fs.ensureDir(templateFolderPath);
|
|
422
632
|
await fs.ensureDir(path_1.default.join(templateFolderPath, "teamsFx"));
|
|
423
633
|
await fs.ensureDir(path_1.default.join(templateFolderPath, "provision"));
|
|
424
634
|
let bicepOrchestrationProvisionContent = "";
|
|
425
635
|
let bicepOrchestrationConfigContent = "";
|
|
426
636
|
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"),
|
|
637
|
+
bicepOrchestrationProvisionContent = await fs.readFile(path_1.default.join(folder_1.getTemplatesFolder(), "plugins", "solution", "provision.bicep"), constants_2.ConstantString.UTF8Encoding);
|
|
428
638
|
}
|
|
429
639
|
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"),
|
|
640
|
+
bicepOrchestrationConfigContent = await fs.readFile(path_1.default.join(folder_1.getTemplatesFolder(), "plugins", "solution", "config.bicep"), constants_2.ConstantString.UTF8Encoding);
|
|
431
641
|
}
|
|
432
642
|
bicepOrchestrationProvisionContent +=
|
|
433
643
|
os_1.default.EOL + bicepOrchestrationTemplate.getOrchestractionProvisionContent();
|
|
@@ -437,42 +647,51 @@ async function doGenerateArmTemplate(ctx, selectedPlugins) {
|
|
|
437
647
|
if (!(await fs.pathExists(path_1.default.join(templateFolderPath, bicepOrchestrationFileName)))) {
|
|
438
648
|
await fs.copyFile(path_1.default.join(templateSolitionPath, bicepOrchestrationFileName), path_1.default.join(templateFolderPath, bicepOrchestrationFileName));
|
|
439
649
|
}
|
|
440
|
-
await fs.appendFile(path_1.default.join(templateFolderPath, bicepOrchestrationProvisionFileName), bicepOrchestrationProvisionContent);
|
|
441
|
-
await fs.appendFile(path_1.default.join(templateFolderPath, bicepOrchestrationConfigFileName), bicepOrchestrationConfigContent);
|
|
650
|
+
await fs.appendFile(path_1.default.join(templateFolderPath, bicepOrchestrationProvisionFileName), bicepOrchestrationProvisionContent.replace(/\r?\n/g, os_1.default.EOL));
|
|
651
|
+
await fs.appendFile(path_1.default.join(templateFolderPath, bicepOrchestrationConfigFileName), bicepOrchestrationConfigContent.replace(/\r?\n/g, os_1.default.EOL));
|
|
442
652
|
// Generate module provision bicep files
|
|
443
653
|
for (const module of moduleProvisionFiles) {
|
|
444
654
|
const res = bicepOrchestrationTemplate.applyReference(module[1]);
|
|
445
|
-
await fs.appendFile(path_1.default.join(templateFolderPath, module[0]), res);
|
|
655
|
+
await fs.appendFile(path_1.default.join(templateFolderPath, module[0]), res.replace(/\r?\n/g, os_1.default.EOL));
|
|
446
656
|
}
|
|
447
657
|
// Generate module configuration bicep files
|
|
448
658
|
for (const module of moduleConfigFiles) {
|
|
449
659
|
const res = bicepOrchestrationTemplate.applyReference(module[1]);
|
|
450
|
-
await fs.writeFile(path_1.default.join(templateFolderPath, module[0]), res);
|
|
660
|
+
await fs.writeFile(path_1.default.join(templateFolderPath, module[0]), res.replace(/\r?\n/g, os_1.default.EOL));
|
|
451
661
|
}
|
|
452
662
|
}
|
|
453
|
-
return teamsfx_api_1.ok(undefined); // Nothing to return when success
|
|
454
663
|
}
|
|
455
664
|
async function getExpandedParameter(ctx, filePath) {
|
|
456
665
|
var _a;
|
|
457
666
|
try {
|
|
458
|
-
const parameterTemplate = await fs.readFile(filePath,
|
|
667
|
+
const parameterTemplate = await fs.readFile(filePath, constants_2.ConstantString.UTF8Encoding);
|
|
459
668
|
const parameterJsonString = expandParameterPlaceholders(ctx, parameterTemplate);
|
|
460
669
|
return JSON.parse(parameterJsonString);
|
|
461
670
|
}
|
|
462
671
|
catch (err) {
|
|
463
|
-
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${
|
|
672
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] Failed to get expanded parameter from ${filePath}.`);
|
|
464
673
|
throw err;
|
|
465
674
|
}
|
|
466
675
|
}
|
|
467
|
-
async function
|
|
468
|
-
var _a
|
|
469
|
-
|
|
676
|
+
async function getExpandedParameterV3(ctx, envInfo, filePath) {
|
|
677
|
+
var _a;
|
|
678
|
+
try {
|
|
679
|
+
const parameterTemplate = await fs.readFile(filePath, constants_2.ConstantString.UTF8Encoding);
|
|
680
|
+
const parameterJsonString = expandParameterPlaceholdersV3(ctx, envInfo, parameterTemplate);
|
|
681
|
+
return JSON.parse(parameterJsonString);
|
|
682
|
+
}
|
|
683
|
+
catch (err) {
|
|
684
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] Failed to get expanded parameter from ${filePath}.`);
|
|
685
|
+
throw err;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
async function getResourceManagementClientForArmDeployment(azureAccountProvider, subscriptionId) {
|
|
689
|
+
const azureToken = await azureAccountProvider.getAccountCredentialAsync();
|
|
470
690
|
if (!azureToken) {
|
|
471
|
-
throw teamsfx_api_1.returnSystemError(new Error("Azure Credential is invalid."),
|
|
691
|
+
throw teamsfx_api_1.returnSystemError(new Error("Azure Credential is invalid."), constants_2.PluginDisplayName.Solution, constants_1.SolutionError.FailedToGetAzureCredential);
|
|
472
692
|
}
|
|
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
693
|
if (!subscriptionId) {
|
|
475
|
-
throw teamsfx_api_1.returnSystemError(new Error(`Failed to get subscription id.`),
|
|
694
|
+
throw teamsfx_api_1.returnSystemError(new Error(`Failed to get subscription id.`), constants_2.PluginDisplayName.Solution, constants_1.SolutionError.NoSubscriptionSelected);
|
|
476
695
|
}
|
|
477
696
|
return new arm_resources_1.ResourceManagementClient(azureToken, subscriptionId);
|
|
478
697
|
}
|
|
@@ -488,32 +707,34 @@ async function compileBicepToJson(bicepCommand, bicepOrchestrationFilePath, logg
|
|
|
488
707
|
// Context used by handlebars to render the main.bicep file
|
|
489
708
|
class ArmTemplateRenderContext {
|
|
490
709
|
constructor(pluginNames) {
|
|
491
|
-
this.Plugins =
|
|
492
|
-
|
|
710
|
+
this.Plugins = {};
|
|
711
|
+
for (const plugin of pluginNames) {
|
|
712
|
+
this.Plugins[plugin] = {};
|
|
713
|
+
}
|
|
493
714
|
}
|
|
494
715
|
addPluginOutput(pluginName, armResult) {
|
|
495
|
-
var _a, _b
|
|
496
|
-
const
|
|
716
|
+
var _a, _b;
|
|
717
|
+
const PluginContext = {
|
|
497
718
|
Provision: {},
|
|
498
719
|
Configuration: {},
|
|
499
720
|
References: {},
|
|
500
721
|
};
|
|
501
722
|
const provision = (_a = armResult.Provision) === null || _a === void 0 ? void 0 : _a.Modules;
|
|
502
|
-
const references =
|
|
503
|
-
const configs = (
|
|
723
|
+
const references = armResult.Reference;
|
|
724
|
+
const configs = (_b = armResult.Configuration) === null || _b === void 0 ? void 0 : _b.Modules;
|
|
504
725
|
if (provision) {
|
|
505
726
|
for (const module of Object.entries(provision)) {
|
|
506
727
|
const moduleFileName = module[0];
|
|
507
|
-
|
|
508
|
-
|
|
728
|
+
PluginContext.Provision[moduleFileName] = {
|
|
729
|
+
path: generateBicepModuleProvisionFilePath(moduleFileName),
|
|
509
730
|
};
|
|
510
731
|
}
|
|
511
732
|
}
|
|
512
733
|
if (configs) {
|
|
513
734
|
for (const module of Object.entries(configs)) {
|
|
514
735
|
const moduleFileName = module[0];
|
|
515
|
-
|
|
516
|
-
|
|
736
|
+
PluginContext.Configuration[moduleFileName] = {
|
|
737
|
+
path: generateBicepModuleConfigFilePath(moduleFileName),
|
|
517
738
|
};
|
|
518
739
|
}
|
|
519
740
|
}
|
|
@@ -521,10 +742,10 @@ class ArmTemplateRenderContext {
|
|
|
521
742
|
for (const output of Object.entries(references)) {
|
|
522
743
|
const outputKey = output[0];
|
|
523
744
|
const outputValue = output[1];
|
|
524
|
-
|
|
745
|
+
PluginContext.References[outputKey] = outputValue;
|
|
525
746
|
}
|
|
526
747
|
}
|
|
527
|
-
this.
|
|
748
|
+
this.Plugins[pluginName] = PluginContext;
|
|
528
749
|
}
|
|
529
750
|
}
|
|
530
751
|
exports.ArmTemplateRenderContext = ArmTemplateRenderContext;
|
|
@@ -536,25 +757,25 @@ class BicepOrchestrationContent {
|
|
|
536
757
|
this.ProvisionTemplate = "";
|
|
537
758
|
this.ConfigTemplate = "";
|
|
538
759
|
this.ParameterJsonTemplate[resourceBaseName] = baseName;
|
|
539
|
-
this.
|
|
760
|
+
this.RenderContext = new ArmTemplateRenderContext(pluginNames);
|
|
540
761
|
}
|
|
541
762
|
applyTemplate(pluginName, armResult) {
|
|
542
763
|
var _a, _b;
|
|
543
764
|
this.ProvisionTemplate += this.normalizeTemplateSnippet((_a = armResult.Provision) === null || _a === void 0 ? void 0 : _a.Orchestration);
|
|
544
765
|
this.ConfigTemplate += this.normalizeTemplateSnippet((_b = armResult.Configuration) === null || _b === void 0 ? void 0 : _b.Orchestration);
|
|
545
|
-
this.
|
|
766
|
+
this.RenderContext.addPluginOutput(pluginName, armResult);
|
|
546
767
|
Object.assign(this.ParameterJsonTemplate, armResult.Parameters);
|
|
547
768
|
}
|
|
548
769
|
applyReference(configContent) {
|
|
549
|
-
return common_1.compileHandlebarsTemplateString(configContent, this.
|
|
770
|
+
return common_1.compileHandlebarsTemplateString(configContent, this.RenderContext.Plugins);
|
|
550
771
|
}
|
|
551
772
|
getOrchestractionProvisionContent() {
|
|
552
|
-
const orchestrationTemplate = this.normalizeTemplateSnippet(this.ProvisionTemplate, false) +
|
|
553
|
-
return common_1.compileHandlebarsTemplateString(orchestrationTemplate, this.
|
|
773
|
+
const orchestrationTemplate = this.normalizeTemplateSnippet(this.ProvisionTemplate, false) + os_1.default.EOL;
|
|
774
|
+
return common_1.compileHandlebarsTemplateString(orchestrationTemplate, this.RenderContext.Plugins).trim();
|
|
554
775
|
}
|
|
555
776
|
getOrchestractionConfigContent() {
|
|
556
|
-
const orchestrationTemplate = this.normalizeTemplateSnippet(this.ConfigTemplate, false) +
|
|
557
|
-
return common_1.compileHandlebarsTemplateString(orchestrationTemplate, this.
|
|
777
|
+
const orchestrationTemplate = this.normalizeTemplateSnippet(this.ConfigTemplate, false) + os_1.default.EOL;
|
|
778
|
+
return common_1.compileHandlebarsTemplateString(orchestrationTemplate, this.RenderContext.Plugins).trim();
|
|
558
779
|
}
|
|
559
780
|
getParameterFileContent() {
|
|
560
781
|
const parameterObject = {
|
|
@@ -579,7 +800,7 @@ class BicepOrchestrationContent {
|
|
|
579
800
|
if (updateTemplateChangeFlag) {
|
|
580
801
|
this.TemplateAdded = true;
|
|
581
802
|
}
|
|
582
|
-
return snippet.trim() +
|
|
803
|
+
return snippet.trim() + os_1.default.EOL;
|
|
583
804
|
}
|
|
584
805
|
return "";
|
|
585
806
|
}
|
|
@@ -593,14 +814,12 @@ function generateBicepModuleConfigFilePath(moduleFileName) {
|
|
|
593
814
|
function expandParameterPlaceholders(ctx, parameterContent) {
|
|
594
815
|
var _a;
|
|
595
816
|
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
|
|
817
|
+
const plugins = ResourcePluginContainer_1.getActivatedV2ResourcePlugins(azureSolutionSettings).map((p) => new adaptor_1.NamedArmResourcePluginAdaptor(p)); // This function ensures return result won't be empty
|
|
599
818
|
const stateVariables = {};
|
|
600
819
|
const availableVariables = { state: stateVariables };
|
|
601
820
|
// Add plugin contexts to available variables
|
|
602
821
|
for (const plugin of plugins) {
|
|
603
|
-
const pluginContext =
|
|
822
|
+
const pluginContext = util_2.getPluginContext(ctx, plugin.name);
|
|
604
823
|
const pluginVariables = {};
|
|
605
824
|
for (const configItem of pluginContext.config) {
|
|
606
825
|
if (typeof configItem[1] === "string") {
|
|
@@ -611,7 +830,7 @@ function expandParameterPlaceholders(ctx, parameterContent) {
|
|
|
611
830
|
stateVariables[plugin.name] = pluginVariables;
|
|
612
831
|
}
|
|
613
832
|
// Add solution config to available variables
|
|
614
|
-
const solutionConfig = ctx.envInfo.state.get(
|
|
833
|
+
const solutionConfig = ctx.envInfo.state.get(constants_1.GLOBAL_CONFIG);
|
|
615
834
|
if (solutionConfig) {
|
|
616
835
|
const solutionVariables = {};
|
|
617
836
|
for (const configItem of solutionConfig) {
|
|
@@ -630,6 +849,45 @@ function expandParameterPlaceholders(ctx, parameterContent) {
|
|
|
630
849
|
availableVariables["$env"] = processVariables;
|
|
631
850
|
return common_1.compileHandlebarsTemplateString(parameterContent, availableVariables);
|
|
632
851
|
}
|
|
852
|
+
function expandParameterPlaceholdersV3(ctx, envInfo, parameterContent) {
|
|
853
|
+
const azureSolutionSettings = ctx.projectSetting.solutionSettings;
|
|
854
|
+
const plugins = azureSolutionSettings.activeResourcePlugins.map((p) => typedi_1.Container.get(p));
|
|
855
|
+
const stateVariables = {};
|
|
856
|
+
const availableVariables = { state: stateVariables };
|
|
857
|
+
const envState = envInfo.state;
|
|
858
|
+
// Add plugin contexts to available variables
|
|
859
|
+
for (const plugin of plugins) {
|
|
860
|
+
const resourceState = envState[plugin.name] || {};
|
|
861
|
+
// const pluginContext = getPluginContext(ctx, plugin.name);
|
|
862
|
+
const pluginVariables = {};
|
|
863
|
+
for (const key of Object.keys(resourceState)) {
|
|
864
|
+
if (typeof resourceState[key] === "string") {
|
|
865
|
+
// Currently we only config with string type
|
|
866
|
+
pluginVariables[key] = resourceState[key];
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
stateVariables[plugin.name] = pluginVariables;
|
|
870
|
+
}
|
|
871
|
+
// Add solution config to available variables
|
|
872
|
+
const solutionConfig = envState.solution;
|
|
873
|
+
if (solutionConfig) {
|
|
874
|
+
const solutionVariables = {};
|
|
875
|
+
for (const key of Object.keys(solutionConfig)) {
|
|
876
|
+
if (typeof solutionConfig[key] === "string") {
|
|
877
|
+
// Currently we only config with string type
|
|
878
|
+
solutionVariables[key] = solutionConfig[key];
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
stateVariables[solutionName] = solutionVariables;
|
|
882
|
+
}
|
|
883
|
+
// Add environment variable to available variables
|
|
884
|
+
const processVariables = Object.keys(process.env).reduce((obj, key) => {
|
|
885
|
+
obj[key] = process.env[key];
|
|
886
|
+
return obj;
|
|
887
|
+
}, {});
|
|
888
|
+
availableVariables["$env"] = processVariables;
|
|
889
|
+
return common_1.compileHandlebarsTemplateString(parameterContent, availableVariables);
|
|
890
|
+
}
|
|
633
891
|
function generateResourceBaseName(appName, envName) {
|
|
634
892
|
const maxAppNameLength = 10;
|
|
635
893
|
const maxEnvNameLength = 4;
|
|
@@ -646,9 +904,9 @@ async function wrapGetDeploymentError(deployCtx, resourceGroupName, deploymentNa
|
|
|
646
904
|
return teamsfx_api_1.ok(deploymentError);
|
|
647
905
|
}
|
|
648
906
|
catch (error) {
|
|
649
|
-
(_a = deployCtx.ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${
|
|
907
|
+
(_a = deployCtx.ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(`[${constants_2.PluginDisplayName.Solution}] Failed to get deployment error for ${error.message}.`);
|
|
650
908
|
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,
|
|
909
|
+
return teamsfx_api_1.err(teamsfx_api_1.returnUserError(returnError, constants_1.SolutionSource, "GetDeploymentErrorFailed"));
|
|
652
910
|
}
|
|
653
911
|
}
|
|
654
912
|
async function getDeploymentError(deployCtx, resourceGroupName, deploymentName) {
|
|
@@ -659,7 +917,7 @@ async function getDeploymentError(deployCtx, resourceGroupName, deploymentName)
|
|
|
659
917
|
}
|
|
660
918
|
catch (error) {
|
|
661
919
|
if (deploymentName !== deployCtx.deploymentName &&
|
|
662
|
-
error.code ===
|
|
920
|
+
error.code === constants_2.ConstantString.DeploymentNotFound) {
|
|
663
921
|
return undefined;
|
|
664
922
|
}
|
|
665
923
|
throw error;
|
|
@@ -681,7 +939,7 @@ async function getDeploymentError(deployCtx, resourceGroupName, deploymentName)
|
|
|
681
939
|
error: operation.properties.statusMessage.error,
|
|
682
940
|
};
|
|
683
941
|
if (((_g = operation.properties.targetResource) === null || _g === void 0 ? void 0 : _g.resourceType) ===
|
|
684
|
-
|
|
942
|
+
constants_2.ConstantString.DeploymentResourceType &&
|
|
685
943
|
((_h = operation.properties.targetResource) === null || _h === void 0 ? void 0 : _h.resourceName) &&
|
|
686
944
|
((_j = operation.properties.targetResource) === null || _j === void 0 ? void 0 : _j.id)) {
|
|
687
945
|
const resourceGroupName = tools_1.getResourceGroupNameFromResourceId(operation.properties.targetResource.id);
|
|
@@ -694,10 +952,16 @@ async function getDeploymentError(deployCtx, resourceGroupName, deploymentName)
|
|
|
694
952
|
}
|
|
695
953
|
return deploymentError;
|
|
696
954
|
}
|
|
697
|
-
function
|
|
955
|
+
function getNotificationMessage(deploymentError, deploymentName) {
|
|
956
|
+
let failedDeployments = [];
|
|
957
|
+
if (deploymentError.subErrors) {
|
|
958
|
+
failedDeployments = Object.keys(deploymentError.subErrors);
|
|
959
|
+
}
|
|
960
|
+
else {
|
|
961
|
+
failedDeployments.push(deploymentName);
|
|
962
|
+
}
|
|
698
963
|
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);
|
|
964
|
+
return `resource deployments (${format.join(", ")}) for your project failed. Please refer to output channel for more error details.`;
|
|
701
965
|
}
|
|
702
966
|
function formattedDeploymentError(deploymentError) {
|
|
703
967
|
var _a, _b, _c;
|
|
@@ -723,4 +987,23 @@ function formattedDeploymentError(deploymentError) {
|
|
|
723
987
|
}
|
|
724
988
|
}
|
|
725
989
|
exports.formattedDeploymentError = formattedDeploymentError;
|
|
990
|
+
class ArmV2 {
|
|
991
|
+
async generateArmTemplate(ctx, selectedPlugins = []) {
|
|
992
|
+
return generateArmTemplate(ctx, selectedPlugins);
|
|
993
|
+
}
|
|
994
|
+
async deployArmTemplates(ctx) {
|
|
995
|
+
return deployArmTemplates(ctx);
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
class Arm {
|
|
999
|
+
async generateArmTemplate(ctx, inputs, activatedPlugins, addedPlugins) {
|
|
1000
|
+
return generateArmTemplateV3(ctx, inputs, activatedPlugins, addedPlugins);
|
|
1001
|
+
}
|
|
1002
|
+
async deployArmTemplates(ctx, inputs, envInfo, azureAccountProvider) {
|
|
1003
|
+
return deployArmTemplatesV3(ctx, inputs, envInfo, azureAccountProvider);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
const arm = new Arm();
|
|
1007
|
+
exports.armV2 = new ArmV2();
|
|
1008
|
+
exports.default = arm;
|
|
726
1009
|
//# sourceMappingURL=arm.js.map
|