@microsoft/teamsfx-core 1.1.2 → 1.1.3-alpha.e5227bb6.0

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