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

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