From 5e91456bb01b2cd376f2812e2b86a971f7330ee8 Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Thu, 21 Mar 2024 08:39:20 -0500 Subject: [PATCH 01/21] Corrected Experimental README --- experimental/README.md | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/experimental/README.md b/experimental/README.md index c23119c6bd..1ae37538d0 100644 --- a/experimental/README.md +++ b/experimental/README.md @@ -16,25 +16,6 @@ Each sample contains a reference to the backing GitHub issue(s) that frames the The samples found in this folder are experimental, do not necessarily relate to one another, are stand-alone, and are not meant to be viewed in any particular order. None of the samples in the **experimental** folder should be used with bots running in a production environment. -Experimental samples written in C# may have dependencies on assemblies pushed on the team's daily build feed. To understand how to use assemblies from the daily build feed refer to [Using MyGet to consume daily builds](https://github.com/microsoft/botbuilder-dotnet/blob/master/UsingMyGet.md) for further instructions. +Experimental samples written in C# may have dependencies on assemblies pushed on the team's daily build feed. To understand how to use assemblies from the daily build feed refer to [Consuming daily builds of the SDK](https://github.com/microsoft/botbuilder-dotnet/blob/master/dailyBuilds.md) for further instructions. - -## Experimental samples list - -Experimental samples are organized per platform. - - -| Sample Name | Description | .NET CORE | NodeJS | .NET Web API | Typescript | -|-----------------------|--------------------------------------------------------------------------------|-------------|-------------|--------------|-------------| -|multilingual-luis-bot| The sample shows how to use the library through Middleware to support multilingual interaction with bots in general and LUIS bots in particular. |[View][cs#1] | | | [View][ts#1] | - -[cs#1]: ./multilingual-luis/csharp_dotnetcore - -[cs#2]: ./qnamaker-activelearning/csharp_dotnetcore - -[wa#2]: ./csharp_webapi/# - -[ts#1]: ./multilingual-luis/javascript_typescript - -[js#1]: ./qnamaker-activelearning/javascript_nodejs From a35dcde62cc880e2fbeb49d9f2ebc69e9460baa8 Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Thu, 21 Mar 2024 09:10:05 -0500 Subject: [PATCH 02/21] Updated CLI Tools readme --- INSTALLING_CLI_TOOLS.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/INSTALLING_CLI_TOOLS.md b/INSTALLING_CLI_TOOLS.md index 2f45ea7147..7a77de878d 100644 --- a/INSTALLING_CLI_TOOLS.md +++ b/INSTALLING_CLI_TOOLS.md @@ -3,10 +3,3 @@ To learn more about the Bot Framework Command Line Tools, please visit the [BF CLI github repository](https://aka.ms/bfcli) or the [BF CLI Overview documentation](https://docs.microsoft.com/en-us/azure/bot-service/bf-cli-overview). - -## Legacy CLI Tools - -__The following page is about the legacy tools.__ - -The older, legacy, CLI tools can be found here: -https://github.com/Microsoft/botbuilder-tools From 93bf76460a12b6039c049d7dc1e3d4179a2902a4 Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Thu, 21 Mar 2024 09:12:45 -0500 Subject: [PATCH 03/21] Removed unneeded readme --- SPEC.md | 128 -------------------------------------------------------- 1 file changed, 128 deletions(-) delete mode 100644 SPEC.md diff --git a/SPEC.md b/SPEC.md deleted file mode 100644 index d521c54ccc..0000000000 --- a/SPEC.md +++ /dev/null @@ -1,128 +0,0 @@ -This specification outlines the requirements for botbuilder samples. - -## Goals -- Make it easy for developers to learn basic bot concepts -- Provide a numbering scheme for samples so developers can start simple and layer in sophistication -- Samples targeted at scenarios rather than technology involved -- Consistent set of samples across supported languages -- Samples are also consistently used in the docs topics for continuity and are developed by the documentation team, reviewed by the feature team. -- Each sample MUST include - - README with steps to run the sample, concepts involved and links to additional reading (docs) - - Deep link to V4 Emulator, include how to connect the Emulator to a locally running bot. - - .chat files as appropriate that provide scenario overview and demonstrates how to construct mock conversations for the specific scenario - - .lu files as appropriate - - Include source JSON model files for LUIS, Custom Question Answering, Dispatch where applicable - - Include LUISGen strong typed LUIS class for LUIS samples - - Any required build scripts for sample to work locally - - Well defined naming convention for setting, service endpoint, and secrets in setting files (appsettings.json, .env, etc.) - - deploymentTemplates folder with ARM templates to enable deploying to Azure -- All samples are built and deployable on local dev env (Emulator) and Azure (WebChat) - - Samples (and docs) should add channel specific notes (if applicable). e.g. document list of supported channels for Adaptive cards sample etc. - -## Samples structure - C# - | - README.md // Markdown readme file that includes steps to run this sample - (including steps to create and configure required services), - overview of concepts covered in this sample + links to - additional topics to read - | - Program.cs // Default program.cs - | - Startup.cs // Default startup.cs – configuration builder + middlewares - | - appsettings.json // Stores bot configuration information - | - appsettings.Development.json // Development environment configuraiton settings - | - Bots // Main ActivityHandler for the bot - | - Cards // Adaptive Cards if used by the sample - | - Controllers // ASP.net MVC Controllers - | - Dialogs // Multi-turn dialog classes - | - CognitiveModels - | - .luis // LUIS model file for this sample - | - .dispatch // Dispatch JSON model file - | - DeploymentTemplates - | - template-with-new-rg.json // ARM Template that creates a new Azure Resource Group - | - template-with-preexisting-rg.json // ARM Template that uses a preexisting Azure Resource Group - -## Samples structure - JS - - | - README.md // Markdown readme file that includes steps to run this sample - (including steps to create and configure required services), - overview of concepts covered in this sample + links to - additional topics to read - | - index.js // Default app.js - startup, middlewares - | - .env // Stores bot configuration information - | - bots - | - dialogs // Multi-turn dialog classes - | - cognitiveModels - | - .luis // LUIS model file for this sample - | - .dispatch // Dispatch JSON model file - | - deploymentTemplates - | - template-with-new-rg.json // ARM Template that creates a new Azure Resource Group - | - template-with-preexisting-rg.json // ARM Template that uses a preexisting Azure Resource Group - | - resources // Adaptive Card, LU, LG files - -## README.md template -Every samples *must* have a README.md file. The file must be named and cased as `README.md`. The README.md is meant to convey the following: - - Name of the sample - - Concepts introduced in the sample - - Prerequisites required to run the sample - - How to run the sample locally - - How to use the Emulator to debug the sample - - A link to the docs explaining how to deploy the sample to Azure - - Further reading section with topics and links to introduce additional topics to explore - -There are canonical examples of README.md files for each of the langues supported in the samples repo. Refer to these examples for how to write a README.md for any new sample proposals. -[.NET Core Example README.md](./csharp_dotnetcore/13.core-bot/README.md) -[JavaScript Example README.md](./javascript_nodejs/13.core-bot/README.md) -[TypeScript Example README.md](./javascript_typescript/13.core-bot/README.md) - - -## Static Code Analysis - -### StyleCop and Linting Rules -All JavaScript and TypeScript samples *must* be free of *all* lint rule warnings and errors. This includes any code generated by any of our code generator options (VSIX, Yeoman, .NET Templates). - -#### JavaScript Linting Rules -All JavaScript samples and generated code use eslint. All samples must use the following `.eslintrc.js` configuration file: - -```js -module.exports = { - "extends": "standard", - "rules": { - "semi": [2, "always"], - "indent": [2, 4], - "no-return-await": 0, - "space-before-function-paren": [2, { - "named": "never", - "anonymous": "never", - "asyncArrow": "always" - }], - "template-curly-spacing": [2, "always"] - } -}; -``` -#### TypeScript Linting Rules -All TypeScript samples and generated code currently use tslint. We will be moving to eslint in the future. For now, all TypeScript samples must use the following `.tslint.json` configuration file. - -```js -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "interface-name" : [true, "never-prefix"], - "max-line-length": [false], - "no-console": [false, "log", "error"], - "no-var-requires": false, - "quotemark": [true, "single"] - }, - "rulesDirectory": [] -} - -``` - -## Bot Styles -Our samples have consistent patterns for how to use the Bot Builder SDK. Strutural consistency is manditory for any sample published in the repo. Core Bot is a good sample to use as guidance. It contains variable naming conventions, idiomatic for each language, folder structure, README.md and ARM deployment templates that are the architype example of how a sample should be structured. - -[.NET Core Sample](./csharp_dotnetcore/13.core-bot/) -[JavaScript Sample](./javascript_nodejs/13.core-bot/) -[TypeScript Sample](./javascript_typescript/13.core-bot/) - From 9fd77a1747220ed3ab201fceb3806300ec03c474 Mon Sep 17 00:00:00 2001 From: gandiddi <164224646+gandiddi@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:46:54 +0530 Subject: [PATCH 04/21] Multi-turn prompt: Summarizing the collected information before asking to confirm if collected info is Ok. (#3957) * Multi-turn prompt: Summarizing the collected information before asking to confirm if collected info is Ok. * Fixing lint errors --- .../Dialogs/UserProfileDialog.cs | 74 ++++++++++--------- .../dialogs/userProfileDialog.js | 57 +++++++------- .../dialogs/user_profile_dialog.py | 68 ++++++++--------- 3 files changed, 106 insertions(+), 93 deletions(-) diff --git a/samples/csharp_dotnetcore/05.multi-turn-prompt/Dialogs/UserProfileDialog.cs b/samples/csharp_dotnetcore/05.multi-turn-prompt/Dialogs/UserProfileDialog.cs index cc6137756a..82c31716fa 100644 --- a/samples/csharp_dotnetcore/05.multi-turn-prompt/Dialogs/UserProfileDialog.cs +++ b/samples/csharp_dotnetcore/05.multi-turn-prompt/Dialogs/UserProfileDialog.cs @@ -30,8 +30,8 @@ public UserProfileDialog(UserState userState) NameConfirmStepAsync, AgeStepAsync, PictureStepAsync, - ConfirmStepAsync, SummaryStepAsync, + ConfirmStepAsync, }; // Add named dialogs to the DialogSet. These names are saved in the dialog state. @@ -127,54 +127,60 @@ private static async Task PictureStepAsync(WaterfallStepContex private async Task ConfirmStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { - stepContext.Values["picture"] = ((IList)stepContext.Result)?.FirstOrDefault(); + var msg = $"Thanks. "; - // WaterfallStep always finishes with the end of the Waterfall or with another dialog; here it is a Prompt Dialog. - return await stepContext.PromptAsync(nameof(ConfirmPrompt), new PromptOptions { Prompt = MessageFactory.Text("Is this ok?") }, cancellationToken); + if ((bool)stepContext.Result) + { + msg += $" Your profile saved successfully."; + } + else + { + msg += $" Your profile will not be kept."; + } + + await stepContext.Context.SendActivityAsync(MessageFactory.Text(msg), cancellationToken); + + // WaterfallStep always finishes with the end of the Waterfall or with another dialog; here it is the end. + return await stepContext.EndDialogAsync(cancellationToken: cancellationToken); } private async Task SummaryStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { - if ((bool)stepContext.Result) - { - // Get the current profile object from user state. - var userProfile = await _userProfileAccessor.GetAsync(stepContext.Context, () => new UserProfile(), cancellationToken); + stepContext.Values["picture"] = ((IList)stepContext.Result)?.FirstOrDefault(); - userProfile.Transport = (string)stepContext.Values["transport"]; - userProfile.Name = (string)stepContext.Values["name"]; - userProfile.Age = (int)stepContext.Values["age"]; - userProfile.Picture = (Attachment)stepContext.Values["picture"]; + // Get the current profile object from user state. + var userProfile = await _userProfileAccessor.GetAsync(stepContext.Context, () => new UserProfile(), cancellationToken); - var msg = $"I have your mode of transport as {userProfile.Transport} and your name as {userProfile.Name}"; + userProfile.Transport = (string)stepContext.Values["transport"]; + userProfile.Name = (string)stepContext.Values["name"]; + userProfile.Age = (int)stepContext.Values["age"]; + userProfile.Picture = (Attachment)stepContext.Values["picture"]; - if (userProfile.Age != -1) - { - msg += $" and your age as {userProfile.Age}"; - } + var msg = $"I have your mode of transport as {userProfile.Transport} and your name as {userProfile.Name}"; - msg += "."; + if (userProfile.Age != -1) + { + msg += $" and your age as {userProfile.Age}"; + } - await stepContext.Context.SendActivityAsync(MessageFactory.Text(msg), cancellationToken); + msg += "."; + + await stepContext.Context.SendActivityAsync(MessageFactory.Text(msg), cancellationToken); - if (userProfile.Picture != null) + if (userProfile.Picture != null) + { + try { - try - { - await stepContext.Context.SendActivityAsync(MessageFactory.Attachment(userProfile.Picture, "This is your profile picture."), cancellationToken); - } - catch - { - await stepContext.Context.SendActivityAsync(MessageFactory.Text("A profile picture was saved but could not be displayed here."), cancellationToken); - } + await stepContext.Context.SendActivityAsync(MessageFactory.Attachment(userProfile.Picture, "This is your profile picture."), cancellationToken); + } + catch + { + await stepContext.Context.SendActivityAsync(MessageFactory.Text("A profile picture was saved but could not be displayed here."), cancellationToken); } - } - else - { - await stepContext.Context.SendActivityAsync(MessageFactory.Text("Thanks. Your profile will not be kept."), cancellationToken); } - // WaterfallStep always finishes with the end of the Waterfall or with another dialog; here it is the end. - return await stepContext.EndDialogAsync(cancellationToken: cancellationToken); + // WaterfallStep always finishes with the end of the Waterfall or with another dialog; here it is a Prompt Dialog. + return await stepContext.PromptAsync(nameof(ConfirmPrompt), new PromptOptions { Prompt = MessageFactory.Text("Is this ok?") }, cancellationToken); } private static Task AgePromptValidatorAsync(PromptValidatorContext promptContext, CancellationToken cancellationToken) diff --git a/samples/javascript_nodejs/05.multi-turn-prompt/dialogs/userProfileDialog.js b/samples/javascript_nodejs/05.multi-turn-prompt/dialogs/userProfileDialog.js index 7da99eb9a0..a0905612c1 100644 --- a/samples/javascript_nodejs/05.multi-turn-prompt/dialogs/userProfileDialog.js +++ b/samples/javascript_nodejs/05.multi-turn-prompt/dialogs/userProfileDialog.js @@ -43,8 +43,8 @@ class UserProfileDialog extends ComponentDialog { this.nameConfirmStep.bind(this), this.ageStep.bind(this), this.pictureStep.bind(this), - this.confirmStep.bind(this), - this.summaryStep.bind(this) + this.summaryStep.bind(this), + this.confirmStep.bind(this) ])); this.initialDialogId = WATERFALL_DIALOG; @@ -128,42 +128,47 @@ class UserProfileDialog extends ComponentDialog { } async confirmStep(step) { - step.values.picture = step.result && step.result[0]; + let msg = 'Thanks.'; + if (step.result) { + msg += ' Your profile saved successfully.'; + } else { + msg += ' Your profile will not be kept.'; + } + + await step.context.sendActivity(msg); // WaterfallStep always finishes with the end of the Waterfall or with another dialog; here it is a Prompt Dialog. - return await step.prompt(CONFIRM_PROMPT, { prompt: 'Is this okay?' }); + return await step.endDialog(); } async summaryStep(step) { - if (step.result) { - // Get the current profile object from user state. - const userProfile = await this.userProfile.get(step.context, new UserProfile()); + step.values.picture = step.result && step.result[0]; - userProfile.transport = step.values.transport; - userProfile.name = step.values.name; - userProfile.age = step.values.age; - userProfile.picture = step.values.picture; + // Get the current profile object from user state. + const userProfile = await this.userProfile.get(step.context, new UserProfile()); - let msg = `I have your mode of transport as ${ userProfile.transport } and your name as ${ userProfile.name }`; - if (userProfile.age !== -1) { - msg += ` and your age as ${ userProfile.age }`; - } + userProfile.transport = step.values.transport; + userProfile.name = step.values.name; + userProfile.age = step.values.age; + userProfile.picture = step.values.picture; - msg += '.'; - await step.context.sendActivity(msg); - if (userProfile.picture) { - try { - await step.context.sendActivity(MessageFactory.attachment(userProfile.picture, 'This is your profile picture.')); - } catch { - await step.context.sendActivity('A profile picture was saved but could not be displayed here.'); - } + let msg = `I have your mode of transport as ${ userProfile.transport } and your name as ${ userProfile.name }`; + if (userProfile.age !== -1) { + msg += ` and your age as ${ userProfile.age }`; + } + + msg += '.'; + await step.context.sendActivity(msg); + if (userProfile.picture) { + try { + await step.context.sendActivity(MessageFactory.attachment(userProfile.picture, 'This is your profile picture.')); + } catch { + await step.context.sendActivity('A profile picture was saved but could not be displayed here.'); } - } else { - await step.context.sendActivity('Thanks. Your profile will not be kept.'); } // WaterfallStep always finishes with the end of the Waterfall or with another dialog; here it is the end. - return await step.endDialog(); + return await step.prompt(CONFIRM_PROMPT, { prompt: 'Is this okay?' }); } async agePromptValidator(promptContext) { diff --git a/samples/python/05.multi-turn-prompt/dialogs/user_profile_dialog.py b/samples/python/05.multi-turn-prompt/dialogs/user_profile_dialog.py index c1c679039c..62d89294d6 100644 --- a/samples/python/05.multi-turn-prompt/dialogs/user_profile_dialog.py +++ b/samples/python/05.multi-turn-prompt/dialogs/user_profile_dialog.py @@ -37,8 +37,8 @@ def __init__(self, user_state: UserState): self.name_confirm_step, self.age_step, self.picture_step, - self.confirm_step, self.summary_step, + self.confirm_step, ], ) ) @@ -152,56 +152,58 @@ async def picture_step( async def confirm_step( self, step_context: WaterfallStepContext ) -> DialogTurnResult: - step_context.values["picture"] = ( - None if not step_context.result else step_context.result[0] - ) + msg = f"Thanks." + if step_context.result: + msg += f" Your profile saved successfully." + else: + msg += f" Your profile will not be kept." + + await step_context.context.send_activity(MessageFactory.text(msg)) # WaterfallStep always finishes with the end of the Waterfall or # with another dialog; here it is a Prompt Dialog. - return await step_context.prompt( - ConfirmPrompt.__name__, - PromptOptions(prompt=MessageFactory.text("Is this ok?")), - ) + return await step_context.end_dialog() async def summary_step( self, step_context: WaterfallStepContext ) -> DialogTurnResult: - if step_context.result: - # Get the current profile object from user state. Changes to it - # will saved during Bot.on_turn. - user_profile = await self.user_profile_accessor.get( - step_context.context, UserProfile - ) + step_context.values["picture"] = ( + None if not step_context.result else step_context.result[0] + ) + # Get the current profile object from user state. Changes to it + # will saved during Bot.on_turn. + user_profile = await self.user_profile_accessor.get( + step_context.context, UserProfile + ) - user_profile.transport = step_context.values["transport"] - user_profile.name = step_context.values["name"] - user_profile.age = step_context.values["age"] - user_profile.picture = step_context.values["picture"] + user_profile.transport = step_context.values["transport"] + user_profile.name = step_context.values["name"] + user_profile.age = step_context.values["age"] + user_profile.picture = step_context.values["picture"] - msg = f"I have your mode of transport as {user_profile.transport} and your name as {user_profile.name}." - if user_profile.age != -1: - msg += f" And age as {user_profile.age}." + msg = f"I have your mode of transport as {user_profile.transport} and your name as {user_profile.name}." + if user_profile.age != -1: + msg += f" And age as {user_profile.age}." - await step_context.context.send_activity(MessageFactory.text(msg)) + await step_context.context.send_activity(MessageFactory.text(msg)) - if user_profile.picture: - await step_context.context.send_activity( - MessageFactory.attachment( - user_profile.picture, "This is your profile picture." - ) - ) - else: - await step_context.context.send_activity( - "A profile picture was saved but could not be displayed here." + if user_profile.picture: + await step_context.context.send_activity( + MessageFactory.attachment( + user_profile.picture, "This is your profile picture." ) + ) else: await step_context.context.send_activity( - MessageFactory.text("Thanks. Your profile will not be kept.") + "A profile picture was saved but could not be displayed here." ) # WaterfallStep always finishes with the end of the Waterfall or with another # dialog, here it is the end. - return await step_context.end_dialog() + return await step_context.prompt( + ConfirmPrompt.__name__, + PromptOptions(prompt=MessageFactory.text("Is this ok?")), + ) @staticmethod async def age_prompt_validator(prompt_context: PromptValidatorContext) -> bool: From 1d4d5802837d74e5600578c017ac4c75f34fa631 Mon Sep 17 00:00:00 2001 From: gandiddi <164224646+gandiddi@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:47:32 +0530 Subject: [PATCH 05/21] Replacing the waterdall dialog by referencing the component dialog's initial dialog ID. (#3955) --- .../43.complex-dialog/Dialogs/ReviewSelectionDialog.cs | 2 +- .../43.complex-dialog/dialogs/reviewSelectionDialog.js | 2 +- .../python/43.complex-dialog/dialogs/review_selection_dialog.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/csharp_dotnetcore/43.complex-dialog/Dialogs/ReviewSelectionDialog.cs b/samples/csharp_dotnetcore/43.complex-dialog/Dialogs/ReviewSelectionDialog.cs index 8b06285696..f0932fd4b1 100644 --- a/samples/csharp_dotnetcore/43.complex-dialog/Dialogs/ReviewSelectionDialog.cs +++ b/samples/csharp_dotnetcore/43.complex-dialog/Dialogs/ReviewSelectionDialog.cs @@ -101,7 +101,7 @@ private async Task LoopStepAsync( else { // Otherwise, repeat this dialog, passing in the list from this iteration. - return await stepContext.ReplaceDialogAsync(nameof(ReviewSelectionDialog), list, cancellationToken); + return await stepContext.ReplaceDialogAsync(InitialDialogId, list, cancellationToken); } } } diff --git a/samples/javascript_nodejs/43.complex-dialog/dialogs/reviewSelectionDialog.js b/samples/javascript_nodejs/43.complex-dialog/dialogs/reviewSelectionDialog.js index d1315e73e8..d03942806c 100644 --- a/samples/javascript_nodejs/43.complex-dialog/dialogs/reviewSelectionDialog.js +++ b/samples/javascript_nodejs/43.complex-dialog/dialogs/reviewSelectionDialog.js @@ -73,7 +73,7 @@ class ReviewSelectionDialog extends ComponentDialog { return await stepContext.endDialog(list); } else { // Otherwise, repeat this dialog, passing in the list from this iteration. - return await stepContext.replaceDialog(REVIEW_SELECTION_DIALOG, list); + return await stepContext.replaceDialog(this.initialDialogId, list); } } } diff --git a/samples/python/43.complex-dialog/dialogs/review_selection_dialog.py b/samples/python/43.complex-dialog/dialogs/review_selection_dialog.py index 2119068bb2..b2b3c6f6b7 100644 --- a/samples/python/43.complex-dialog/dialogs/review_selection_dialog.py +++ b/samples/python/43.complex-dialog/dialogs/review_selection_dialog.py @@ -95,5 +95,5 @@ async def loop_step(self, step_context: WaterfallStepContext) -> DialogTurnResul # Otherwise, repeat this dialog, passing in the selections from this iteration. return await step_context.replace_dialog( - ReviewSelectionDialog.__name__, selected + self.initial_dialog_id, selected ) From 5c8fa6f9775579ebcdb66fcb1068aeb53751a6d5 Mon Sep 17 00:00:00 2001 From: KojiNakamura <41434466+7crabs@users.noreply.github.com> Date: Tue, 9 Apr 2024 00:18:18 +0900 Subject: [PATCH 06/21] remove duplicated line (#3953) --- samples/python/02.echo-bot/app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/python/02.echo-bot/app.py b/samples/python/02.echo-bot/app.py index 7b93b83216..0695452336 100644 --- a/samples/python/02.echo-bot/app.py +++ b/samples/python/02.echo-bot/app.py @@ -14,7 +14,6 @@ from botbuilder.core.integration import aiohttp_error_middleware from botbuilder.integration.aiohttp import CloudAdapter, ConfigurationBotFrameworkAuthentication from botbuilder.schema import Activity, ActivityTypes -from botbuilder.schema import Activity, ActivityTypes from bots import EchoBot from config import DefaultConfig From 4aee4342176245766dc7386c9d451dadc4fa470e Mon Sep 17 00:00:00 2001 From: Cecilia Avila <44245136+ceciliaavila@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:18:52 +0000 Subject: [PATCH 07/21] [JavaScript] Add Echo-Proxy Bot sample (#3944) * Add new echo-proxy-bot sample for JS * Remove yarn.lock file --- .../javascript_nodejs/86.echo-proxy-bot/.env | 7 + .../86.echo-proxy-bot/.eslintrc.js | 15 ++ .../86.echo-proxy-bot/README.md | 103 ++++++++ .../86.echo-proxy-bot/bot.js | 31 +++ .../deploymentScripts/linux/.deployment | 2 + .../deploymentScripts/linux/deploy.sh | 100 +++++++ .../deploymentScripts/windows/.deployment | 2 + .../deploymentScripts/windows/deploy.cmd | 133 ++++++++++ ...ameters-for-template-AzureBot-with-rg.json | 33 +++ ...arameters-for-template-BotApp-with-rg.json | 48 ++++ .../deployUseExistResourceGroup/readme.md | 38 +++ .../template-AzureBot-with-rg.json | 121 +++++++++ .../template-BotApp-with-rg.json | 191 ++++++++++++++ ...rameters-for-template-AzureBot-new-rg.json | 39 +++ ...parameters-for-template-BotApp-new-rg.json | 48 ++++ .../deployWithNewResourceGroup/readme.md | 45 ++++ .../template-AzureBot-new-rg.json | 160 ++++++++++++ .../template-BotApp-new-rg.json | 213 +++++++++++++++ ...ameters-for-template-AzureBot-with-rg.json | 21 ++ ...arameters-for-template-BotApp-with-rg.json | 42 +++ .../deployUseExistResourceGroup/readme.md | 26 ++ .../template-AzureBot-with-rg.json | 65 +++++ .../template-BotApp-with-rg.json | 221 ++++++++++++++++ ...rameters-for-template-AzureBot-new-rg.json | 27 ++ ...parameters-for-template-BotApp-new-rg.json | 42 +++ .../deployWithNewResourceGroup/readme.md | 27 ++ .../template-AzureBot-new-rg.json | 104 ++++++++ .../template-BotApp-new-rg.json | 244 ++++++++++++++++++ .../86.echo-proxy-bot/index.js | 114 ++++++++ .../86.echo-proxy-bot/package.json | 34 +++ 30 files changed, 2296 insertions(+) create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/.env create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/.eslintrc.js create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/README.md create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/bot.js create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/linux/.deployment create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/linux/deploy.sh create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/windows/.deployment create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/windows/deploy.cmd create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/readme.md create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-AzureBot-with-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/readme.md create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-AzureBot-new-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/index.js create mode 100644 samples/javascript_nodejs/86.echo-proxy-bot/package.json diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/.env b/samples/javascript_nodejs/86.echo-proxy-bot/.env new file mode 100644 index 0000000000..d906cbea99 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/.env @@ -0,0 +1,7 @@ +MicrosoftAppType= +MicrosoftAppId= +MicrosoftAppPassword= +MicrosoftAppTenantId= + +HTTP_PROXY=http://127.0.0.1:8080 +HTTPS_PROXY=http://127.0.0.1:8080 diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/.eslintrc.js b/samples/javascript_nodejs/86.echo-proxy-bot/.eslintrc.js new file mode 100644 index 0000000000..43b3d45dd2 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/.eslintrc.js @@ -0,0 +1,15 @@ +/* eslint-disable */ +module.exports = { + "extends": "standard", + "rules": { + "semi": [2, "always"], + "indent": [2, 4], + "no-return-await": 0, + "space-before-function-paren": [2, { + "named": "never", + "anonymous": "never", + "asyncArrow": "always" + }], + "template-curly-spacing": [2, "always"] + } +}; \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/README.md b/samples/javascript_nodejs/86.echo-proxy-bot/README.md new file mode 100644 index 0000000000..f3145a2456 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/README.md @@ -0,0 +1,103 @@ +# echo-proxy-bot + +Bot Framework v4 echo-proxy bot sample + +This bot has been created using [Bot Framework](https://dev.botframework.com), it shows how to configure the bot to use it behind a corporative proxy. + +## Prerequisites + +- [Node.js](https://nodejs.org) version 16.16.0 or higher + + ```bash + # determine node version + node --version + ``` + +## To try this sample + +- Clone the repository + + ```bash + git clone https://github.com/microsoft/botbuilder-samples.git + ``` + +- In a terminal, navigate to `samples/javascript_nodejs/86.echo-proxy-bot` + + ```bash + cd samples/javascript_nodejs/86.echo-proxy-bot + ``` + +- Install modules + + ```bash + npm install + ``` + +- Set up the proxy variables + + - Add the `HTTP_PROXY` and `HTTPS_PROXY` values in the **.env** file. For testing you can use the localhost and an available port: + ``` + HTTP_PROXY=http://127.0.0.1:8080 + HTTPS_PROXY=http://127.0.0.1:8080 + ``` + + This sample provides two options to work behind a proxy: + + **Option #1: Setting up the proxy variables globally for NodeJS**. + + - Make sure the code marked as option #1 is enabled in **index.js**. + It will use the `node-global-proxy` package to configure and start the global proxy with the provided env variables. + + > This option will route all the requests the bot makes through the proxy. + + **Option #2: Setting up the proxy in the Connector Client Options** + - Make sure the code marked as option #2 is enabled in **index.js**. + - Fill in the `proxySettings` of _ConnectorClientOptions_ with the `host` and `port` for your proxy. For testing you can use the localhost and an available port: + ```JavaScript + { proxySettings: { host: '127.0.0.1', port: 8080 } } + ``` + - Additionally, you can set the `ProxyUrl` property for the MSAL requests [msal documentation](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/faq.md#why-doesnt-my-app-function-correctly-when-its-running-behind-a-proxy). + + > This option will route the authentication requests that botbuilder makes through the proxy. Other requests, like calls to intranet APIs, will go out directly. + + You can verify the routed requests with a tool like [straightforward](https://github.com/berstend/straightforward). + +- Start the bot + + ```bash + npm start + ``` + +## Testing the bot using Bot Framework Emulator + +[Bot Framework Emulator](https://github.com/microsoft/botframework-emulator) is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel. + +- Install the latest Bot Framework Emulator from [here](https://github.com/Microsoft/BotFramework-Emulator/releases) + +### Connect to the bot using Bot Framework Emulator + +- Launch Bot Framework Emulator +- File -> Open Bot +- Enter a Bot URL of `http://localhost:3978/api/messages` + +## Interacting with the bot + +Enter text in the emulator. The text will be echoed back by the bot. + +## Deploy the bot to Azure + +To learn more about deploying a bot to Azure, see [Deploy your bot to Azure](https://aka.ms/azuredeployment) for a complete list of deployment instructions. + +## Further reading + +- [Bot Framework Documentation](https://docs.botframework.com) +- [Bot Basics](https://docs.microsoft.com/azure/bot-service/bot-builder-basics?view=azure-bot-service-4.0) +- [Activity processing](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-concept-activity-processing?view=azure-bot-service-4.0) +- [Azure Bot Service Introduction](https://docs.microsoft.com/azure/bot-service/bot-service-overview-introduction?view=azure-bot-service-4.0) +- [Azure Bot Service Documentation](https://docs.microsoft.com/azure/bot-service/?view=azure-bot-service-4.0) +- [Azure CLI](https://docs.microsoft.com/cli/azure/?view=azure-cli-latest) +- [Azure Portal](https://portal.azure.com) +- [Channels and Bot Connector Service](https://docs.microsoft.com/en-us/azure/bot-service/bot-concepts?view=azure-bot-service-4.0) +- [Restify](https://www.npmjs.com/package/restify) +- [dotenv](https://www.npmjs.com/package/dotenv) +- [node-global-proxy](https://www.npmjs.com/package/node-global-proxy) diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/bot.js b/samples/javascript_nodejs/86.echo-proxy-bot/bot.js new file mode 100644 index 0000000000..f8bdaecc7c --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/bot.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +const { ActivityHandler, MessageFactory } = require('botbuilder'); + +class EchoProxyBot extends ActivityHandler { + constructor() { + super(); + // See https://aka.ms/about-bot-activity-message to learn more about the message and other activity types. + this.onMessage(async (context, next) => { + const replyText = `Echo: ${ context.activity.text }`; + await context.sendActivity(MessageFactory.text(replyText, replyText)); + // By calling next() you ensure that the next BotHandler is run. + await next(); + }); + + this.onMembersAdded(async (context, next) => { + const membersAdded = context.activity.membersAdded; + const welcomeText = 'Hello and welcome!'; + for (let cnt = 0; cnt < membersAdded.length; ++cnt) { + if (membersAdded[cnt].id !== context.activity.recipient.id) { + await context.sendActivity(MessageFactory.text(welcomeText, welcomeText)); + } + } + // By calling next() you ensure that the next BotHandler is run. + await next(); + }); + } +} + +module.exports.EchoProxyBot = EchoProxyBot; diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/linux/.deployment b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/linux/.deployment new file mode 100644 index 0000000000..1047846624 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/linux/.deployment @@ -0,0 +1,2 @@ +[config] +command = ./deploy.sh \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/linux/deploy.sh b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/linux/deploy.sh new file mode 100644 index 0000000000..8c02d427cc --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/linux/deploy.sh @@ -0,0 +1,100 @@ +#!/bin/bash + +# ---------------------- +# KUDU Deployment Script +# Version: 1.0.17 +# ---------------------- + +# Helpers +# ------- + +exitWithMessageOnError () { + if [ ! $? -eq 0 ]; then + echo "An error has occurred during web site deployment." + echo $1 + exit 1 + fi +} + +# Prerequisites +# ------------- + +# Verify node.js installed +hash node 2>/dev/null +exitWithMessageOnError "Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment." + +# Setup +# ----- + +SCRIPT_DIR="${BASH_SOURCE[0]%\\*}" +SCRIPT_DIR="${SCRIPT_DIR%/*}" +ARTIFACTS=$SCRIPT_DIR/../artifacts +KUDU_SYNC_CMD=${KUDU_SYNC_CMD//\"} + +if [[ ! -n "$DEPLOYMENT_SOURCE" ]]; then + DEPLOYMENT_SOURCE=$SCRIPT_DIR +fi + +if [[ ! -n "$NEXT_MANIFEST_PATH" ]]; then + NEXT_MANIFEST_PATH=$ARTIFACTS/manifest + + if [[ ! -n "$PREVIOUS_MANIFEST_PATH" ]]; then + PREVIOUS_MANIFEST_PATH=$NEXT_MANIFEST_PATH + fi +fi + +if [[ ! -n "$DEPLOYMENT_TARGET" ]]; then + DEPLOYMENT_TARGET=$ARTIFACTS/wwwroot +else + KUDU_SERVICE=true +fi + +if [[ ! -n "$KUDU_SYNC_CMD" ]]; then + # Install kudu sync + echo Installing Kudu Sync + npm install kudusync -g --silent + exitWithMessageOnError "npm failed" + + if [[ ! -n "$KUDU_SERVICE" ]]; then + # In case we are running locally this is the correct location of kuduSync + KUDU_SYNC_CMD=kuduSync + else + # In case we are running on kudu service this is the correct location of kuduSync + KUDU_SYNC_CMD=$APPDATA/npm/node_modules/kuduSync/bin/kuduSync + fi +fi + +# Node Helpers +# ------------ + +selectNodeVersion () { + NPM_CMD=npm + NODE_EXE=node +} + +################################################################################################################################## +# Deployment +# ---------- + +echo Handling node.js deployment. + +# 1. KuduSync +if [[ "$IN_PLACE_DEPLOYMENT" -ne "1" ]]; then + "$KUDU_SYNC_CMD" -v 50 -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;deploy.sh" + exitWithMessageOnError "Kudu Sync failed" +fi + +# 2. Select node version +selectNodeVersion + +# 3. Install npm packages +if [ -e "$DEPLOYMENT_TARGET/package.json" ]; then + cd "$DEPLOYMENT_TARGET" + echo "Running $NPM_CMD install --production" + eval $NPM_CMD install --production + exitWithMessageOnError "npm failed" + cd - > /dev/null +fi + +################################################################################################################################## +echo "Finished successfully." \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/windows/.deployment b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/windows/.deployment new file mode 100644 index 0000000000..db5488a1df --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/windows/.deployment @@ -0,0 +1,2 @@ +[config] +command = deploy.cmd \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/windows/deploy.cmd b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/windows/deploy.cmd new file mode 100644 index 0000000000..7a40dcabf5 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentScripts/windows/deploy.cmd @@ -0,0 +1,133 @@ +@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off + +:: ---------------------- +:: KUDU Deployment Script +:: Version: 1.0.17 +:: ---------------------- + +:: Prerequisites +:: ------------- + +:: Verify node.js installed +where node 2>nul >nul +IF %ERRORLEVEL% NEQ 0 ( + echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment. + goto error +) + +:: Setup +:: ----- + +setlocal enabledelayedexpansion + +SET ARTIFACTS=%~dp0%..\artifacts + +IF NOT DEFINED DEPLOYMENT_SOURCE ( + SET DEPLOYMENT_SOURCE=%~dp0%. +) + +IF NOT DEFINED DEPLOYMENT_TARGET ( + SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot +) + +IF NOT DEFINED NEXT_MANIFEST_PATH ( + SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest + + IF NOT DEFINED PREVIOUS_MANIFEST_PATH ( + SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest + ) +) + +IF NOT DEFINED KUDU_SYNC_CMD ( + :: Install kudu sync + echo Installing Kudu Sync + call npm install kudusync -g --silent + IF !ERRORLEVEL! NEQ 0 goto error + + :: Locally just running "kuduSync" would also work + SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd +) +goto Deployment + +:: Utility Functions +:: ----------------- + +:SelectNodeVersion + +IF DEFINED KUDU_SELECT_NODE_VERSION_CMD ( + :: The following are done only on Windows Azure Websites environment + call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%" + IF !ERRORLEVEL! NEQ 0 goto error + + IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" ( + SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp" + IF !ERRORLEVEL! NEQ 0 goto error + ) + + IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" ( + SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp" + IF !ERRORLEVEL! NEQ 0 goto error + ) + + IF NOT DEFINED NODE_EXE ( + SET NODE_EXE=node + ) + + SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!" +) ELSE ( + SET NPM_CMD=npm + SET NODE_EXE=node +) + +goto :EOF + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: Deployment +:: ---------- + +:Deployment +echo Handling node.js deployment. + +:: 1. KuduSync +IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" ( + call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd" + IF !ERRORLEVEL! NEQ 0 goto error +) + +:: 2. Select node version +call :SelectNodeVersion + +:: 3. Install npm packages +IF EXIST "%DEPLOYMENT_TARGET%\package.json" ( + pushd "%DEPLOYMENT_TARGET%" + call :ExecuteCmd !NPM_CMD! install --production + IF !ERRORLEVEL! NEQ 0 goto error + popd +) + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +goto end + +:: Execute command routine that will echo out when error +:ExecuteCmd +setlocal +set _CMD_=%* +call %_CMD_% +if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_% +exit /b %ERRORLEVEL% + +:error +endlocal +echo An error has occurred during web site deployment. +call :exitSetErrorLevel +call :exitFromFunction 2>nul + +:exitSetErrorLevel +exit /b 1 + +:exitFromFunction +() + +:end +endlocal +echo Finished successfully. diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json new file mode 100644 index 0000000000..c2c03ef307 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "UMSIName": { + "value": "" + }, + "UMSIResourceGroupName": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json new file mode 100644 index 0000000000..c4b2909008 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "value": "" + }, + "existingAppServicePlanName": { + "value": "" + }, + "existingAppServicePlanLocation": { + "value": "" + }, + "newAppServicePlanName": { + "value": "" + }, + "newAppServicePlanLocation": { + "value": "" + }, + "newAppServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "UMSIName": { + "value": "" + }, + "UMSIResourceGroupName": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md new file mode 100644 index 0000000000..ba81e5b608 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -0,0 +1,38 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment group create --resource-group --template-file --parameters @` + +## Parameters for template-BotApp-with-rg.json: + +- **appServiceName**: (required) The Name of the Bot App Service. +- (Pick an existing App Service Plan or create a new App Service Plan.) + - **existingAppServicePlanName**: The name of the App Service Plan. + - **existingAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanName**: The name of the App Service Plan. + - **newAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **UMSIName**: (required for UserAssignedMSI) The User-Assigned Managed Identity Resource used for the Bot's Authentication. +- **UMSIResourceGroupName**: (required for UserAssignedMSI) The User-Assigned Managed Identity Resource Group used for the Bot's Authentication. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + +## Parameters for template-AzureBot-with-rg.json: + +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **UMSIName**: (required for UserAssignedMSI) The User-Assigned Managed Identity Resource used for the Bot's Authentication. +- **UMSIResourceGroupName**: (required for UserAssignedMSI) The User-Assigned Managed Identity Resource Group used for the Bot's Authentication. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json new file mode 100644 index 0000000000..a8a960066f --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -0,0 +1,121 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default)." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope." + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant", + "UserAssignedMSI" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "UMSIName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The User-Assigned Managed Identity Resource used for the Bot's Authentication." + } + }, + "UMSIResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The User-Assigned Managed Identity Resource Group used for the Bot's Authentication." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + }, + "UserAssignedMSI": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "[variables('msiResourceId')]" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "msiResourceId": "[variables('appTypeDef')[parameters('appType')].msiResourceId]" + } + }, + "resources": [ + { + "apiVersion": "2021-05-01-preview", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppMSIResourceId": "[variables('appType').msiResourceId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + }, + "dependsOn": [] + } + ] +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json new file mode 100644 index 0000000000..e14f532660 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -0,0 +1,191 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "existingAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the existing App Service Plan used to create the Web App for the bot." + } + }, + "existingAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the new App Service Plan." + } + }, + "newAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant", + "UserAssignedMSI" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." + } + }, + "UMSIName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The User-Assigned Managed Identity Resource used for the Bot's Authentication. Defaults to \"\"." + } + }, + "UMSIResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The User-Assigned Managed Identity Resource Group used for the Bot's Authentication. Defaults to \"\"." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", + "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + }, + "UserAssignedMSI": { + "tenantId": "[variables('tenantId')]", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "[variables('msiResourceId')]": {} + } + } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.", + "type": "Microsoft.Web/serverfarms", + "condition": "[not(variables('useExistingServicePlan'))]", + "name": "[variables('servicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[parameters('newAppServicePlanLocation')]", + "sku": "[parameters('newAppServicePlanSku')]", + "properties": { + "name": "[variables('servicePlanName')]" + } + }, + { + "comments": "Create a Web App using an App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('servicePlanLocation')]", + "kind": "app", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" + ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "name": "[parameters('appServiceName')]", + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]", + "siteConfig": { + "appSettings": [ + { + "name": "WEBSITE_NODE_DEFAULT_VERSION", + "value": "~16" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + }, + "webSocketsEnabled": true + } + } + } + ] +} diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json new file mode 100644 index 0000000000..44f169e4d5 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "UMSIName": { + "value": "" + }, + "UMSIResourceGroupName": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json new file mode 100644 index 0000000000..8abb03d597 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "appServiceName": { + "value": "" + }, + "appServicePlanName": { + "value": "" + }, + "appServicePlanLocation": { + "value": "" + }, + "appServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "UMSIName": { + "value": "" + }, + "UMSIResourceGroupName": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md new file mode 100644 index 0000000000..2f2571d06d --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -0,0 +1,45 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment sub create --template-file --location --parameters @` + +## Parameters for template-BotApp-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **UMSIName**: (required for UserAssignedMSI) The User-Assigned Managed Identity Resource used for the Bot's Authentication. +- **UMSIResourceGroupName**:(required for UserAssignedMSI) The User-Assigned Managed Identity Resource Group used for the Bot's Authentication. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + + +## Parameters for template-AzureBot-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **UMSIName**: (required for UserAssignedMSI) The User-Assigned Managed Identity Resource used for the Bot's Authentication. +- **UMSIResourceGroupName**: (required for UserAssignedMSI) The User-Assigned Managed Identity Resource Group used for the Bot's Authentication. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json new file mode 100644 index 0000000000..ae073b7939 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -0,0 +1,160 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "" + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant", + "UserAssignedMSI" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "UMSIName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The User-Assigned Managed Identity Resource used for the Bot's Authentication." + } + }, + "UMSIResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The User-Assigned Managed Identity Resource Group used for the Bot's Authentication." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + }, + "UserAssignedMSI": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "[variables('msiResourceId')]" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "msiResourceId": "[variables('appTypeDef')[parameters('appType')].msiResourceId]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "apiVersion": "2021-03-01", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppMSIResourceId": "[variables('appType').msiResourceId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json new file mode 100644 index 0000000000..eb6ad68a9f --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -0,0 +1,213 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "appServicePlanName": { + "type": "string", + "metadata": { + "description": "The name of the App Service Plan." + } + }, + "appServicePlanLocation": { + "type": "string", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "appServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant", + "UserAssignedMSI" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types." + } + }, + "UMSIName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The User-Assigned Managed Identity Resource used for the Bot's Authentication." + } + }, + "UMSIResourceGroupName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The User-Assigned Managed Identity Resource Group used for the Bot's Authentication." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appServicePlanName": "[parameters('appServicePlanName')]", + "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", + "appServiceName": "[parameters('appServiceName')]", + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + }, + "UserAssignedMSI": { + "tenantId": "[variables('tenantId')]", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "[variables('msiResourceId')]": {} + } + } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "comments": "Create a new App Service Plan", + "type": "Microsoft.Web/serverfarms", + "name": "[variables('appServicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[variables('resourcesLocation')]", + "sku": "[parameters('appServicePlanSku')]", + "properties": { + "name": "[variables('appServicePlanName')]" + } + }, + { + "comments": "Create a Web App using the new App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('resourcesLocation')]", + "kind": "app", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" + ], + "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "name": "[variables('appServiceName')]", + "serverFarmId": "[variables('appServicePlanName')]", + "siteConfig": { + "appSettings": [ + { + "name": "WEBSITE_NODE_DEFAULT_VERSION", + "value": "~16" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + }, + "webSocketsEnabled": true + } + } + } + ], + "outputs": {} + } + } + } + ] +} diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json new file mode 100644 index 0000000000..cc1800c0db --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json new file mode 100644 index 0000000000..c1f341b084 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "value": "" + }, + "existingAppServicePlanName": { + "value": "" + }, + "existingAppServicePlanLocation": { + "value": "" + }, + "newAppServicePlanName": { + "value": "" + }, + "newAppServicePlanLocation": { + "value": "West US" + }, + "newAppServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "linuxFxVersion": { + "value": "" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "appType": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/readme.md b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/readme.md new file mode 100644 index 0000000000..93086e1f57 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/readme.md @@ -0,0 +1,26 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment group create --resource-group --template-file --parameters @` + +## Parameters for template-BotApp-with-rg.json: + +- **appServiceName**: (required) The Name of the Bot App Service. +- (Pick an existing App Service Plan or create a new App Service Plan.) + - **existingAppServicePlanName**: The name of the App Service Plan. + - **existingAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanName**: The name of the App Service Plan. + - **newAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. + +## Parameters for template-AzureBot-with-rg.json: + +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-AzureBot-with-rg.json new file mode 100644 index 0000000000..60c9c1bb6c --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -0,0 +1,65 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default)." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope." + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + }, + "resources": [ + { + "apiVersion": "2021-05-01-preview", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json new file mode 100644 index 0000000000..d116d6d6e2 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -0,0 +1,221 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "existingAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the existing App Service Plan used to create the Web App for the bot." + } + }, + "existingAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the new App Service Plan." + } + }, + "newAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "linuxFxVersion": { + "type": "string", + "defaultValue": "NODE|16" + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." + } + }, + "appType": { + "defaultValue": "MultiTenant", + "type": "string", + "allowedValues": [ + "MultiTenant", + "SingleTenant", + "UserAssignedMSI" + ] + } + }, + "variables": { + "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", + "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + }, + "resources": [ + { + "comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.", + "type": "Microsoft.Web/serverfarms", + "condition": "[not(variables('useExistingServicePlan'))]", + "name": "[variables('servicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[parameters('newAppServicePlanLocation')]", + "sku": "[parameters('newAppServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('servicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using an App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "name": "[parameters('appServiceName')]", + "location": "[variables('servicePlanLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" + ], + "properties": { + "enabled": true, + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]", + "reserved": true, + "scmSiteAlsoStopped": false, + "clientAffinityEnabled": false, + "clientCertEnabled": false, + "hostNamesDisabled": false, + "containerSize": 0, + "dailyMemoryTimeQuota": 0, + "httpsOnly": false, + "siteConfig": { + "linuxFxVersion": "[parameters('linuxFxVersion')]", + "appSettings": [ + { + "name": "WEBSITE_NODE_DEFAULT_VERSION", + "value": "~16" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + } + ] + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('servicePlanLocation')]", + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "[parameters('linuxFxVersion')]", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "httpLoggingEnabled": false, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "LocalGit", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": true, + "appCommandLine": "", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": true, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ] +} diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json new file mode 100644 index 0000000000..f180618138 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json new file mode 100644 index 0000000000..a147121303 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "appServiceName": { + "value": "" + }, + "appServicePlanName": { + "value": "" + }, + "appServicePlanLocation": { + "value": "" + }, + "appServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "linuxFxVersion": { + "value": "" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "appType": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/readme.md b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/readme.md new file mode 100644 index 0000000000..dbdfabf9a9 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/readme.md @@ -0,0 +1,27 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment sub create --template-file --location --parameters @` + +## Parameters for template-BotApp-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. + +## Parameters for template-AzureBot-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. +- **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-AzureBot-new-rg.json new file mode 100644 index 0000000000..927307e0fc --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -0,0 +1,104 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "" + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "apiVersion": "2021-03-01", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json new file mode 100644 index 0000000000..1b84694812 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -0,0 +1,244 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "appServicePlanName": { + "type": "string", + "metadata": { + "description": "The name of the App Service Plan." + } + }, + "appServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "appServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "linuxFxVersion": { + "type": "string", + "defaultValue": "NODE|16" + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types." + } + }, + "appType": { + "defaultValue": "MultiTenant", + "type": "string", + "allowedValues": [ + "MultiTenant", + "SingleTenant", + "UserAssignedMSI" + ] + } + }, + "variables": { + "appServicePlanName": "[parameters('appServicePlanName')]", + "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", + "appServiceName": "[parameters('appServiceName')]", + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "comments": "Create a new App Service Plan", + "type": "Microsoft.Web/serverfarms", + "name": "[variables('appServicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[variables('resourcesLocation')]", + "sku": "[parameters('appServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('appServicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using the new App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "name": "[parameters('appServiceName')]", + "location": "[variables('resourcesLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" + ], + "properties": { + "enabled": true, + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[variables('appServicePlanName')]", + "reserved": true, + "scmSiteAlsoStopped": false, + "clientAffinityEnabled": false, + "clientCertEnabled": false, + "hostNamesDisabled": false, + "containerSize": 0, + "dailyMemoryTimeQuota": 0, + "httpsOnly": false, + "siteConfig": { + "linuxFxVersion": "[parameters('linuxFxVersion')]", + "appSettings": [ + { + "name": "WEBSITE_NODE_DEFAULT_VERSION", + "value": "~16" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + } + ] + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('resourcesLocation')]", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "[parameters('linuxFxVersion')]", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "LocalGit", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": true, + "appCommandLine": "", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": true, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ] + } + } + } + ] +} diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/index.js b/samples/javascript_nodejs/86.echo-proxy-bot/index.js new file mode 100644 index 0000000000..530bed3a26 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/index.js @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +const path = require('path'); + +const dotenv = require('dotenv'); +// Import required bot configuration. +const ENV_FILE = path.join(__dirname, '.env'); +dotenv.config({ path: ENV_FILE }); + +const restify = require('restify'); + +// Import required bot services. +// See https://aka.ms/bot-services to learn more about the different parts of a bot. +const { + CloudAdapter, + ConfigurationBotFrameworkAuthentication +} = require('botbuilder'); + +// This bot's main dialog. +const { EchoProxyBot } = require('./bot'); + +// Create HTTP server +const server = restify.createServer(); +server.use(restify.plugins.bodyParser()); + +server.listen(process.env.port || process.env.PORT || 3978, () => { + console.log(`\n${ server.name } listening to ${ server.url }`); + console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator'); + console.log('\nTo talk to your bot, open the emulator select "Open Bot"'); +}); + +// Option #1: Setting the proxy variables globally for NodeJS. +const proxy = require('node-global-proxy').default; + +proxy.setConfig({ + http: process.env.HTTP_PROXY, + https: process.env.HTTPS_PROXY +}); +proxy.start(); + +const botFrameworkAuthentication = new ConfigurationBotFrameworkAuthentication(process.env); + +// Option #2: Setting the proxy values in the configuration. +// const { MsalServiceClientCredentialsFactory } = require('botframework-connector'); +// const msal = require('@azure/msal-node'); + +// const authorityUrl = 'https://login.microsoftonline.com/botframework.com'; + +// const credentialsFactory = new MsalServiceClientCredentialsFactory( +// process.env.MicrosoftAppId, +// new msal.ConfidentialClientApplication({ +// auth: { +// clientId: process.env.MicrosoftAppId, +// clientSecret: process.env.MicrosoftAppPassword, +// authority: authorityUrl +// } +// }) +// ); + +// const botFrameworkAuthentication = new ConfigurationBotFrameworkAuthentication( +// process.env, +// credentialsFactory, +// undefined, +// undefined, +// { proxySettings: { host: '127.0.0.1', port: 8080 } } +// ); + +// Create adapter. +// See https://aka.ms/about-bot-adapter to learn more about how bots work. +const adapter = new CloudAdapter(botFrameworkAuthentication); + +// Catch-all for errors. +const onTurnErrorHandler = async (context, error) => { + // This check writes out errors to console log .vs. app insights. + // NOTE: In production environment, you should consider logging this to Azure + // application insights. See https://aka.ms/bottelemetry for telemetry + // configuration instructions. + console.error(`\n [onTurnError] unhandled error: ${ error }`); + + // Send a trace activity, which will be displayed in Bot Framework Emulator + await context.sendTraceActivity( + 'OnTurnError Trace', + `${ error }`, + 'https://www.botframework.com/schemas/error', + 'TurnError' + ); + + // Send a message to the user + await context.sendActivity('The bot encountered an error or bug.'); + await context.sendActivity('To continue to run this bot, please fix the bot source code.'); +}; + +// Set the onTurnError for the singleton CloudAdapter. +adapter.onTurnError = onTurnErrorHandler; + +// Create the main dialog. +const myBot = new EchoProxyBot(); + +// Listen for incoming requests. +server.post('/api/messages', async (req, res) => { + // Route received a request to adapter for processing + await adapter.process(req, res, (context) => myBot.run(context)); +}); + +// Listen for Upgrade requests for Streaming. +server.on('upgrade', async (req, socket, head) => { + // Create an adapter scoped to this WebSocket connection to allow storing session data. + const streamingAdapter = new CloudAdapter(botFrameworkAuthentication); + // Set onTurnError for the CloudAdapter created for each connection. + streamingAdapter.onTurnError = onTurnErrorHandler; + + await streamingAdapter.process(req, socket, head, (context) => myBot.run(context)); +}); diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/package.json b/samples/javascript_nodejs/86.echo-proxy-bot/package.json new file mode 100644 index 0000000000..ed1a1b7674 --- /dev/null +++ b/samples/javascript_nodejs/86.echo-proxy-bot/package.json @@ -0,0 +1,34 @@ +{ + "name": "echoproxybot", + "version": "1.0.0", + "description": "Bot Builder v4 echo proxy bot sample", + "author": "Microsoft", + "license": "MIT", + "main": "index.js", + "scripts": { + "start": "node ./index.js", + "watch": "nodemon ./index.js", + "lint": "eslint .", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com" + }, + "dependencies": { + "@azure/msal-node": "^1.18.4", + "botbuilder": "~4.22.1", + "dotenv": "^8.2.0", + "node-global-proxy": "^1.0.1", + "restify": "~10.0.0" + }, + "devDependencies": { + "eslint": "^7.0.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", + "nodemon": "~2.0.4" + } +} From 9c1640835fb96a516d3e9c185d03c47705597e66 Mon Sep 17 00:00:00 2001 From: tracyboehrer Date: Wed, 17 Apr 2024 13:19:21 -0500 Subject: [PATCH 08/21] Python SingleTenant updates (#3932) * Python SingleTenant updates * Python deployments now default to Python 3.9 --------- Co-authored-by: Tracy Boehrer --- samples/python/02.echo-bot/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/02.echo-bot/requirements.txt | 2 +- samples/python/03.welcome-user/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/05.multi-turn-prompt/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/06.using-cards/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../python/07.using-adaptive-cards/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/08.suggested-actions/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/13.core-bot/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../python/15.handling-attachments/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../python/16.proactive-messages/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/17.multilingual-bot/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../python/18.bot-authentication/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/19.custom-dialogs/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../python/21.corebot-app-insights/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/23.facebook-events/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../24.bot-authentication-msgraph/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/42.scaleout/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/43.complex-dialog/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../python/44.prompt-for-user-input/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/45.state-management/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- samples/python/47.inspection/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../echo-skill-bot/config.py | 10 +- ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../simple-root-bot/config.py | 10 +- ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../dialog-root-bot/config.py | 6 +- ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- .../dialog-skill-bot/config.py | 2 + ...ameters-for-template-AzureBot-with-rg.json | 6 + ...arameters-for-template-BotApp-with-rg.json | 8 +- .../deployUseExistResourceGroup/readme.md | 18 +- .../template-AzureBot-with-rg.json | 36 ++- .../template-BotApp-with-rg.json | 48 +++- ...rameters-for-template-AzureBot-new-rg.json | 12 +- ...parameters-for-template-BotApp-new-rg.json | 6 + .../deployWithNewResourceGroup/readme.md | 26 +- .../template-AzureBot-new-rg.json | 37 ++- .../template-BotApp-new-rg.json | 46 ++- ...ameters-for-template-AzureBot-with-rg.json | 27 ++ ...arameters-for-template-BotApp-with-rg.json | 42 +++ .../deployUseExistResourceGroup/readme.md | 30 ++ .../template-AzureBot-with-rg.json | 99 +++++++ .../template-BotApp-with-rg.json | 252 ++++++++++++++++ ...rameters-for-template-AzureBot-new-rg.json | 33 +++ ...parameters-for-template-BotApp-new-rg.json | 42 +++ .../deployWithNewResourceGroup/readme.md | 41 +++ .../template-AzureBot-new-rg.json | 139 +++++++++ .../template-BotApp-new-rg.json | 269 ++++++++++++++++++ ...ameters-for-template-AzureBot-with-rg.json | 27 ++ ...arameters-for-template-BotApp-with-rg.json | 42 +++ .../deployUseExistResourceGroup/readme.md | 30 ++ .../template-AzureBot-with-rg.json | 99 +++++++ .../template-BotApp-with-rg.json | 252 ++++++++++++++++ ...rameters-for-template-AzureBot-new-rg.json | 33 +++ ...parameters-for-template-BotApp-new-rg.json | 42 +++ .../deployWithNewResourceGroup/readme.md | 41 +++ .../template-AzureBot-new-rg.json | 139 +++++++++ .../template-BotApp-new-rg.json | 269 ++++++++++++++++++ ...ameters-for-template-AzureBot-with-rg.json | 27 ++ ...arameters-for-template-BotApp-with-rg.json | 42 +++ .../deployUseExistResourceGroup/readme.md | 30 ++ .../template-AzureBot-with-rg.json | 99 +++++++ .../template-BotApp-with-rg.json | 252 ++++++++++++++++ ...rameters-for-template-AzureBot-new-rg.json | 33 +++ ...parameters-for-template-BotApp-new-rg.json | 42 +++ .../deployWithNewResourceGroup/readme.md | 41 +++ .../template-AzureBot-new-rg.json | 139 +++++++++ .../template-BotApp-new-rg.json | 269 ++++++++++++++++++ ...ameters-for-template-AzureBot-with-rg.json | 27 ++ ...arameters-for-template-BotApp-with-rg.json | 42 +++ .../deployUseExistResourceGroup/readme.md | 30 ++ .../template-AzureBot-with-rg.json | 99 +++++++ .../template-BotApp-with-rg.json | 252 ++++++++++++++++ ...rameters-for-template-AzureBot-new-rg.json | 33 +++ ...parameters-for-template-BotApp-new-rg.json | 42 +++ .../deployWithNewResourceGroup/readme.md | 41 +++ .../template-AzureBot-new-rg.json | 139 +++++++++ .../template-BotApp-new-rg.json | 269 ++++++++++++++++++ ...ameters-for-template-AzureBot-with-rg.json | 27 ++ ...arameters-for-template-BotApp-with-rg.json | 42 +++ .../deployUseExistResourceGroup/readme.md | 30 ++ .../template-AzureBot-with-rg.json | 99 +++++++ .../template-BotApp-with-rg.json | 252 ++++++++++++++++ ...rameters-for-template-AzureBot-new-rg.json | 33 +++ ...parameters-for-template-BotApp-new-rg.json | 42 +++ .../deployWithNewResourceGroup/readme.md | 41 +++ .../template-AzureBot-new-rg.json | 139 +++++++++ .../template-BotApp-new-rg.json | 269 ++++++++++++++++++ 315 files changed, 10180 insertions(+), 592 deletions(-) create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json create mode 100644 samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json diff --git a/samples/python/02.echo-bot/config.py b/samples/python/02.echo-bot/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/02.echo-bot/config.py +++ b/samples/python/02.echo-bot/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/02.echo-bot/requirements.txt b/samples/python/02.echo-bot/requirements.txt index d30eb4f06f..ff97d8e13e 100644 --- a/samples/python/02.echo-bot/requirements.txt +++ b/samples/python/02.echo-bot/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp==4.15.0 diff --git a/samples/python/03.welcome-user/config.py b/samples/python/03.welcome-user/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/03.welcome-user/config.py +++ b/samples/python/03.welcome-user/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/05.multi-turn-prompt/config.py b/samples/python/05.multi-turn-prompt/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/05.multi-turn-prompt/config.py +++ b/samples/python/05.multi-turn-prompt/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/06.using-cards/config.py b/samples/python/06.using-cards/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/06.using-cards/config.py +++ b/samples/python/06.using-cards/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/07.using-adaptive-cards/config.py b/samples/python/07.using-adaptive-cards/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/07.using-adaptive-cards/config.py +++ b/samples/python/07.using-adaptive-cards/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/08.suggested-actions/config.py b/samples/python/08.suggested-actions/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/08.suggested-actions/config.py +++ b/samples/python/08.suggested-actions/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/13.core-bot/config.py b/samples/python/13.core-bot/config.py index 83f1bbbdf6..0f524da630 100644 --- a/samples/python/13.core-bot/config.py +++ b/samples/python/13.core-bot/config.py @@ -13,6 +13,8 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") LUIS_APP_ID = os.environ.get("LuisAppId", "") LUIS_API_KEY = os.environ.get("LuisAPIKey", "") # LUIS endpoint host name, ie "westus.api.cognitive.microsoft.com" diff --git a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/15.handling-attachments/config.py b/samples/python/15.handling-attachments/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/15.handling-attachments/config.py +++ b/samples/python/15.handling-attachments/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/16.proactive-messages/config.py b/samples/python/16.proactive-messages/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/16.proactive-messages/config.py +++ b/samples/python/16.proactive-messages/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/17.multilingual-bot/config.py b/samples/python/17.multilingual-bot/config.py index 3291646c50..d5c41e6adb 100644 --- a/samples/python/17.multilingual-bot/config.py +++ b/samples/python/17.multilingual-bot/config.py @@ -13,5 +13,7 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") SUBSCRIPTION_KEY = os.environ.get("SubscriptionKey", "") # SUBSCRIPTION_REGION = os.environ.get("SubscriptionRegion", "") diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/18.bot-authentication/config.py b/samples/python/18.bot-authentication/config.py index 0acc113a38..b68ec7c9fb 100644 --- a/samples/python/18.bot-authentication/config.py +++ b/samples/python/18.bot-authentication/config.py @@ -13,4 +13,6 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") CONNECTION_NAME = os.environ.get("ConnectionName", "") diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/19.custom-dialogs/config.py b/samples/python/19.custom-dialogs/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/19.custom-dialogs/config.py +++ b/samples/python/19.custom-dialogs/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/21.corebot-app-insights/config.py b/samples/python/21.corebot-app-insights/config.py index b3c87e3044..70e8276a12 100644 --- a/samples/python/21.corebot-app-insights/config.py +++ b/samples/python/21.corebot-app-insights/config.py @@ -12,6 +12,8 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") LUIS_APP_ID = os.environ.get("LuisAppId", "") LUIS_API_KEY = os.environ.get("LuisAPIKey", "") # LUIS endpoint host name, ie "westus.api.cognitive.microsoft.com" diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/23.facebook-events/config.py b/samples/python/23.facebook-events/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/23.facebook-events/config.py +++ b/samples/python/23.facebook-events/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/24.bot-authentication-msgraph/config.py b/samples/python/24.bot-authentication-msgraph/config.py index 0acc113a38..b68ec7c9fb 100644 --- a/samples/python/24.bot-authentication-msgraph/config.py +++ b/samples/python/24.bot-authentication-msgraph/config.py @@ -13,4 +13,6 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") CONNECTION_NAME = os.environ.get("ConnectionName", "") diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/42.scaleout/config.py b/samples/python/42.scaleout/config.py index 69303de926..e09d90c738 100644 --- a/samples/python/42.scaleout/config.py +++ b/samples/python/42.scaleout/config.py @@ -13,6 +13,8 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") BLOB_ACCOUNT_NAME = "" BLOB_KEY = "" BLOB_CONTAINER = "dialogs" diff --git a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/43.complex-dialog/config.py b/samples/python/43.complex-dialog/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/43.complex-dialog/config.py +++ b/samples/python/43.complex-dialog/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/44.prompt-for-user-input/config.py b/samples/python/44.prompt-for-user-input/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/44.prompt-for-user-input/config.py +++ b/samples/python/44.prompt-for-user-input/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/45.state-management/config.py b/samples/python/45.state-management/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/45.state-management/config.py +++ b/samples/python/45.state-management/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/47.inspection/config.py b/samples/python/47.inspection/config.py index e007d0fa9f..2be699ba9d 100644 --- a/samples/python/47.inspection/config.py +++ b/samples/python/47.inspection/config.py @@ -13,3 +13,5 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") diff --git a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/config.py b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/config.py index 6ec4748cbe..18f1a75be7 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/config.py +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/config.py @@ -9,12 +9,10 @@ class DefaultConfig: """ Bot Configuration """ PORT = 39783 - APP_ID = os.environ.get( - "MicrosoftAppId", "" - ) - APP_PASSWORD = os.environ.get( - "MicrosoftAppPassword", "" - ) + APP_ID = os.environ.get("MicrosoftAppId", "") + APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") # Callers to only those specified, '*' allows any caller. # Example: os.environ.get("AllowedCallers", ["aaaaaa-1111-1111-1111-aaaaaaaaaa"]) diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/config.py b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/config.py index 7cf56baa42..1a0345af73 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/config.py +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/config.py @@ -11,12 +11,10 @@ class DefaultConfig: """ Bot Configuration """ PORT = 3978 - APP_ID = os.environ.get( - "MicrosoftAppId", "" - ) - APP_PASSWORD = os.environ.get( - "MicrosoftAppPassword", "" - ) + APP_ID = os.environ.get("MicrosoftAppId", "") + APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") SKILL_HOST_ENDPOINT = "http://localhost:3978/api/skills" SKILLS = [ { diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/config.py b/samples/python/81.skills-skilldialog/dialog-root-bot/config.py index 8e790f5b38..f85e6c5e88 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/config.py +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/config.py @@ -12,9 +12,9 @@ class DefaultConfig: PORT = 3978 APP_ID = os.environ.get("MicrosoftAppId", "") - APP_PASSWORD = os.environ.get( - "MicrosoftAppPassword", "" - ) + APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") SKILL_HOST_ENDPOINT = "http://localhost:3978/api/skills" SKILLS = [ { diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/config.py b/samples/python/81.skills-skilldialog/dialog-skill-bot/config.py index 00e7459adc..0627000036 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/config.py +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/config.py @@ -11,6 +11,8 @@ class DefaultConfig: PORT = 39783 APP_ID = os.environ.get("MicrosoftAppId", "") APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "") + APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") + APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") # Callers to only those specified, '*' allows any caller. # Example: os.environ.get("AllowedCallers", ["aaaaaaaa-1111-aaaa-aaaa-aaaaaaaa"]) diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json index cc1800c0db..d8711d09a0 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -14,8 +14,14 @@ "botEndpoint": { "value": "" }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json index 54a7d62890..2fbe5cce63 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" + } } - } } \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md index c86cbf9db7..8ad61ea5f6 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -14,13 +14,17 @@ BotApp must be deployed prior to AzureBot. - **newAppServicePlanName**: The name of the App Service Plan. - **newAppServicePlanLocation**: The location of the App Service Plan. - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. -- **appSecret**: (required) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. ## Parameters for template-AzureBot-with-rg.json: -- **azureBotId**: (required) The globally unique and immutable bot ID. -- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). -- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. -- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json index 60c9c1bb6c..b1682a6df9 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -29,15 +29,47 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -55,6 +87,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 3a44abf249..2493d4b002 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -49,6 +49,17 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -61,12 +72,34 @@ "metadata": { "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", - "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]" + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -90,12 +123,13 @@ "comments": "Create a Web App using an App Service Plan", "type": "Microsoft.Web/sites", "apiVersion": "2015-08-01", - "name": "[parameters('appServiceName')]", "location": "[variables('servicePlanLocation')]", "kind": "app,linux", "dependsOn": [ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "enabled": true, "hostNameSslStates": [ @@ -125,6 +159,10 @@ "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", "value": "true" }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" @@ -132,6 +170,10 @@ { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -168,7 +210,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json index f180618138..57e65e144e 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -20,8 +20,14 @@ "botEndpoint": { "value": "" }, - "appId": { + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { "value": "" - } - } + } + } } \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json index f3f07b4972..fc7629794e 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -26,11 +26,17 @@ "capacity": 1 } }, + "appType": { + "value": "MultiTenant" + }, "appId": { "value": "" }, "appSecret": { "value": "" + }, + "tenantId": { + "value": "" } } } \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md index dbdfabf9a9..540f6a6e9f 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -9,19 +9,33 @@ BotApp must be deployed prior to AzureBot. - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. -- **appServiceName**: (required) The location of the App Service Plan. -- **appServicePlanName**: (required) The name of the App Service Plan. -- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. -- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. - **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + ## Parameters for template-AzureBot-new-rg.json: - **groupName**: (required) The name of the new Resource Group. - **groupLocation**: (required) The location of the new Resource Group. + - **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. - **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). - **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. - **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. -- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. \ No newline at end of file + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json index 927307e0fc..f130c48f8b 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -41,15 +41,48 @@ "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." } }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } } }, "variables": { - "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]" + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } }, "resources": [ { @@ -90,6 +123,8 @@ "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "endpoint": "[variables('botEndpoint')]", "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", "luisAppIds": [], "schemaTransformationVersion": "1.3", "isCmekEnabled": false, diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index 612112a32b..f6147701d3 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -46,6 +46,24 @@ "description": "The SKU of the App Service Plan. Defaults to Standard values." } }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, "appId": { "type": "string", "metadata": { @@ -60,10 +78,26 @@ } }, "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", "appServicePlanName": "[parameters('appServicePlanName')]", "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", "appServiceName": "[parameters('appServiceName')]", - "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]" + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } }, "resources": [ { @@ -115,6 +149,7 @@ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" ], "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", "properties": { "name": "[variables('appServiceName')]", "hostNameSslStates": [ @@ -137,12 +172,19 @@ "value": "true" }, { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { "name": "MicrosoftAppId", "value": "[parameters('appId')]" }, { "name": "MicrosoftAppPassword", "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" } ], "cors": { @@ -180,7 +222,7 @@ "phpVersion": "", "pythonVersion": "", "nodeVersion": "", - "linuxFxVersion": "PYTHON|3.7", + "linuxFxVersion": "PYTHON|3.9", "requestTracingEnabled": false, "remoteDebuggingEnabled": false, "remoteDebuggingVersion": "VS2017", diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json new file mode 100644 index 0000000000..d8711d09a0 --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json new file mode 100644 index 0000000000..2fbe5cce63 --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "value": "" + }, + "existingAppServicePlanName": { + "value": "" + }, + "existingAppServicePlanLocation": { + "value": "" + }, + "newAppServicePlanName": { + "value": "" + }, + "newAppServicePlanLocation": { + "value": "West US" + }, + "newAppServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md new file mode 100644 index 0000000000..8ad61ea5f6 --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -0,0 +1,30 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment group create --resource-group --template-file --parameters @` + +## Parameters for template-BotApp-with-rg.json: + +- **appServiceName**: (required) The Name of the Bot App Service. +- (Pick an existing App Service Plan or create a new App Service Plan.) + - **existingAppServicePlanName**: The name of the App Service Plan. + - **existingAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanName**: The name of the App Service Plan. + - **newAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +## Parameters for template-AzureBot-with-rg.json: + +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json new file mode 100644 index 0000000000..b1682a6df9 --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default)." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope." + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "apiVersion": "2021-05-01-preview", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json new file mode 100644 index 0000000000..2493d4b002 --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -0,0 +1,252 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "existingAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the existing App Service Plan used to create the Web App for the bot." + } + }, + "existingAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the new App Service Plan." + } + }, + "newAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", + "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.", + "type": "Microsoft.Web/serverfarms", + "condition": "[not(variables('useExistingServicePlan'))]", + "name": "[variables('servicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[parameters('newAppServicePlanLocation')]", + "sku": "[parameters('newAppServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('servicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using an App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('servicePlanLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" + ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "enabled": true, + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]", + "reserved": true, + "scmSiteAlsoStopped": false, + "clientAffinityEnabled": false, + "clientCertEnabled": false, + "hostNamesDisabled": false, + "containerSize": 0, + "dailyMemoryTimeQuota": 0, + "httpsOnly": false, + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + } + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('servicePlanLocation')]", + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json new file mode 100644 index 0000000000..57e65e144e --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json new file mode 100644 index 0000000000..fc7629794e --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "appServiceName": { + "value": "" + }, + "appServicePlanName": { + "value": "" + }, + "appServicePlanLocation": { + "value": "" + }, + "appServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md new file mode 100644 index 0000000000..540f6a6e9f --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -0,0 +1,41 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment sub create --template-file --location --parameters @` + +## Parameters for template-BotApp-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + + +## Parameters for template-AzureBot-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json new file mode 100644 index 0000000000..f130c48f8b --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -0,0 +1,139 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "" + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "apiVersion": "2021-03-01", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json new file mode 100644 index 0000000000..f6147701d3 --- /dev/null +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -0,0 +1,269 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "appServicePlanName": { + "type": "string", + "metadata": { + "description": "The name of the App Service Plan." + } + }, + "appServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "appServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appServicePlanName": "[parameters('appServicePlanName')]", + "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", + "appServiceName": "[parameters('appServiceName')]", + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "comments": "Create a new App Service Plan", + "type": "Microsoft.Web/serverfarms", + "name": "[variables('appServicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[variables('resourcesLocation')]", + "sku": "[parameters('appServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('appServicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using the new App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('resourcesLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" + ], + "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "name": "[variables('appServiceName')]", + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[variables('appServicePlanName')]", + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + }, + "webSocketsEnabled": true + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('resourcesLocation')]", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ], + "outputs": {} + } + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json new file mode 100644 index 0000000000..d8711d09a0 --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json new file mode 100644 index 0000000000..2fbe5cce63 --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "value": "" + }, + "existingAppServicePlanName": { + "value": "" + }, + "existingAppServicePlanLocation": { + "value": "" + }, + "newAppServicePlanName": { + "value": "" + }, + "newAppServicePlanLocation": { + "value": "West US" + }, + "newAppServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md new file mode 100644 index 0000000000..8ad61ea5f6 --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -0,0 +1,30 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment group create --resource-group --template-file --parameters @` + +## Parameters for template-BotApp-with-rg.json: + +- **appServiceName**: (required) The Name of the Bot App Service. +- (Pick an existing App Service Plan or create a new App Service Plan.) + - **existingAppServicePlanName**: The name of the App Service Plan. + - **existingAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanName**: The name of the App Service Plan. + - **newAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +## Parameters for template-AzureBot-with-rg.json: + +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json new file mode 100644 index 0000000000..b1682a6df9 --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default)." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope." + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "apiVersion": "2021-05-01-preview", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json new file mode 100644 index 0000000000..2493d4b002 --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -0,0 +1,252 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "existingAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the existing App Service Plan used to create the Web App for the bot." + } + }, + "existingAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the new App Service Plan." + } + }, + "newAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", + "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.", + "type": "Microsoft.Web/serverfarms", + "condition": "[not(variables('useExistingServicePlan'))]", + "name": "[variables('servicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[parameters('newAppServicePlanLocation')]", + "sku": "[parameters('newAppServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('servicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using an App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('servicePlanLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" + ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "enabled": true, + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]", + "reserved": true, + "scmSiteAlsoStopped": false, + "clientAffinityEnabled": false, + "clientCertEnabled": false, + "hostNamesDisabled": false, + "containerSize": 0, + "dailyMemoryTimeQuota": 0, + "httpsOnly": false, + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + } + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('servicePlanLocation')]", + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json new file mode 100644 index 0000000000..57e65e144e --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json new file mode 100644 index 0000000000..fc7629794e --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "appServiceName": { + "value": "" + }, + "appServicePlanName": { + "value": "" + }, + "appServicePlanLocation": { + "value": "" + }, + "appServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md new file mode 100644 index 0000000000..540f6a6e9f --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -0,0 +1,41 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment sub create --template-file --location --parameters @` + +## Parameters for template-BotApp-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + + +## Parameters for template-AzureBot-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json new file mode 100644 index 0000000000..f130c48f8b --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -0,0 +1,139 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "" + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "apiVersion": "2021-03-01", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json new file mode 100644 index 0000000000..f6147701d3 --- /dev/null +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -0,0 +1,269 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "appServicePlanName": { + "type": "string", + "metadata": { + "description": "The name of the App Service Plan." + } + }, + "appServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "appServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appServicePlanName": "[parameters('appServicePlanName')]", + "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", + "appServiceName": "[parameters('appServiceName')]", + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "comments": "Create a new App Service Plan", + "type": "Microsoft.Web/serverfarms", + "name": "[variables('appServicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[variables('resourcesLocation')]", + "sku": "[parameters('appServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('appServicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using the new App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('resourcesLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" + ], + "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "name": "[variables('appServiceName')]", + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[variables('appServicePlanName')]", + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + }, + "webSocketsEnabled": true + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('resourcesLocation')]", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ], + "outputs": {} + } + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json new file mode 100644 index 0000000000..d8711d09a0 --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json new file mode 100644 index 0000000000..2fbe5cce63 --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "value": "" + }, + "existingAppServicePlanName": { + "value": "" + }, + "existingAppServicePlanLocation": { + "value": "" + }, + "newAppServicePlanName": { + "value": "" + }, + "newAppServicePlanLocation": { + "value": "West US" + }, + "newAppServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md new file mode 100644 index 0000000000..8ad61ea5f6 --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -0,0 +1,30 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment group create --resource-group --template-file --parameters @` + +## Parameters for template-BotApp-with-rg.json: + +- **appServiceName**: (required) The Name of the Bot App Service. +- (Pick an existing App Service Plan or create a new App Service Plan.) + - **existingAppServicePlanName**: The name of the App Service Plan. + - **existingAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanName**: The name of the App Service Plan. + - **newAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +## Parameters for template-AzureBot-with-rg.json: + +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json new file mode 100644 index 0000000000..b1682a6df9 --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default)." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope." + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "apiVersion": "2021-05-01-preview", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json new file mode 100644 index 0000000000..2493d4b002 --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -0,0 +1,252 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "existingAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the existing App Service Plan used to create the Web App for the bot." + } + }, + "existingAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the new App Service Plan." + } + }, + "newAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", + "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.", + "type": "Microsoft.Web/serverfarms", + "condition": "[not(variables('useExistingServicePlan'))]", + "name": "[variables('servicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[parameters('newAppServicePlanLocation')]", + "sku": "[parameters('newAppServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('servicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using an App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('servicePlanLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" + ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "enabled": true, + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]", + "reserved": true, + "scmSiteAlsoStopped": false, + "clientAffinityEnabled": false, + "clientCertEnabled": false, + "hostNamesDisabled": false, + "containerSize": 0, + "dailyMemoryTimeQuota": 0, + "httpsOnly": false, + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + } + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('servicePlanLocation')]", + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json new file mode 100644 index 0000000000..57e65e144e --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json new file mode 100644 index 0000000000..fc7629794e --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "appServiceName": { + "value": "" + }, + "appServicePlanName": { + "value": "" + }, + "appServicePlanLocation": { + "value": "" + }, + "appServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md new file mode 100644 index 0000000000..540f6a6e9f --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -0,0 +1,41 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment sub create --template-file --location --parameters @` + +## Parameters for template-BotApp-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + + +## Parameters for template-AzureBot-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json new file mode 100644 index 0000000000..f130c48f8b --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -0,0 +1,139 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "" + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "apiVersion": "2021-03-01", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json new file mode 100644 index 0000000000..f6147701d3 --- /dev/null +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -0,0 +1,269 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "appServicePlanName": { + "type": "string", + "metadata": { + "description": "The name of the App Service Plan." + } + }, + "appServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "appServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appServicePlanName": "[parameters('appServicePlanName')]", + "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", + "appServiceName": "[parameters('appServiceName')]", + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "comments": "Create a new App Service Plan", + "type": "Microsoft.Web/serverfarms", + "name": "[variables('appServicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[variables('resourcesLocation')]", + "sku": "[parameters('appServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('appServicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using the new App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('resourcesLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" + ], + "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "name": "[variables('appServiceName')]", + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[variables('appServicePlanName')]", + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + }, + "webSocketsEnabled": true + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('resourcesLocation')]", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ], + "outputs": {} + } + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json new file mode 100644 index 0000000000..d8711d09a0 --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json new file mode 100644 index 0000000000..2fbe5cce63 --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "value": "" + }, + "existingAppServicePlanName": { + "value": "" + }, + "existingAppServicePlanLocation": { + "value": "" + }, + "newAppServicePlanName": { + "value": "" + }, + "newAppServicePlanLocation": { + "value": "West US" + }, + "newAppServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md new file mode 100644 index 0000000000..8ad61ea5f6 --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -0,0 +1,30 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment group create --resource-group --template-file --parameters @` + +## Parameters for template-BotApp-with-rg.json: + +- **appServiceName**: (required) The Name of the Bot App Service. +- (Pick an existing App Service Plan or create a new App Service Plan.) + - **existingAppServicePlanName**: The name of the App Service Plan. + - **existingAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanName**: The name of the App Service Plan. + - **newAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +## Parameters for template-AzureBot-with-rg.json: + +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json new file mode 100644 index 0000000000..b1682a6df9 --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default)." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope." + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "apiVersion": "2021-05-01-preview", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json new file mode 100644 index 0000000000..2493d4b002 --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -0,0 +1,252 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "existingAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the existing App Service Plan used to create the Web App for the bot." + } + }, + "existingAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the new App Service Plan." + } + }, + "newAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", + "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.", + "type": "Microsoft.Web/serverfarms", + "condition": "[not(variables('useExistingServicePlan'))]", + "name": "[variables('servicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[parameters('newAppServicePlanLocation')]", + "sku": "[parameters('newAppServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('servicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using an App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('servicePlanLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" + ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "enabled": true, + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]", + "reserved": true, + "scmSiteAlsoStopped": false, + "clientAffinityEnabled": false, + "clientCertEnabled": false, + "hostNamesDisabled": false, + "containerSize": 0, + "dailyMemoryTimeQuota": 0, + "httpsOnly": false, + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + } + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('servicePlanLocation')]", + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json new file mode 100644 index 0000000000..57e65e144e --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json new file mode 100644 index 0000000000..fc7629794e --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "appServiceName": { + "value": "" + }, + "appServicePlanName": { + "value": "" + }, + "appServicePlanLocation": { + "value": "" + }, + "appServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md new file mode 100644 index 0000000000..540f6a6e9f --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -0,0 +1,41 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment sub create --template-file --location --parameters @` + +## Parameters for template-BotApp-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + + +## Parameters for template-AzureBot-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json new file mode 100644 index 0000000000..f130c48f8b --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -0,0 +1,139 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "" + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "apiVersion": "2021-03-01", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json new file mode 100644 index 0000000000..f6147701d3 --- /dev/null +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -0,0 +1,269 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "appServicePlanName": { + "type": "string", + "metadata": { + "description": "The name of the App Service Plan." + } + }, + "appServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "appServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appServicePlanName": "[parameters('appServicePlanName')]", + "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", + "appServiceName": "[parameters('appServiceName')]", + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "comments": "Create a new App Service Plan", + "type": "Microsoft.Web/serverfarms", + "name": "[variables('appServicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[variables('resourcesLocation')]", + "sku": "[parameters('appServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('appServicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using the new App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('resourcesLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" + ], + "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "name": "[variables('appServiceName')]", + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[variables('appServicePlanName')]", + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + }, + "webSocketsEnabled": true + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('resourcesLocation')]", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ], + "outputs": {} + } + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json new file mode 100644 index 0000000000..d8711d09a0 --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json new file mode 100644 index 0000000000..2fbe5cce63 --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "value": "" + }, + "existingAppServicePlanName": { + "value": "" + }, + "existingAppServicePlanLocation": { + "value": "" + }, + "newAppServicePlanName": { + "value": "" + }, + "newAppServicePlanLocation": { + "value": "West US" + }, + "newAppServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md new file mode 100644 index 0000000000..8ad61ea5f6 --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/readme.md @@ -0,0 +1,30 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment group create --resource-group --template-file --parameters @` + +## Parameters for template-BotApp-with-rg.json: + +- **appServiceName**: (required) The Name of the Bot App Service. +- (Pick an existing App Service Plan or create a new App Service Plan.) + - **existingAppServicePlanName**: The name of the App Service Plan. + - **existingAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanName**: The name of the App Service Plan. + - **newAppServicePlanLocation**: The location of the App Service Plan. + - **newAppServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. **Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI.** +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +## Parameters for template-AzureBot-with-rg.json: + +- **azureBotId**: (required) The globally unique and immutable bot ID. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json new file mode 100644 index 0000000000..b1682a6df9 --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-AzureBot-with-rg.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default)." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope." + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "apiVersion": "2021-05-01-preview", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json new file mode 100644 index 0000000000..2493d4b002 --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -0,0 +1,252 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "existingAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Name of the existing App Service Plan used to create the Web App for the bot." + } + }, + "existingAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanName": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The name of the new App Service Plan." + } + }, + "newAppServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "newAppServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types. Defaults to \"\"." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "useExistingServicePlan": "[not(empty(parameters('existingAppServicePlanName')))]", + "servicePlanName": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanName'), parameters('newAppServicePlanName'))]", + "servicePlanLocation": "[if(variables('useExistingServicePlan'), parameters('existingAppServicePlanLocation'), parameters('newAppServicePlanLocation'))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "comments": "Create a new App Service Plan if no existing App Service Plan name was passed in.", + "type": "Microsoft.Web/serverfarms", + "condition": "[not(variables('useExistingServicePlan'))]", + "name": "[variables('servicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[parameters('newAppServicePlanLocation')]", + "sku": "[parameters('newAppServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('servicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using an App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('servicePlanLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]" + ], + "name": "[parameters('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "enabled": true, + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]", + "reserved": true, + "scmSiteAlsoStopped": false, + "clientAffinityEnabled": false, + "clientCertEnabled": false, + "hostNamesDisabled": false, + "containerSize": 0, + "dailyMemoryTimeQuota": 0, + "httpsOnly": false, + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, + { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + } + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('servicePlanLocation')]", + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json new file mode 100644 index 0000000000..57e65e144e --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "azureBotId": { + "value": "" + }, + "azureBotSku": { + "value": "S1" + }, + "azureBotRegion": { + "value": "global" + }, + "botEndpoint": { + "value": "" + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json new file mode 100644 index 0000000000..fc7629794e --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "value": "" + }, + "groupLocation": { + "value": "" + }, + "appServiceName": { + "value": "" + }, + "appServicePlanName": { + "value": "" + }, + "appServicePlanLocation": { + "value": "" + }, + "appServicePlanSku": { + "value": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + } + }, + "appType": { + "value": "MultiTenant" + }, + "appId": { + "value": "" + }, + "appSecret": { + "value": "" + }, + "tenantId": { + "value": "" + } + } +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md new file mode 100644 index 0000000000..540f6a6e9f --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/readme.md @@ -0,0 +1,41 @@ +# Usage +BotApp must be deployed prior to AzureBot. + +### Command line: +`az login`
+`az deployment sub create --template-file --location --parameters @` + +## Parameters for template-BotApp-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **appServiceName**: (required) The location of the App Service Plan. +- **appServicePlanName**: (required) The name of the App Service Plan. +- **appServicePlanLocation**: The location of the App Service Plan. Defaults to use groupLocation. +- **appServicePlanSku**: The SKU of the App Service Plan. Defaults to Standard values. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **appSecret**: (required for MultiTenant and SingleTenant) Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to . + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource + + + +## Parameters for template-AzureBot-new-rg.json: + +- **groupName**: (required) The name of the new Resource Group. +- **groupLocation**: (required) The location of the new Resource Group. + +- **azureBotId**: (required) The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable. +- **azureBotSku**: The pricing tier of the Bot Service Registration. Allowed values are: F0, S1(default). +- **azureBotRegion**: Specifies the location of the new AzureBot. Allowed values are: global(default), westeurope. +- **botEndpoint**: Use to handle client messages, Such as `https://.azurewebsites.net/api/messages`. + +- **appType**: Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant(default), SingleTenant, UserAssignedMSI. +- **appId**: (required) Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings. +- **tenantId**: The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to Subscription Tenant ID. + +More info: https://docs.microsoft.com/en-us/azure/bot-service/tutorial-provision-a-bot?view=azure-bot-service-4.0&tabs=userassigned%2Cnewgroup#create-an-identity-resource \ No newline at end of file diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json new file mode 100644 index 0000000000..f130c48f8b --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-AzureBot-new-rg.json @@ -0,0 +1,139 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "azureBotId": { + "type": "string", + "metadata": { + "description": "The globally unique and immutable bot ID." + } + }, + "azureBotSku": { + "type": "string", + "defaultValue": "S1", + "metadata": { + "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1." + } + }, + "azureBotRegion": { + "type": "string", + "defaultValue": "global", + "metadata": { + "description": "" + } + }, + "botEndpoint": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "Use to handle client messages, Such as https://.azurewebsites.net/api/messages." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + } + }, + "variables": { + "botEndpoint": "[if(empty(parameters('botEndpoint')), concat('https://', parameters('azureBotId'), '.azurewebsites.net/api/messages'), parameters('botEndpoint'))]", + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "msiResourceId": "" + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "msiResourceId": "" + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "apiVersion": "2021-03-01", + "type": "Microsoft.BotService/botServices", + "name": "[parameters('azureBotId')]", + "location": "[parameters('azureBotRegion')]", + "kind": "azurebot", + "sku": { + "name": "[parameters('azureBotSku')]" + }, + "properties": { + "name": "[parameters('azureBotId')]", + "displayName": "[parameters('azureBotId')]", + "iconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('appId')]", + "msaAppTenantId": "[variables('appType').tenantId]", + "msaAppType": "[parameters('appType')]", + "luisAppIds": [], + "schemaTransformationVersion": "1.3", + "isCmekEnabled": false, + "isIsolated": false + } + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json new file mode 100644 index 0000000000..f6147701d3 --- /dev/null +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -0,0 +1,269 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "groupName": { + "type": "string", + "metadata": { + "description": "Specifies the name of the Resource Group." + } + }, + "groupLocation": { + "type": "string", + "metadata": { + "description": "Specifies the location of the Resource Group." + } + }, + "appServiceName": { + "type": "string", + "metadata": { + "description": "The globally unique name of the Web App." + } + }, + "appServicePlanName": { + "type": "string", + "metadata": { + "description": "The name of the App Service Plan." + } + }, + "appServicePlanLocation": { + "type": "string", + "defaultValue": "", + "metadata": { + "description": "The location of the App Service Plan." + } + }, + "appServicePlanSku": { + "type": "object", + "defaultValue": { + "name": "S1", + "tier": "Standard", + "size": "S1", + "family": "S", + "capacity": 1 + }, + "metadata": { + "description": "The SKU of the App Service Plan. Defaults to Standard values." + } + }, + "tenantId": { + "type": "string", + "defaultValue": "[subscription().tenantId]", + "metadata": { + "description": "The Azure AD Tenant ID to use as part of the Bot's Authentication. Only used for SingleTenant and UserAssignedMSI app types. Defaults to \"Subscription Tenant ID\"." + } + }, + "appType": { + "type": "string", + "defaultValue": "MultiTenant", + "allowedValues": [ + "MultiTenant", + "SingleTenant" + ], + "metadata": { + "description": "Type of Bot Authentication. set as MicrosoftAppType in the Web App's Application Settings. Allowed values are: MultiTenant, SingleTenant, UserAssignedMSI. Defaults to \"MultiTenant\"." + } + }, + "appId": { + "type": "string", + "metadata": { + "description": "Active Directory App ID or User-Assigned Managed Identity Client ID, set as MicrosoftAppId in the Web App's Application Settings." + } + }, + "appSecret": { + "type": "string", + "metadata": { + "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Required for MultiTenant and SingleTenant app types." + } + } + }, + "variables": { + "tenantId": "[if(empty(parameters('tenantId')), subscription().tenantId, parameters('tenantId'))]", + "appServicePlanName": "[parameters('appServicePlanName')]", + "resourcesLocation": "[if(empty(parameters('appServicePlanLocation')), parameters('groupLocation'), parameters('appServicePlanLocation'))]", + "appServiceName": "[parameters('appServiceName')]", + "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]", + "msiResourceId": "[if(empty(parameters('UMSIName')), '', concat(subscription().id, '/resourceGroups/', parameters('UMSIResourceGroupName'), '/providers/', 'Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('UMSIName')))]", + "appTypeDef": { + "MultiTenant": { + "tenantId": "", + "identity": { "type": "None" } + }, + "SingleTenant": { + "tenantId": "[variables('tenantId')]", + "identity": { "type": "None" } + } + }, + "appType": { + "tenantId": "[variables('appTypeDef')[parameters('appType')].tenantId]", + "identity": "[variables('appTypeDef')[parameters('appType')].identity]" + } + }, + "resources": [ + { + "name": "[parameters('groupName')]", + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "[parameters('groupLocation')]", + "properties": {} + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2018-05-01", + "name": "storageDeployment", + "resourceGroup": "[parameters('groupName')]", + "dependsOn": [ + "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "comments": "Create a new App Service Plan", + "type": "Microsoft.Web/serverfarms", + "name": "[variables('appServicePlanName')]", + "apiVersion": "2018-02-01", + "location": "[variables('resourcesLocation')]", + "sku": "[parameters('appServicePlanSku')]", + "kind": "linux", + "properties": { + "name": "[variables('appServicePlanName')]", + "perSiteScaling": false, + "reserved": true, + "targetWorkerCount": 0, + "targetWorkerSizeId": 0 + } + }, + { + "comments": "Create a Web App using the new App Service Plan", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "location": "[variables('resourcesLocation')]", + "kind": "app,linux", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]" + ], + "name": "[variables('appServiceName')]", + "identity": "[variables('appType').identity]", + "properties": { + "name": "[variables('appServiceName')]", + "hostNameSslStates": [ + { + "name": "[concat(parameters('appServiceName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('appServiceName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[variables('appServicePlanName')]", + "siteConfig": { + "appSettings": [ + { + "name": "SCM_DO_BUILD_DURING_DEPLOYMENT", + "value": "true" + }, + { + "name": "MicrosoftAppType", + "value": "[parameters('appType')]" + }, { + "name": "MicrosoftAppId", + "value": "[parameters('appId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('appSecret')]" + }, + { + "name": "MicrosoftAppTenantId", + "value": "[variables('appType').tenantId]" + } + ], + "cors": { + "allowedOrigins": [ + "https://botservice.hosting.portal.azure.net", + "https://hosting.onecloud.azure-test.net/" + ] + }, + "webSocketsEnabled": true + } + } + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2016-08-01", + "name": "[concat(parameters('appServiceName'), '/web')]", + "location": "[variables('resourcesLocation')]", + "dependsOn": [ + "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', parameters('appServiceName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "Default.htm", + "Default.html", + "Default.asp", + "index.htm", + "index.html", + "iisstart.htm", + "default.aspx", + "index.php", + "hostingstart.html" + ], + "netFrameworkVersion": "v4.0", + "phpVersion": "", + "pythonVersion": "", + "nodeVersion": "", + "linuxFxVersion": "PYTHON|3.9", + "requestTracingEnabled": false, + "remoteDebuggingEnabled": false, + "remoteDebuggingVersion": "VS2017", + "httpLoggingEnabled": true, + "logsDirectorySizeLimit": 35, + "detailedErrorLoggingEnabled": false, + "publishingUsername": "[concat('$', parameters('appServiceName'))]", + "scmType": "None", + "use32BitWorkerProcess": true, + "webSocketsEnabled": false, + "alwaysOn": false, + "appCommandLine": "gunicorn --bind 0.0.0.0 --worker-class aiohttp.worker.GunicornWebWorker --timeout 600 app:APP", + "managedPipelineMode": "Integrated", + "virtualApplications": [ + { + "virtualPath": "/", + "physicalPath": "site\\wwwroot", + "preloadEnabled": false, + "virtualDirectories": null + } + ], + "winAuthAdminState": 0, + "winAuthTenantState": 0, + "customAppPoolIdentityAdminState": false, + "customAppPoolIdentityTenantState": false, + "loadBalancing": "LeastRequests", + "routingRules": [], + "experiments": { + "rampUpRules": [] + }, + "autoHealEnabled": false, + "vnetName": "", + "minTlsVersion": "1.2", + "ftpsState": "AllAllowed", + "reservedInstanceCount": 0 + } + } + ], + "outputs": {} + } + } + } + ] +} \ No newline at end of file From 832ea43bb4f20df1567faf4971df5cb5633c8cc3 Mon Sep 17 00:00:00 2001 From: tracyboehrer Date: Wed, 17 Apr 2024 13:22:39 -0500 Subject: [PATCH 09/21] Bumped Python samples to >=4.15.0 (#3966) Co-authored-by: Tracy Boehrer --- samples/python/01.console-echo/requirements.txt | 6 +++--- samples/python/02.echo-bot/requirements.txt | 2 +- samples/python/03.welcome-user/requirements.txt | 2 +- .../python/05.multi-turn-prompt/requirements.txt | 6 +++--- samples/python/06.using-cards/requirements.txt | 4 ++-- .../07.using-adaptive-cards/requirements.txt | 2 +- .../python/08.suggested-actions/requirements.txt | 2 +- samples/python/13.core-bot/requirements.txt | 6 +++--- .../15.handling-attachments/requirements.txt | 2 +- .../python/16.proactive-messages/requirements.txt | 2 +- .../python/17.multilingual-bot/requirements.txt | 2 +- .../python/18.bot-authentication/requirements.txt | 4 ++-- samples/python/19.custom-dialogs/requirements.txt | 4 ++-- .../21.corebot-app-insights/requirements.txt | 14 +++++++------- samples/python/23.facebook-events/requirements.txt | 2 +- .../24.bot-authentication-msgraph/requirements.txt | 4 ++-- samples/python/42.scaleout/requirements.txt | 4 ++-- samples/python/43.complex-dialog/requirements.txt | 4 ++-- .../44.prompt-for-user-input/requirements.txt | 2 +- .../python/45.state-management/requirements.txt | 2 +- samples/python/47.inspection/requirements.txt | 2 +- .../echo-skill-bot/requirements.txt | 2 +- .../simple-root-bot/requirements.txt | 2 +- .../dialog-root-bot/requirements.txt | 4 ++-- .../dialog-skill-bot/requirements.txt | 6 +++--- 25 files changed, 46 insertions(+), 46 deletions(-) diff --git a/samples/python/01.console-echo/requirements.txt b/samples/python/01.console-echo/requirements.txt index 4408e35538..7db7e38281 100644 --- a/samples/python/01.console-echo/requirements.txt +++ b/samples/python/01.console-echo/requirements.txt @@ -1,4 +1,4 @@ asyncio>=3.4.3 -botbuilder-core>=4.14.0 -botbuilder-schema>=4.14.0 -botframework-connector>=4.14.0 \ No newline at end of file +botbuilder-core>=4.15.0 +botbuilder-schema>=4.15.0 +botframework-connector>=4.15.0 \ No newline at end of file diff --git a/samples/python/02.echo-bot/requirements.txt b/samples/python/02.echo-bot/requirements.txt index ff97d8e13e..2b2e3ab57e 100644 --- a/samples/python/02.echo-bot/requirements.txt +++ b/samples/python/02.echo-bot/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp==4.15.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/03.welcome-user/requirements.txt b/samples/python/03.welcome-user/requirements.txt index d30eb4f06f..2b2e3ab57e 100644 --- a/samples/python/03.welcome-user/requirements.txt +++ b/samples/python/03.welcome-user/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/05.multi-turn-prompt/requirements.txt b/samples/python/05.multi-turn-prompt/requirements.txt index cb942b82a2..f5b3ab456c 100644 --- a/samples/python/05.multi-turn-prompt/requirements.txt +++ b/samples/python/05.multi-turn-prompt/requirements.txt @@ -1,5 +1,5 @@ emoji<2.0.0 -botbuilder-integration-aiohttp>=4.14.0 -botbuilder-dialogs>=4.14.0 -botbuilder-ai>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 +botbuilder-ai>=4.15.0 diff --git a/samples/python/06.using-cards/requirements.txt b/samples/python/06.using-cards/requirements.txt index d27d6571d8..f5bb68e8f5 100644 --- a/samples/python/06.using-cards/requirements.txt +++ b/samples/python/06.using-cards/requirements.txt @@ -1,2 +1,2 @@ -botbuilder-integration-aiohttp>=4.14.0 -botbuilder-dialogs>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 diff --git a/samples/python/07.using-adaptive-cards/requirements.txt b/samples/python/07.using-adaptive-cards/requirements.txt index d30eb4f06f..2b2e3ab57e 100644 --- a/samples/python/07.using-adaptive-cards/requirements.txt +++ b/samples/python/07.using-adaptive-cards/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/08.suggested-actions/requirements.txt b/samples/python/08.suggested-actions/requirements.txt index d30eb4f06f..2b2e3ab57e 100644 --- a/samples/python/08.suggested-actions/requirements.txt +++ b/samples/python/08.suggested-actions/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/13.core-bot/requirements.txt b/samples/python/13.core-bot/requirements.txt index 7b5b7c172e..7b8ad45694 100644 --- a/samples/python/13.core-bot/requirements.txt +++ b/samples/python/13.core-bot/requirements.txt @@ -1,5 +1,5 @@ -botbuilder-integration-aiohttp>=4.14.0 -botbuilder-dialogs>=4.14.0 -botbuilder-ai>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 +botbuilder-ai>=4.15.0 datatypes-date-time>=1.0.0.a2 diff --git a/samples/python/15.handling-attachments/requirements.txt b/samples/python/15.handling-attachments/requirements.txt index 193a3d61df..e1e59666a4 100644 --- a/samples/python/15.handling-attachments/requirements.txt +++ b/samples/python/15.handling-attachments/requirements.txt @@ -1,2 +1,2 @@ jsonpickle -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/16.proactive-messages/requirements.txt b/samples/python/16.proactive-messages/requirements.txt index d30eb4f06f..2b2e3ab57e 100644 --- a/samples/python/16.proactive-messages/requirements.txt +++ b/samples/python/16.proactive-messages/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/17.multilingual-bot/requirements.txt b/samples/python/17.multilingual-bot/requirements.txt index e92041e9b2..fb8a226dd2 100644 --- a/samples/python/17.multilingual-bot/requirements.txt +++ b/samples/python/17.multilingual-bot/requirements.txt @@ -1,2 +1,2 @@ requests==2.31.0 -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/18.bot-authentication/requirements.txt b/samples/python/18.bot-authentication/requirements.txt index d27d6571d8..f5bb68e8f5 100644 --- a/samples/python/18.bot-authentication/requirements.txt +++ b/samples/python/18.bot-authentication/requirements.txt @@ -1,2 +1,2 @@ -botbuilder-integration-aiohttp>=4.14.0 -botbuilder-dialogs>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 diff --git a/samples/python/19.custom-dialogs/requirements.txt b/samples/python/19.custom-dialogs/requirements.txt index d27d6571d8..f5bb68e8f5 100644 --- a/samples/python/19.custom-dialogs/requirements.txt +++ b/samples/python/19.custom-dialogs/requirements.txt @@ -1,2 +1,2 @@ -botbuilder-integration-aiohttp>=4.14.0 -botbuilder-dialogs>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 diff --git a/samples/python/21.corebot-app-insights/requirements.txt b/samples/python/21.corebot-app-insights/requirements.txt index f1db12387c..a7d3d08ed2 100644 --- a/samples/python/21.corebot-app-insights/requirements.txt +++ b/samples/python/21.corebot-app-insights/requirements.txt @@ -1,12 +1,12 @@ asyncio>=3.4.3 requests==2.31.0 -botbuilder-core>=4.14.0 -botframework-connector>=4.14.0 -botbuilder-schema>=4.14.0 -botbuilder-dialogs>=4.14.0 -botbuilder-ai>=4.14.0 -botbuilder-applicationinsights>=4.14.0 -botbuilder-integration-applicationinsights-aiohttp>=4.14.0 +botbuilder-core>=4.15.0 +botframework-connector>=4.15.0 +botbuilder-schema>=4.15.0 +botbuilder-dialogs>=4.15.0 +botbuilder-ai>=4.15.0 +botbuilder-applicationinsights>=4.15.0 +botbuilder-integration-applicationinsights-aiohttp>=4.15.0 datatypes-date-time>=1.0.0.a1 azure-cognitiveservices-language-luis>=0.2.0 msrest>=0.6.10 diff --git a/samples/python/23.facebook-events/requirements.txt b/samples/python/23.facebook-events/requirements.txt index 65742c8daa..5f4a5af76c 100644 --- a/samples/python/23.facebook-events/requirements.txt +++ b/samples/python/23.facebook-events/requirements.txt @@ -1,2 +1,2 @@ jsonpickle==1.2 -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/24.bot-authentication-msgraph/requirements.txt b/samples/python/24.bot-authentication-msgraph/requirements.txt index 1ccc3a453f..bd7ad26e53 100644 --- a/samples/python/24.bot-authentication-msgraph/requirements.txt +++ b/samples/python/24.bot-authentication-msgraph/requirements.txt @@ -1,4 +1,4 @@ -botbuilder-integration-aiohttp>=4.14.0 -botbuilder-dialogs>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 requests_oauthlib diff --git a/samples/python/42.scaleout/requirements.txt b/samples/python/42.scaleout/requirements.txt index e9305c1ee7..7bec767095 100644 --- a/samples/python/42.scaleout/requirements.txt +++ b/samples/python/42.scaleout/requirements.txt @@ -1,4 +1,4 @@ jsonpickle -botbuilder-integration-aiohttp>=4.14.0 -botbuilder-dialogs>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 azure>=4.0.0 diff --git a/samples/python/43.complex-dialog/requirements.txt b/samples/python/43.complex-dialog/requirements.txt index d27d6571d8..f5bb68e8f5 100644 --- a/samples/python/43.complex-dialog/requirements.txt +++ b/samples/python/43.complex-dialog/requirements.txt @@ -1,2 +1,2 @@ -botbuilder-integration-aiohttp>=4.14.0 -botbuilder-dialogs>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 diff --git a/samples/python/44.prompt-for-user-input/requirements.txt b/samples/python/44.prompt-for-user-input/requirements.txt index 520df586d5..160b7a4f52 100644 --- a/samples/python/44.prompt-for-user-input/requirements.txt +++ b/samples/python/44.prompt-for-user-input/requirements.txt @@ -1,4 +1,4 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 recognizers-text>=1.0.2a1 recognizers_date_time recognizers_number diff --git a/samples/python/45.state-management/requirements.txt b/samples/python/45.state-management/requirements.txt index d30eb4f06f..2b2e3ab57e 100644 --- a/samples/python/45.state-management/requirements.txt +++ b/samples/python/45.state-management/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/47.inspection/requirements.txt b/samples/python/47.inspection/requirements.txt index d30eb4f06f..2b2e3ab57e 100644 --- a/samples/python/47.inspection/requirements.txt +++ b/samples/python/47.inspection/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/requirements.txt b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/requirements.txt index bb1fec11ac..c7cd47445d 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/requirements.txt +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/requirements.txt b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/requirements.txt index bb1fec11ac..c7cd47445d 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/requirements.txt +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/requirements.txt @@ -1 +1 @@ -botbuilder-integration-aiohttp>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/requirements.txt b/samples/python/81.skills-skilldialog/dialog-root-bot/requirements.txt index 910ae52796..cfac1009a2 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/requirements.txt +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/requirements.txt @@ -1,2 +1,2 @@ -botbuilder-integration-aiohttp>=4.14.0 -botbuilder-dialogs>=4.14.0 +botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/requirements.txt b/samples/python/81.skills-skilldialog/dialog-skill-bot/requirements.txt index c58bb41a86..d6af1b7ffb 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/requirements.txt +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/requirements.txt @@ -1,5 +1,5 @@ aiohttp -botbuilder-core>=4.14.0 -botbuilder-ai>=4.14.0 -botbuilder-dialogs>=4.14.0 +botbuilder-core>=4.15.0 +botbuilder-ai>=4.15.0 +botbuilder-dialogs>=4.15.0 datatypes-date-time>=1.0.0a2 From f5577bfbba435aa47100d8079c93177383e870a6 Mon Sep 17 00:00:00 2001 From: tracyboehrer Date: Wed, 17 Apr 2024 13:25:12 -0500 Subject: [PATCH 10/21] Bumped DotNet samples to 4.22.3 (#3967) Co-authored-by: Tracy Boehrer --- .../01.console-echo/Console-EchoBot.csproj | 4 ++-- samples/csharp_dotnetcore/02.echo-bot/EchoBot.csproj | 2 +- .../03.welcome-user/WelcomeUser.csproj | 2 +- .../05.multi-turn-prompt/MultiTurnPromptBot.csproj | 4 ++-- .../csharp_dotnetcore/06.using-cards/CardsBot.csproj | 4 ++-- .../07.using-adaptive-cards/AdaptiveCardsBot.csproj | 4 ++-- .../08.suggested-actions/SuggestedActionsBot.csproj | 2 +- .../12.customQABot/CustomQABot.csproj | 4 ++-- .../13.core-bot.tests/CoreBot.Tests.csproj | 4 ++-- samples/csharp_dotnetcore/13.core-bot/CoreBot.csproj | 6 +++--- .../HandlingAttachmentsBot.csproj | 4 ++-- .../16.proactive-messages/ProactiveBot.csproj | 2 +- .../17.multilingual-bot/MultiLingualBot.csproj | 2 +- .../18.bot-authentication/AuthenticationBot.csproj | 4 ++-- .../19.custom-dialogs/Custom-Dialogs.csproj | 4 ++-- .../CoreBot-App-Insights.csproj | 10 +++++----- .../23.facebook-events/Facebook-Events-Bot.csproj | 4 ++-- .../BotAuthenticationMSGraph.csproj | 4 ++-- .../40.timex-resolution/Timex-Resolution.csproj | 2 +- .../csharp_dotnetcore/42.scaleout/ScaleoutBot.csproj | 4 ++-- .../43.complex-dialog/ComplexDialogBot.csproj | 4 ++-- .../PromptUsersForInput.csproj | 2 +- .../45.state-management/StateMangementBot.csproj | 6 +++--- .../csharp_dotnetcore/47.inspection/Inspection.csproj | 2 +- .../CustomQABotAllFeatures.csproj | 6 +++--- .../EchoSkillBot/EchoSkillBot.csproj | 2 +- .../SimpleRootBot/SimpleRootBot.csproj | 2 +- .../DialogRootBot/DialogRootBot.csproj | 4 ++-- .../DialogSkillBot/DialogSkillBot.csproj | 6 +++--- .../82.skills-sso-cloudadapter/RootBot/RootBot.csproj | 4 ++-- .../SkillBot/SkillBot.csproj | 4 ++-- .../AuthCertificateBot.csproj | 4 ++-- .../85.bot-authentication-sni/AuthSNIBot.csproj | 4 ++-- 33 files changed, 63 insertions(+), 63 deletions(-) diff --git a/samples/csharp_dotnetcore/01.console-echo/Console-EchoBot.csproj b/samples/csharp_dotnetcore/01.console-echo/Console-EchoBot.csproj index 4921c9ab23..65ee2e69b1 100644 --- a/samples/csharp_dotnetcore/01.console-echo/Console-EchoBot.csproj +++ b/samples/csharp_dotnetcore/01.console-echo/Console-EchoBot.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/02.echo-bot/EchoBot.csproj b/samples/csharp_dotnetcore/02.echo-bot/EchoBot.csproj index 95b48faab6..b4f93531d4 100644 --- a/samples/csharp_dotnetcore/02.echo-bot/EchoBot.csproj +++ b/samples/csharp_dotnetcore/02.echo-bot/EchoBot.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/csharp_dotnetcore/03.welcome-user/WelcomeUser.csproj b/samples/csharp_dotnetcore/03.welcome-user/WelcomeUser.csproj index 6bf70ca8bd..24b78edcbe 100644 --- a/samples/csharp_dotnetcore/03.welcome-user/WelcomeUser.csproj +++ b/samples/csharp_dotnetcore/03.welcome-user/WelcomeUser.csproj @@ -6,7 +6,7 @@ - + diff --git a/samples/csharp_dotnetcore/05.multi-turn-prompt/MultiTurnPromptBot.csproj b/samples/csharp_dotnetcore/05.multi-turn-prompt/MultiTurnPromptBot.csproj index 98441ca486..88c35a9542 100644 --- a/samples/csharp_dotnetcore/05.multi-turn-prompt/MultiTurnPromptBot.csproj +++ b/samples/csharp_dotnetcore/05.multi-turn-prompt/MultiTurnPromptBot.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/06.using-cards/CardsBot.csproj b/samples/csharp_dotnetcore/06.using-cards/CardsBot.csproj index 98441ca486..88c35a9542 100644 --- a/samples/csharp_dotnetcore/06.using-cards/CardsBot.csproj +++ b/samples/csharp_dotnetcore/06.using-cards/CardsBot.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/07.using-adaptive-cards/AdaptiveCardsBot.csproj b/samples/csharp_dotnetcore/07.using-adaptive-cards/AdaptiveCardsBot.csproj index 21f8688f84..db68bab443 100644 --- a/samples/csharp_dotnetcore/07.using-adaptive-cards/AdaptiveCardsBot.csproj +++ b/samples/csharp_dotnetcore/07.using-adaptive-cards/AdaptiveCardsBot.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/08.suggested-actions/SuggestedActionsBot.csproj b/samples/csharp_dotnetcore/08.suggested-actions/SuggestedActionsBot.csproj index 15fd2609a9..363a4d5766 100644 --- a/samples/csharp_dotnetcore/08.suggested-actions/SuggestedActionsBot.csproj +++ b/samples/csharp_dotnetcore/08.suggested-actions/SuggestedActionsBot.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/csharp_dotnetcore/12.customQABot/CustomQABot.csproj b/samples/csharp_dotnetcore/12.customQABot/CustomQABot.csproj index 3b035c57b0..b6359f236f 100644 --- a/samples/csharp_dotnetcore/12.customQABot/CustomQABot.csproj +++ b/samples/csharp_dotnetcore/12.customQABot/CustomQABot.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/13.core-bot.tests/CoreBot.Tests.csproj b/samples/csharp_dotnetcore/13.core-bot.tests/CoreBot.Tests.csproj index 7141c89a96..7c3191daae 100644 --- a/samples/csharp_dotnetcore/13.core-bot.tests/CoreBot.Tests.csproj +++ b/samples/csharp_dotnetcore/13.core-bot.tests/CoreBot.Tests.csproj @@ -24,8 +24,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/13.core-bot/CoreBot.csproj b/samples/csharp_dotnetcore/13.core-bot/CoreBot.csproj index ca1a9327b1..9e618c9c25 100644 --- a/samples/csharp_dotnetcore/13.core-bot/CoreBot.csproj +++ b/samples/csharp_dotnetcore/13.core-bot/CoreBot.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/samples/csharp_dotnetcore/15.handling-attachments/HandlingAttachmentsBot.csproj b/samples/csharp_dotnetcore/15.handling-attachments/HandlingAttachmentsBot.csproj index c0d2f0ca8b..b4fd56d5c7 100644 --- a/samples/csharp_dotnetcore/15.handling-attachments/HandlingAttachmentsBot.csproj +++ b/samples/csharp_dotnetcore/15.handling-attachments/HandlingAttachmentsBot.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/16.proactive-messages/ProactiveBot.csproj b/samples/csharp_dotnetcore/16.proactive-messages/ProactiveBot.csproj index 15fd2609a9..363a4d5766 100644 --- a/samples/csharp_dotnetcore/16.proactive-messages/ProactiveBot.csproj +++ b/samples/csharp_dotnetcore/16.proactive-messages/ProactiveBot.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/csharp_dotnetcore/17.multilingual-bot/MultiLingualBot.csproj b/samples/csharp_dotnetcore/17.multilingual-bot/MultiLingualBot.csproj index fd7ec75635..21297b004f 100644 --- a/samples/csharp_dotnetcore/17.multilingual-bot/MultiLingualBot.csproj +++ b/samples/csharp_dotnetcore/17.multilingual-bot/MultiLingualBot.csproj @@ -8,7 +8,7 @@ - + diff --git a/samples/csharp_dotnetcore/18.bot-authentication/AuthenticationBot.csproj b/samples/csharp_dotnetcore/18.bot-authentication/AuthenticationBot.csproj index 98441ca486..88c35a9542 100644 --- a/samples/csharp_dotnetcore/18.bot-authentication/AuthenticationBot.csproj +++ b/samples/csharp_dotnetcore/18.bot-authentication/AuthenticationBot.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/19.custom-dialogs/Custom-Dialogs.csproj b/samples/csharp_dotnetcore/19.custom-dialogs/Custom-Dialogs.csproj index 98441ca486..88c35a9542 100644 --- a/samples/csharp_dotnetcore/19.custom-dialogs/Custom-Dialogs.csproj +++ b/samples/csharp_dotnetcore/19.custom-dialogs/Custom-Dialogs.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/21.corebot-app-insights/CoreBot-App-Insights.csproj b/samples/csharp_dotnetcore/21.corebot-app-insights/CoreBot-App-Insights.csproj index 5af566c179..67e878b0f3 100644 --- a/samples/csharp_dotnetcore/21.corebot-app-insights/CoreBot-App-Insights.csproj +++ b/samples/csharp_dotnetcore/21.corebot-app-insights/CoreBot-App-Insights.csproj @@ -15,11 +15,11 @@ - - - - - + + + + + diff --git a/samples/csharp_dotnetcore/23.facebook-events/Facebook-Events-Bot.csproj b/samples/csharp_dotnetcore/23.facebook-events/Facebook-Events-Bot.csproj index 1a990f5b05..7636b2bc7d 100644 --- a/samples/csharp_dotnetcore/23.facebook-events/Facebook-Events-Bot.csproj +++ b/samples/csharp_dotnetcore/23.facebook-events/Facebook-Events-Bot.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/24.bot-authentication-msgraph/BotAuthenticationMSGraph.csproj b/samples/csharp_dotnetcore/24.bot-authentication-msgraph/BotAuthenticationMSGraph.csproj index 440c204343..4baf00de37 100644 --- a/samples/csharp_dotnetcore/24.bot-authentication-msgraph/BotAuthenticationMSGraph.csproj +++ b/samples/csharp_dotnetcore/24.bot-authentication-msgraph/BotAuthenticationMSGraph.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/40.timex-resolution/Timex-Resolution.csproj b/samples/csharp_dotnetcore/40.timex-resolution/Timex-Resolution.csproj index 8d77bccba0..1901aab463 100644 --- a/samples/csharp_dotnetcore/40.timex-resolution/Timex-Resolution.csproj +++ b/samples/csharp_dotnetcore/40.timex-resolution/Timex-Resolution.csproj @@ -15,7 +15,7 @@ - + diff --git a/samples/csharp_dotnetcore/42.scaleout/ScaleoutBot.csproj b/samples/csharp_dotnetcore/42.scaleout/ScaleoutBot.csproj index 8987508322..f7c24cfd59 100644 --- a/samples/csharp_dotnetcore/42.scaleout/ScaleoutBot.csproj +++ b/samples/csharp_dotnetcore/42.scaleout/ScaleoutBot.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/43.complex-dialog/ComplexDialogBot.csproj b/samples/csharp_dotnetcore/43.complex-dialog/ComplexDialogBot.csproj index dd5eab79c3..00a84d5555 100644 --- a/samples/csharp_dotnetcore/43.complex-dialog/ComplexDialogBot.csproj +++ b/samples/csharp_dotnetcore/43.complex-dialog/ComplexDialogBot.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/44.prompt-users-for-input/PromptUsersForInput.csproj b/samples/csharp_dotnetcore/44.prompt-users-for-input/PromptUsersForInput.csproj index a48fa82f37..fcd7b2b30a 100644 --- a/samples/csharp_dotnetcore/44.prompt-users-for-input/PromptUsersForInput.csproj +++ b/samples/csharp_dotnetcore/44.prompt-users-for-input/PromptUsersForInput.csproj @@ -8,7 +8,7 @@ - + diff --git a/samples/csharp_dotnetcore/45.state-management/StateMangementBot.csproj b/samples/csharp_dotnetcore/45.state-management/StateMangementBot.csproj index 329c9165b9..323085418c 100644 --- a/samples/csharp_dotnetcore/45.state-management/StateMangementBot.csproj +++ b/samples/csharp_dotnetcore/45.state-management/StateMangementBot.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/samples/csharp_dotnetcore/47.inspection/Inspection.csproj b/samples/csharp_dotnetcore/47.inspection/Inspection.csproj index 95b48faab6..b4f93531d4 100644 --- a/samples/csharp_dotnetcore/47.inspection/Inspection.csproj +++ b/samples/csharp_dotnetcore/47.inspection/Inspection.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/csharp_dotnetcore/48.customQABot-all-features/CustomQABotAllFeatures.csproj b/samples/csharp_dotnetcore/48.customQABot-all-features/CustomQABotAllFeatures.csproj index fcd3636078..97bcaddc33 100644 --- a/samples/csharp_dotnetcore/48.customQABot-all-features/CustomQABotAllFeatures.csproj +++ b/samples/csharp_dotnetcore/48.customQABot-all-features/CustomQABotAllFeatures.csproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/EchoSkillBot.csproj b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/EchoSkillBot.csproj index e80f8440a3..9e5f2570af 100644 --- a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/EchoSkillBot.csproj +++ b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/EchoSkillBot.csproj @@ -9,7 +9,7 @@ - + diff --git a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/SimpleRootBot.csproj b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/SimpleRootBot.csproj index f2f4d9e1bf..73ef6ed355 100644 --- a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/SimpleRootBot.csproj +++ b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/SimpleRootBot.csproj @@ -9,7 +9,7 @@ - + diff --git a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/DialogRootBot.csproj b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/DialogRootBot.csproj index a1eef73aab..53dab5cf39 100644 --- a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/DialogRootBot.csproj +++ b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/DialogRootBot.csproj @@ -17,8 +17,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/DialogSkillBot.csproj b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/DialogSkillBot.csproj index 92c12377bc..e38f9e607e 100644 --- a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/DialogSkillBot.csproj +++ b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/DialogSkillBot.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/RootBot.csproj b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/RootBot.csproj index c97959239e..9cd53d202c 100644 --- a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/RootBot.csproj +++ b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/RootBot.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/SkillBot.csproj b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/SkillBot.csproj index c2e4917fe9..2906ada69c 100644 --- a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/SkillBot.csproj +++ b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/SkillBot.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/84.bot-authentication-certificate/AuthCertificateBot.csproj b/samples/csharp_dotnetcore/84.bot-authentication-certificate/AuthCertificateBot.csproj index a82a0fc818..b27dce8076 100644 --- a/samples/csharp_dotnetcore/84.bot-authentication-certificate/AuthCertificateBot.csproj +++ b/samples/csharp_dotnetcore/84.bot-authentication-certificate/AuthCertificateBot.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/samples/csharp_dotnetcore/85.bot-authentication-sni/AuthSNIBot.csproj b/samples/csharp_dotnetcore/85.bot-authentication-sni/AuthSNIBot.csproj index a82a0fc818..b27dce8076 100644 --- a/samples/csharp_dotnetcore/85.bot-authentication-sni/AuthSNIBot.csproj +++ b/samples/csharp_dotnetcore/85.bot-authentication-sni/AuthSNIBot.csproj @@ -9,8 +9,8 @@ - - + + From a2b385f07c24e82b7498dbac2cf14b3a8ded16bd Mon Sep 17 00:00:00 2001 From: gandiddi <164224646+gandiddi@users.noreply.github.com> Date: Fri, 3 May 2024 23:08:26 +0530 Subject: [PATCH 11/21] Uncommenting the SUBSCRIPTION_REGION in bot configurations (#3972) --- samples/python/17.multilingual-bot/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/python/17.multilingual-bot/config.py b/samples/python/17.multilingual-bot/config.py index d5c41e6adb..9e98201ae7 100644 --- a/samples/python/17.multilingual-bot/config.py +++ b/samples/python/17.multilingual-bot/config.py @@ -16,4 +16,4 @@ class DefaultConfig: APP_TYPE = os.environ.get("MicrosoftAppType", "MultiTenant") APP_TENANTID = os.environ.get("MicrosoftAppTenantId", "") SUBSCRIPTION_KEY = os.environ.get("SubscriptionKey", "") - # SUBSCRIPTION_REGION = os.environ.get("SubscriptionRegion", "") + SUBSCRIPTION_REGION = os.environ.get("SubscriptionRegion", "") From 2dbdbc92e90f5137b76fb8be2cecb4568c3e5bac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 12:40:28 -0500 Subject: [PATCH 12/21] Bump Microsoft.IdentityModel.JsonWebTokens (#3952) Bumps [Microsoft.IdentityModel.JsonWebTokens](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) from 5.6.0 to 5.7.0. - [Release notes](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases) - [Changelog](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/CHANGELOG.md) - [Commits](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/5.6.0...5.7.0) --- updated-dependencies: - dependency-name: Microsoft.IdentityModel.JsonWebTokens dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../csharp_webapi/13.core-bot/CoreBot.csproj | 29 ++++++++++++------- .../csharp_webapi/13.core-bot/packages.config | 11 +++---- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/samples/csharp_webapi/13.core-bot/CoreBot.csproj b/samples/csharp_webapi/13.core-bot/CoreBot.csproj index dfd08686f7..4c504482ab 100644 --- a/samples/csharp_webapi/13.core-bot/CoreBot.csproj +++ b/samples/csharp_webapi/13.core-bot/CoreBot.csproj @@ -150,14 +150,20 @@ ..\packages\Microsoft.Identity.Client.4.37.0\lib\net461\Microsoft.Identity.Client.dll + + ..\packages\Microsoft.IdentityModel.Abstractions.7.4.1\lib\net461\Microsoft.IdentityModel.Abstractions.dll + True + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll - - ..\packages\Microsoft.IdentityModel.JsonWebTokens.5.6.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll + + ..\packages\Microsoft.IdentityModel.JsonWebTokens.5.7.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll + True - - ..\packages\Microsoft.IdentityModel.Logging.5.6.0\lib\net461\Microsoft.IdentityModel.Logging.dll + + ..\packages\Microsoft.IdentityModel.Logging.7.4.1\lib\net461\Microsoft.IdentityModel.Logging.dll + True ..\packages\Microsoft.IdentityModel.Protocols.5.6.0\lib\net461\Microsoft.IdentityModel.Protocols.dll @@ -165,8 +171,9 @@ ..\packages\Microsoft.IdentityModel.Protocols.OpenIdConnect.5.6.0\lib\net461\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll - - ..\packages\Microsoft.IdentityModel.Tokens.5.6.0\lib\net461\Microsoft.IdentityModel.Tokens.dll + + ..\packages\Microsoft.IdentityModel.Tokens.7.4.1\lib\net461\Microsoft.IdentityModel.Tokens.dll + True ..\packages\Microsoft.Net.Http.Headers.2.1.0\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll @@ -213,8 +220,9 @@ ..\packages\NuGet.ContentModel.4.2.0\lib\net45\NuGet.ContentModel.dll - - ..\packages\NuGet.Frameworks.5.5.1\lib\net40\NuGet.Frameworks.dll + + ..\packages\NuGet.Frameworks.6.9.1\lib\netstandard2.0\NuGet.Frameworks.dll + True ..\packages\NuGet.Packaging.5.5.1\lib\netstandard2.0\NuGet.Packaging.dll @@ -253,8 +261,9 @@ ..\packages\System.IO.Pipelines.5.0.1\lib\net461\System.IO.Pipelines.dll - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + True diff --git a/samples/csharp_webapi/13.core-bot/packages.config b/samples/csharp_webapi/13.core-bot/packages.config index 10189caf02..7bba8c4409 100644 --- a/samples/csharp_webapi/13.core-bot/packages.config +++ b/samples/csharp_webapi/13.core-bot/packages.config @@ -39,12 +39,13 @@ + - - + + - + @@ -59,7 +60,7 @@ - + @@ -73,7 +74,7 @@ - + From af6e2216dc5e85e9ea2122c23856a6310b998d24 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 12:43:08 -0500 Subject: [PATCH 13/21] Bump System.IdentityModel.Tokens.Jwt (#3951) Bumps [System.IdentityModel.Tokens.Jwt](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) from 5.6.0 to 5.7.0. - [Release notes](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/releases) - [Changelog](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/CHANGELOG.md) - [Commits](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/compare/5.6.0...5.7.0) --- updated-dependencies: - dependency-name: System.IdentityModel.Tokens.Jwt dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: tracyboehrer --- samples/csharp_webapi/13.core-bot/CoreBot.csproj | 5 +++-- samples/csharp_webapi/13.core-bot/packages.config | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/samples/csharp_webapi/13.core-bot/CoreBot.csproj b/samples/csharp_webapi/13.core-bot/CoreBot.csproj index 4c504482ab..0402abc1a5 100644 --- a/samples/csharp_webapi/13.core-bot/CoreBot.csproj +++ b/samples/csharp_webapi/13.core-bot/CoreBot.csproj @@ -254,8 +254,9 @@ True - - ..\packages\System.IdentityModel.Tokens.Jwt.5.6.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll + + ..\packages\System.IdentityModel.Tokens.Jwt.5.7.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll + True diff --git a/samples/csharp_webapi/13.core-bot/packages.config b/samples/csharp_webapi/13.core-bot/packages.config index 7bba8c4409..586d521918 100644 --- a/samples/csharp_webapi/13.core-bot/packages.config +++ b/samples/csharp_webapi/13.core-bot/packages.config @@ -72,7 +72,7 @@ - + From df21f1a7037c01a72fcd643138aca7e2416a93f7 Mon Sep 17 00:00:00 2001 From: Drew Batshaw Date: Fri, 3 May 2024 10:57:44 -0700 Subject: [PATCH 14/21] Update attachmentsBot.js to correct handle downloads from ms teams (#3947) The code was using attachment.contentURL which is missing the auth token need to download when using ms teams. --- .../15.handling-attachments/bots/attachmentsBot.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/javascript_nodejs/15.handling-attachments/bots/attachmentsBot.js b/samples/javascript_nodejs/15.handling-attachments/bots/attachmentsBot.js index f51c3b4dcb..9aab0aa745 100644 --- a/samples/javascript_nodejs/15.handling-attachments/bots/attachmentsBot.js +++ b/samples/javascript_nodejs/15.handling-attachments/bots/attachmentsBot.js @@ -78,8 +78,10 @@ class AttachmentsBot extends ActivityHandler { * @param {Object} attachment */ async downloadAttachmentAndWrite(attachment) { - // Retrieve the attachment via the attachment's contentUrl. - const url = attachment.contentUrl; + // Retrieve the attachment via url. + // Use content.downloadURL if available as that contains needed auth token for working with ms teams + const url = attachment.content?.downloadUrl || attachment.contentUrl; + // Local file path for the bot to save the attachment. const localFileName = path.join(__dirname, attachment.name); From 62a768d02c62d5b43cda59653e7bad02e7aa4147 Mon Sep 17 00:00:00 2001 From: gandiddi <164224646+gandiddi@users.noreply.github.com> Date: Mon, 13 May 2024 21:34:55 +0530 Subject: [PATCH 15/21] Switch from TSLint to ESLint for TypeScript samples (#3969) * Switch from TSLint to ESLint for TypeScript samples * Update ci-javascript-samples.yml Updating eslint for both file types i.e. .js and .ts * eslint-plugin-import * eslint-plugin-n * Resolving dependencies * jsonwebtoken --- .github/workflows/ci-javascript-samples.yml | 6 +- .../00.empty-bot/.eslintrc.js | 15 ++++ .../00.empty-bot/package.json | 15 +++- .../00.empty-bot/src/index.ts | 3 +- .../00.empty-bot/tslint.json | 18 ---- .../01.console-echo/.eslintrc.js | 15 ++++ .../01.console-echo/package.json | 14 ++- .../01.console-echo/src/bot.ts | 3 +- .../01.console-echo/src/consoleAdapter.ts | 49 +++++----- .../01.console-echo/src/index.ts | 4 +- .../01.console-echo/tslint.json | 18 ---- .../02.echo-bot/.eslintrc.js | 15 ++++ .../02.echo-bot/package.json | 13 ++- .../02.echo-bot/src/index.ts | 11 ++- .../typescript_nodejs/02.echo-bot/tslint.json | 18 ---- .../03.welcome-users/.eslintrc.js | 15 ++++ .../03.welcome-users/package.json | 15 +++- .../03.welcome-users/src/bot.ts | 28 +++--- .../03.welcome-users/tslint.json | 18 ---- .../05.multi-turn-prompt/.eslintrc.js | 15 ++++ .../05.multi-turn-prompt/package.json | 15 +++- .../src/bots/dialogBot.ts | 2 +- .../src/dialogs/userProfileDialog.ts | 8 +- .../05.multi-turn-prompt/src/index.ts | 6 +- .../05.multi-turn-prompt/tslint.json | 18 ---- .../06.using-cards/.eslintrc.js | 15 ++++ .../06.using-cards/package.json | 15 +++- .../06.using-cards/src/bots/dialogBot.ts | 2 +- .../06.using-cards/src/dialogs/mainDialog.ts | 89 +++++++++---------- .../06.using-cards/src/index.ts | 6 +- .../06.using-cards/tslint.json | 18 ---- .../13.core-bot/.eslintrc.js | 6 +- .../13.core-bot/package.json | 15 +++- .../src/dialogs/cancelAndHelpDialog.ts | 22 ++--- .../src/dialogs/dateResolverDialog.ts | 1 - .../src/dialogs/flightBookingRecognizer.ts | 2 +- .../13.core-bot/src/dialogs/mainDialog.ts | 13 +-- .../13.core-bot/src/index.ts | 15 ++-- .../src/tests/dialogs/mainDialog.test.ts | 10 +-- .../testData/bookingDialogTestCases.ts | 6 +- .../typescript_nodejs/13.core-bot/tslint.json | 18 ---- .../16.proactive-messages/.eslintrc.js | 15 ++++ .../16.proactive-messages/package.json | 15 +++- .../16.proactive-messages/src/bot.ts | 4 +- .../16.proactive-messages/src/index.ts | 2 +- .../16.proactive-messages/tslint.json | 18 ---- 46 files changed, 340 insertions(+), 324 deletions(-) create mode 100644 samples/typescript_nodejs/00.empty-bot/.eslintrc.js delete mode 100644 samples/typescript_nodejs/00.empty-bot/tslint.json create mode 100644 samples/typescript_nodejs/01.console-echo/.eslintrc.js delete mode 100644 samples/typescript_nodejs/01.console-echo/tslint.json create mode 100644 samples/typescript_nodejs/02.echo-bot/.eslintrc.js delete mode 100644 samples/typescript_nodejs/02.echo-bot/tslint.json create mode 100644 samples/typescript_nodejs/03.welcome-users/.eslintrc.js delete mode 100644 samples/typescript_nodejs/03.welcome-users/tslint.json create mode 100644 samples/typescript_nodejs/05.multi-turn-prompt/.eslintrc.js delete mode 100644 samples/typescript_nodejs/05.multi-turn-prompt/tslint.json create mode 100644 samples/typescript_nodejs/06.using-cards/.eslintrc.js delete mode 100644 samples/typescript_nodejs/06.using-cards/tslint.json delete mode 100644 samples/typescript_nodejs/13.core-bot/tslint.json create mode 100644 samples/typescript_nodejs/16.proactive-messages/.eslintrc.js delete mode 100644 samples/typescript_nodejs/16.proactive-messages/tslint.json diff --git a/.github/workflows/ci-javascript-samples.yml b/.github/workflows/ci-javascript-samples.yml index c531dee115..5ff6e50cd2 100644 --- a/.github/workflows/ci-javascript-samples.yml +++ b/.github/workflows/ci-javascript-samples.yml @@ -94,9 +94,5 @@ jobs: - name: yarn lint run: | - if ${{ endsWith(matrix.files[0], '.js') }}; then - yarn eslint ${{ join(matrix.files, ' ') }} - else - yarn tslint ${{ join(matrix.files, ' ') }} - fi + yarn eslint ${{ join(matrix.files, ' ') }} working-directory: ${{ matrix.folder }} diff --git a/samples/typescript_nodejs/00.empty-bot/.eslintrc.js b/samples/typescript_nodejs/00.empty-bot/.eslintrc.js new file mode 100644 index 0000000000..df3d4c1da2 --- /dev/null +++ b/samples/typescript_nodejs/00.empty-bot/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + "extends": "standard", + "parser": "@typescript-eslint/parser", + "rules": { + "semi": [2, "always"], + "indent": [2, 4], + "no-return-await": 0, + "space-before-function-paren": [2, { + "named": "never", + "anonymous": "never", + "asyncArrow": "always" + }], + "template-curly-spacing": [2, "always"] + } +}; diff --git a/samples/typescript_nodejs/00.empty-bot/package.json b/samples/typescript_nodejs/00.empty-bot/package.json index 6527a041d3..ff79a284c1 100644 --- a/samples/typescript_nodejs/00.empty-bot/package.json +++ b/samples/typescript_nodejs/00.empty-bot/package.json @@ -7,7 +7,7 @@ "main": "./lib/index.js", "scripts": { "build": "tsc --build", - "lint": "tslint -c tslint.json 'src/**/*.ts'", + "lint": "eslint -c .eslintrc.js --ext .ts src", "postinstall": "npm run build && node ./deploymentScripts/webConfigPrep.js", "start": "tsc --build && node ./lib/index.js", "test": "echo \"Error: no test specified\" && exit 1", @@ -24,8 +24,15 @@ }, "devDependencies": { "@types/restify": "8.4.2", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "eslint": "^8.57.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "nodemon": "~2.0.4", - "tslint": "~6.1.2", - "typescript": "~4.3.2" + "typescript": "~4.9.3" } -} \ No newline at end of file +} diff --git a/samples/typescript_nodejs/00.empty-bot/src/index.ts b/samples/typescript_nodejs/00.empty-bot/src/index.ts index 7f7f90b76d..98e7963f19 100644 --- a/samples/typescript_nodejs/00.empty-bot/src/index.ts +++ b/samples/typescript_nodejs/00.empty-bot/src/index.ts @@ -7,7 +7,6 @@ import * as restify from 'restify'; // See https://aka.ms/bot-services to learn more about the different parts of a bot. import { CloudAdapter, - ConfigurationServiceClientCredentialFactory, ConfigurationBotFrameworkAuthentication, ConfigurationBotFrameworkAuthenticationOptions } from 'botbuilder'; @@ -54,5 +53,5 @@ const myBot = new EmptyBot(); // Listen for incoming requests. server.post('/api/messages', async (req, res) => { // Route received a request to adapter for processing - await adapter.process(req, res, (context) => myBot.run(context)) + await adapter.process(req, res, (context) => myBot.run(context)); }); diff --git a/samples/typescript_nodejs/00.empty-bot/tslint.json b/samples/typescript_nodejs/00.empty-bot/tslint.json deleted file mode 100644 index ad00715f85..0000000000 --- a/samples/typescript_nodejs/00.empty-bot/tslint.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "interface-name" : [true, "never-prefix"], - "max-line-length": [false], - "no-console": [false, "log", "error"], - "no-var-requires": false, - "quotemark": [true, "single"], - "one-variable-per-declaration": false, - "curly": [true, "ignore-same-line"], - "trailing-comma": [true, {"multiline": "never", "singleline": "never"}] - }, - "rulesDirectory": [] -} diff --git a/samples/typescript_nodejs/01.console-echo/.eslintrc.js b/samples/typescript_nodejs/01.console-echo/.eslintrc.js new file mode 100644 index 0000000000..df3d4c1da2 --- /dev/null +++ b/samples/typescript_nodejs/01.console-echo/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + "extends": "standard", + "parser": "@typescript-eslint/parser", + "rules": { + "semi": [2, "always"], + "indent": [2, 4], + "no-return-await": 0, + "space-before-function-paren": [2, { + "named": "never", + "anonymous": "never", + "asyncArrow": "always" + }], + "template-curly-spacing": [2, "always"] + } +}; diff --git a/samples/typescript_nodejs/01.console-echo/package.json b/samples/typescript_nodejs/01.console-echo/package.json index 73d8420fc7..11a857b463 100644 --- a/samples/typescript_nodejs/01.console-echo/package.json +++ b/samples/typescript_nodejs/01.console-echo/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "build": "tsc --build", - "lint": "tslint -c tslint.json 'src/**/*.ts'", + "lint": "eslint -c .eslintrc.js --ext .ts src", "start": "tsc --build && node ./lib/index.js", "test": "echo \"Error: no test specified\" && exit 1", "watch": "nodemon --watch ./src -e ts --exec \"npm run start\"" @@ -17,8 +17,16 @@ "readline": "^1.3.0" }, "devDependencies": { + "@types/jsonwebtoken": "^9.0.6", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "eslint": "^8.57.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "nodemon": "~1.19.4", - "tslint": "^5.20.0", - "typescript": "~4.3.2" + "typescript": "~4.9.3" } } diff --git a/samples/typescript_nodejs/01.console-echo/src/bot.ts b/samples/typescript_nodejs/01.console-echo/src/bot.ts index 1ae92a3ffa..2f3c88c633 100644 --- a/samples/typescript_nodejs/01.console-echo/src/bot.ts +++ b/samples/typescript_nodejs/01.console-echo/src/bot.ts @@ -7,7 +7,6 @@ import { ActivityTypes, TurnContext } from 'botbuilder'; * Simple bot that echoes received messages. */ export class ConsoleEchoBot { - /** * Driver code for the bot. This bot only responds to "Message"-type * Activities. If the user's message is "quit", the process will exit. @@ -26,5 +25,5 @@ export class ConsoleEchoBot { await turnContext.sendActivity(`You sent '${ turnContext.activity.text }'`); } } - } + }; } diff --git a/samples/typescript_nodejs/01.console-echo/src/consoleAdapter.ts b/samples/typescript_nodejs/01.console-echo/src/consoleAdapter.ts index 7a92f31c30..49245e6c8f 100644 --- a/samples/typescript_nodejs/01.console-echo/src/consoleAdapter.ts +++ b/samples/typescript_nodejs/01.console-echo/src/consoleAdapter.ts @@ -38,7 +38,7 @@ export class ConsoleAdapter extends BotAdapter { this.reference = { bot: { id: 'bot', name: 'Bot' }, channelId: 'console', - conversation: { id: 'convo1', name: '', isGroup: false }, + conversation: { id: 'convo1', name: '', isGroup: false }, serviceUrl: '', user: { id: 'user', name: 'User1' }, ...reference @@ -123,12 +123,12 @@ export class ConsoleAdapter extends BotAdapter { * @param logic A function handler that will be called to perform the bots logic after the the adapters middleware has been run. */ public continueConversation(reference: ConversationReference, logic: (context: TurnContext) => Promise): Promise { - // Create context and run middleware pipe - const activity: Partial = TurnContext.applyConversationReference({}, reference, true); - const context: TurnContext = new TurnContext(this, activity); + // Create context and run middleware pipe + const activity: Partial = TurnContext.applyConversationReference({}, reference, true); + const context: TurnContext = new TurnContext(this, activity); - return this.runMiddleware(context, logic) - .catch((err: Error) => { this.printError(err.toString()); }); + return this.runMiddleware(context, logic) + .catch((err: Error) => { this.printError(err.toString()); }); } /** @@ -143,25 +143,26 @@ export class ConsoleAdapter extends BotAdapter { */ public async sendActivities(context: TurnContext, activities: Array >): Promise { const responses: ResourceResponse[] = []; - for(const activity of activities) { + for (const activity of activities) { responses.push({} as ResourceResponse); switch (activity.type) { - case 'delay' as ActivityTypes: - await this.sleep(activity.value); - break; - case ActivityTypes.Message: - if (activity.attachments && activity.attachments.length > 0) { - const append: string = activity.attachments.length === 1 - ? `(1 attachment)` : `(${activity.attachments.length} attachments)`; - this.print(`${activity.text} ${append}`); - } else { - this.print(activity.text || ''); - } - break; - default: - this.print(`[${activity.type}]`); - break; + case 'delay' as ActivityTypes: + await this.sleep(activity.value); + break; + case ActivityTypes.Message: + if (activity.attachments && activity.attachments.length > 0) { + const append: string = activity.attachments.length === 1 + ? '(1 attachment)' + : `(${ activity.attachments.length } attachments)`; + this.print(`${ activity.text } ${ append }`); + } else { + this.print(activity.text || ''); + } + break; + default: + this.print(`[${ activity.type }]`); + break; } } return responses; @@ -172,7 +173,7 @@ export class ConsoleAdapter extends BotAdapter { * will result an error being returned. */ public updateActivity(context: TurnContext, activity: Partial): Promise { - return Promise.reject(new Error(`ConsoleAdapter.updateActivity(): not supported.`)); + return Promise.reject(new Error('ConsoleAdapter.updateActivity(): not supported.')); } /** @@ -180,7 +181,7 @@ export class ConsoleAdapter extends BotAdapter { * will result an error being returned. */ public deleteActivity(context: TurnContext, reference: Partial): Promise { - return Promise.reject(new Error(`ConsoleAdapter.deleteActivity(): not supported.`)); + return Promise.reject(new Error('ConsoleAdapter.deleteActivity(): not supported.')); } /** diff --git a/samples/typescript_nodejs/01.console-echo/src/index.ts b/samples/typescript_nodejs/01.console-echo/src/index.ts index 8bebd26aa7..450f0e0997 100644 --- a/samples/typescript_nodejs/01.console-echo/src/index.ts +++ b/samples/typescript_nodejs/01.console-echo/src/index.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { ConsoleAdapter} from './consoleAdapter'; +import { ConsoleAdapter } from './consoleAdapter'; import { ConsoleEchoBot } from './bot'; @@ -17,7 +17,7 @@ const echoBot: ConsoleEchoBot = new ConsoleEchoBot(); // `adapter.listen` tells the adapter to listen for incoming messages // and events, known as "Activities." // Activities are wrapped in TurnContext objects by the handler function. -const closeFn = adapter.listen(async (turnContext: TurnContext) => { +adapter.listen(async (turnContext: TurnContext) => { await echoBot.onTurn(turnContext); }); diff --git a/samples/typescript_nodejs/01.console-echo/tslint.json b/samples/typescript_nodejs/01.console-echo/tslint.json deleted file mode 100644 index ad00715f85..0000000000 --- a/samples/typescript_nodejs/01.console-echo/tslint.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "interface-name" : [true, "never-prefix"], - "max-line-length": [false], - "no-console": [false, "log", "error"], - "no-var-requires": false, - "quotemark": [true, "single"], - "one-variable-per-declaration": false, - "curly": [true, "ignore-same-line"], - "trailing-comma": [true, {"multiline": "never", "singleline": "never"}] - }, - "rulesDirectory": [] -} diff --git a/samples/typescript_nodejs/02.echo-bot/.eslintrc.js b/samples/typescript_nodejs/02.echo-bot/.eslintrc.js new file mode 100644 index 0000000000..df3d4c1da2 --- /dev/null +++ b/samples/typescript_nodejs/02.echo-bot/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + "extends": "standard", + "parser": "@typescript-eslint/parser", + "rules": { + "semi": [2, "always"], + "indent": [2, 4], + "no-return-await": 0, + "space-before-function-paren": [2, { + "named": "never", + "anonymous": "never", + "asyncArrow": "always" + }], + "template-curly-spacing": [2, "always"] + } +}; diff --git a/samples/typescript_nodejs/02.echo-bot/package.json b/samples/typescript_nodejs/02.echo-bot/package.json index 613fa79e7a..948f253204 100644 --- a/samples/typescript_nodejs/02.echo-bot/package.json +++ b/samples/typescript_nodejs/02.echo-bot/package.json @@ -7,7 +7,7 @@ "main": "./lib/index.js", "scripts": { "build": "tsc --build", - "lint": "tslint -c tslint.json 'src/**/*.ts'", + "lint": "eslint -c .eslintrc.js --ext .ts src", "postinstall": "npm run build && node ./deploymentScripts/webConfigPrep.js", "start": "tsc --build && node ./lib/index.js", "test": "echo \"Error: no test specified\" && exit 1", @@ -27,8 +27,15 @@ "@types/dotenv": "6.1.1", "@types/node": "^16.11.6", "@types/restify": "8.4.2", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "eslint": "^8.57.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "nodemon": "~2.0.4", - "tslint": "~6.1.2", - "typescript": "~4.3.2" + "typescript": "~4.9.3" } } diff --git a/samples/typescript_nodejs/02.echo-bot/src/index.ts b/samples/typescript_nodejs/02.echo-bot/src/index.ts index 303205eb57..f0527522fb 100644 --- a/samples/typescript_nodejs/02.echo-bot/src/index.ts +++ b/samples/typescript_nodejs/02.echo-bot/src/index.ts @@ -3,10 +3,6 @@ import * as path from 'path'; -import { config } from 'dotenv'; -const ENV_FILE = path.join(__dirname, '..', '.env'); -config({ path: ENV_FILE }); - import * as restify from 'restify'; import { INodeSocket } from 'botframework-streaming'; @@ -15,7 +11,6 @@ import { INodeSocket } from 'botframework-streaming'; // See https://aka.ms/bot-services to learn more about the different parts of a bot. import { CloudAdapter, - ConfigurationServiceClientCredentialFactory, ConfigurationBotFrameworkAuthentication, ConfigurationBotFrameworkAuthenticationOptions } from 'botbuilder'; @@ -23,11 +18,15 @@ import { // This bot's main dialog. import { EchoBot } from './bot'; +import { config } from 'dotenv'; +const ENV_FILE = path.join(__dirname, '..', '.env'); +config({ path: ENV_FILE }); + // Create HTTP server. const server = restify.createServer(); server.use(restify.plugins.bodyParser()); server.listen(process.env.port || process.env.PORT || 3978, () => { - console.log(`\n${server.name} listening to ${server.url}`); + console.log(`\n${ server.name } listening to ${ server.url }`); console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator'); console.log('\nTo talk to your bot, open the emulator select "Open Bot"'); }); diff --git a/samples/typescript_nodejs/02.echo-bot/tslint.json b/samples/typescript_nodejs/02.echo-bot/tslint.json deleted file mode 100644 index ad00715f85..0000000000 --- a/samples/typescript_nodejs/02.echo-bot/tslint.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "interface-name" : [true, "never-prefix"], - "max-line-length": [false], - "no-console": [false, "log", "error"], - "no-var-requires": false, - "quotemark": [true, "single"], - "one-variable-per-declaration": false, - "curly": [true, "ignore-same-line"], - "trailing-comma": [true, {"multiline": "never", "singleline": "never"}] - }, - "rulesDirectory": [] -} diff --git a/samples/typescript_nodejs/03.welcome-users/.eslintrc.js b/samples/typescript_nodejs/03.welcome-users/.eslintrc.js new file mode 100644 index 0000000000..df3d4c1da2 --- /dev/null +++ b/samples/typescript_nodejs/03.welcome-users/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + "extends": "standard", + "parser": "@typescript-eslint/parser", + "rules": { + "semi": [2, "always"], + "indent": [2, 4], + "no-return-await": 0, + "space-before-function-paren": [2, { + "named": "never", + "anonymous": "never", + "asyncArrow": "always" + }], + "template-curly-spacing": [2, "always"] + } +}; diff --git a/samples/typescript_nodejs/03.welcome-users/package.json b/samples/typescript_nodejs/03.welcome-users/package.json index d6641890ec..63718dbb58 100644 --- a/samples/typescript_nodejs/03.welcome-users/package.json +++ b/samples/typescript_nodejs/03.welcome-users/package.json @@ -7,7 +7,7 @@ "main": "./lib/index.js", "scripts": { "build": "tsc --build", - "lint": "tslint -c tslint.json 'src/**/*.ts'", + "lint": "eslint -c .eslintrc.js --ext .ts src", "postinstall": "npm run build && node ./deploymentScripts/webConfigPrep.js", "start": "tsc --build && node ./lib/index.js", "test": "echo \"Error: no test specified\" && exit 1", @@ -24,8 +24,15 @@ }, "devDependencies": { "@types/restify": "8.4.2", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "eslint": "^8.57.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "nodemon": "~1.19.4", - "tslint": "~5.20.0", - "typescript": "~4.3.2" + "typescript": "~4.9.3" } -} \ No newline at end of file +} diff --git a/samples/typescript_nodejs/03.welcome-users/src/bot.ts b/samples/typescript_nodejs/03.welcome-users/src/bot.ts index a15eeb2ed7..8eae29b477 100644 --- a/samples/typescript_nodejs/03.welcome-users/src/bot.ts +++ b/samples/typescript_nodejs/03.welcome-users/src/bot.ts @@ -34,7 +34,7 @@ export class WelcomeBot extends ActivityHandler { // The channel should send the user name in the 'From' object const userName = context.activity.from.name; await context.sendActivity('You are seeing this message because this was your first message ever sent to this bot.'); - await context.sendActivity(`It is a good practice to welcome the user and provide personal greeting. For example, welcome ${userName}.`); + await context.sendActivity(`It is a good practice to welcome the user and provide personal greeting. For example, welcome ${ userName }.`); // Set the flag indicating the bot handled the user's first message. await this.welcomedUserProperty.set(context, true); @@ -43,18 +43,18 @@ export class WelcomeBot extends ActivityHandler { // Consider using LUIS or QnA for Natural Language Processing. const text = context.activity.text.toLowerCase(); switch (text) { - case 'hello': - case 'hi': - await context.sendActivity(`You said "${context.activity.text}"`); - break; - case 'intro': - case 'help': - await this.sendIntroCard(context); - break; - default: - await context.sendActivity(`This is a simple Welcome Bot sample. You can say 'intro' to - see the introduction card. If you are running this bot in the Bot - Framework Emulator, press the 'Start Over' button to simulate user joining a bot or a channel`); + case 'hello': + case 'hi': + await context.sendActivity(`You said "${ context.activity.text }"`); + break; + case 'intro': + case 'help': + await this.sendIntroCard(context); + break; + default: + await context.sendActivity(`This is a simple Welcome Bot sample. You can say 'intro' to + see the introduction card. If you are running this bot in the Bot + Framework Emulator, press the 'Start Over' button to simulate user joining a bot or a channel`); } } // Save state changes @@ -75,7 +75,7 @@ export class WelcomeBot extends ActivityHandler { // bot was added to the conversation, and the opposite indicates this is a user. if (context.activity.membersAdded[idx].id !== context.activity.recipient.id) { await context.sendActivity('Welcome to the \'Welcome User\' Bot. This bot will introduce you to welcoming and greeting users.'); - await context.sendActivity(`You are seeing this message because the bot received at least one 'ConversationUpdate' ` + + await context.sendActivity('You are seeing this message because the bot received at least one \'ConversationUpdate\' ' + 'event, indicating you (and possibly others) joined the conversation. If you are using the emulator, ' + 'pressing the \'Start Over\' button to trigger this event again. The specifics of the \'ConversationUpdate\' ' + 'event depends on the channel. You can read more information at https://aka.ms/about-botframework-welcome-user'); diff --git a/samples/typescript_nodejs/03.welcome-users/tslint.json b/samples/typescript_nodejs/03.welcome-users/tslint.json deleted file mode 100644 index ad00715f85..0000000000 --- a/samples/typescript_nodejs/03.welcome-users/tslint.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "interface-name" : [true, "never-prefix"], - "max-line-length": [false], - "no-console": [false, "log", "error"], - "no-var-requires": false, - "quotemark": [true, "single"], - "one-variable-per-declaration": false, - "curly": [true, "ignore-same-line"], - "trailing-comma": [true, {"multiline": "never", "singleline": "never"}] - }, - "rulesDirectory": [] -} diff --git a/samples/typescript_nodejs/05.multi-turn-prompt/.eslintrc.js b/samples/typescript_nodejs/05.multi-turn-prompt/.eslintrc.js new file mode 100644 index 0000000000..df3d4c1da2 --- /dev/null +++ b/samples/typescript_nodejs/05.multi-turn-prompt/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + "extends": "standard", + "parser": "@typescript-eslint/parser", + "rules": { + "semi": [2, "always"], + "indent": [2, 4], + "no-return-await": 0, + "space-before-function-paren": [2, { + "named": "never", + "anonymous": "never", + "asyncArrow": "always" + }], + "template-curly-spacing": [2, "always"] + } +}; diff --git a/samples/typescript_nodejs/05.multi-turn-prompt/package.json b/samples/typescript_nodejs/05.multi-turn-prompt/package.json index 3107d9a70a..794073ebcb 100644 --- a/samples/typescript_nodejs/05.multi-turn-prompt/package.json +++ b/samples/typescript_nodejs/05.multi-turn-prompt/package.json @@ -7,7 +7,7 @@ "main": "./lib/index.js", "scripts": { "build": "tsc --build", - "lint": "tslint -c tslint.json 'src/**/*.ts'", + "lint": "eslint -c .eslintrc.js --ext .ts src", "postinstall": "npm run build && node ./deploymentScripts/webConfigPrep.js", "start": "tsc --build && node ./lib/index.js", "test": "echo \"Error: no test specified\" && exit 1", @@ -26,8 +26,15 @@ }, "devDependencies": { "@types/restify": "8.4.2", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "eslint": "^8.57.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "nodemon": "~1.19.4", - "tslint": "~5.20.0", - "typescript": "~4.3.2" + "typescript": "~4.9.3" } -} \ No newline at end of file +} diff --git a/samples/typescript_nodejs/05.multi-turn-prompt/src/bots/dialogBot.ts b/samples/typescript_nodejs/05.multi-turn-prompt/src/bots/dialogBot.ts index 17b5894157..8e767d0b97 100644 --- a/samples/typescript_nodejs/05.multi-turn-prompt/src/bots/dialogBot.ts +++ b/samples/typescript_nodejs/05.multi-turn-prompt/src/bots/dialogBot.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { ActivityHandler, BotState, ConversationState, StatePropertyAccessor, UserState } from 'botbuilder'; +import { ActivityHandler, BotState, ConversationState, StatePropertyAccessor, UserState } from 'botbuilder'; import { Dialog, DialogState } from 'botbuilder-dialogs'; import { UserProfileDialog } from '../dialogs/userProfileDialog'; export class DialogBot extends ActivityHandler { diff --git a/samples/typescript_nodejs/05.multi-turn-prompt/src/dialogs/userProfileDialog.ts b/samples/typescript_nodejs/05.multi-turn-prompt/src/dialogs/userProfileDialog.ts index 023ed45407..547d0129d2 100644 --- a/samples/typescript_nodejs/05.multi-turn-prompt/src/dialogs/userProfileDialog.ts +++ b/samples/typescript_nodejs/05.multi-turn-prompt/src/dialogs/userProfileDialog.ts @@ -83,7 +83,7 @@ export class UserProfileDialog extends ComponentDialog { stepContext.options.name = stepContext.result; // We can send messages to the user at any point in the WaterfallStep. - await stepContext.context.sendActivity(`Thanks ${stepContext.result}.`); + await stepContext.context.sendActivity(`Thanks ${ stepContext.result }.`); // WaterfallStep always finishes with the end of the Waterfall or with another dialog; here it is a Prompt Dialog. return await stepContext.prompt(CONFIRM_PROMPT, 'Do you want to give your age?', ['yes', 'no']); @@ -105,7 +105,7 @@ export class UserProfileDialog extends ComponentDialog { private async confirmStep(stepContext: WaterfallStepContext) { stepContext.options.age = stepContext.result; - const msg = stepContext.options.age === -1 ? 'No age given.' : `I have your age as ${stepContext.options.age}.`; + const msg = stepContext.options.age === -1 ? 'No age given.' : `I have your age as ${ stepContext.options.age }.`; // We can send messages to the user at any point in the WaterfallStep. await stepContext.context.sendActivity(msg); @@ -123,9 +123,9 @@ export class UserProfileDialog extends ComponentDialog { userProfile.name = stepContextOptions.name; userProfile.age = stepContextOptions.age; - let msg = `I have your mode of transport as ${userProfile.transport} and your name as ${userProfile.name}.`; + let msg = `I have your mode of transport as ${ userProfile.transport } and your name as ${ userProfile.name }.`; if (userProfile.age !== -1) { - msg += ` And age as ${userProfile.age}.`; + msg += ` And age as ${ userProfile.age }.`; } await stepContext.context.sendActivity(msg); diff --git a/samples/typescript_nodejs/05.multi-turn-prompt/src/index.ts b/samples/typescript_nodejs/05.multi-turn-prompt/src/index.ts index 76e1d619fa..974551074a 100644 --- a/samples/typescript_nodejs/05.multi-turn-prompt/src/index.ts +++ b/samples/typescript_nodejs/05.multi-turn-prompt/src/index.ts @@ -35,12 +35,12 @@ adapter.onTurnError = async (context, error) => { // This check writes out errors to console log .vs. app insights. // NOTE: In production environment, you should consider logging this to Azure // application insights. - console.error(`\n [onTurnError] unhandled error: ${error}`); + console.error(`\n [onTurnError] unhandled error: ${ error }`); // Send a trace activity, which will be displayed in Bot Framework Emulator await context.sendTraceActivity( 'OnTurnError Trace', - `${error}`, + `${ error }`, 'https://www.botframework.com/schemas/error', 'TurnError' ); @@ -70,7 +70,7 @@ const server = restify.createServer(); server.use(restify.plugins.bodyParser()); server.listen(process.env.port || process.env.PORT || 3978, () => { - console.log(`\n${server.name} listening to ${server.url}.`); + console.log(`\n${ server.name } listening to ${ server.url }.`); console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator'); console.log('\nTo talk to your bot, open the emulator select "Open Bot"'); }); diff --git a/samples/typescript_nodejs/05.multi-turn-prompt/tslint.json b/samples/typescript_nodejs/05.multi-turn-prompt/tslint.json deleted file mode 100644 index ad00715f85..0000000000 --- a/samples/typescript_nodejs/05.multi-turn-prompt/tslint.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "interface-name" : [true, "never-prefix"], - "max-line-length": [false], - "no-console": [false, "log", "error"], - "no-var-requires": false, - "quotemark": [true, "single"], - "one-variable-per-declaration": false, - "curly": [true, "ignore-same-line"], - "trailing-comma": [true, {"multiline": "never", "singleline": "never"}] - }, - "rulesDirectory": [] -} diff --git a/samples/typescript_nodejs/06.using-cards/.eslintrc.js b/samples/typescript_nodejs/06.using-cards/.eslintrc.js new file mode 100644 index 0000000000..df3d4c1da2 --- /dev/null +++ b/samples/typescript_nodejs/06.using-cards/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + "extends": "standard", + "parser": "@typescript-eslint/parser", + "rules": { + "semi": [2, "always"], + "indent": [2, 4], + "no-return-await": 0, + "space-before-function-paren": [2, { + "named": "never", + "anonymous": "never", + "asyncArrow": "always" + }], + "template-curly-spacing": [2, "always"] + } +}; diff --git a/samples/typescript_nodejs/06.using-cards/package.json b/samples/typescript_nodejs/06.using-cards/package.json index aa2e9898ec..51735447f8 100644 --- a/samples/typescript_nodejs/06.using-cards/package.json +++ b/samples/typescript_nodejs/06.using-cards/package.json @@ -7,7 +7,7 @@ "main": "./lib/index.js", "scripts": { "build": "tsc --build", - "lint": "tslint -c tslint.json 'src/**/*.ts'", + "lint": "eslint -c .eslintrc.js --ext .ts src", "postinstall": "npm run build && node ./deploymentScripts/webConfigPrep.js", "start": "tsc --build && node ./lib/index.js", "test": "echo \"Error: no test specified\" && exit 1", @@ -26,8 +26,15 @@ }, "devDependencies": { "@types/restify": "8.4.2", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "eslint": "^8.57.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "nodemon": "~1.19.4", - "tslint": "~5.20.0", - "typescript": "~4.3.2" + "typescript": "~4.9.3" } -} \ No newline at end of file +} diff --git a/samples/typescript_nodejs/06.using-cards/src/bots/dialogBot.ts b/samples/typescript_nodejs/06.using-cards/src/bots/dialogBot.ts index 683df7f197..1d37b8f098 100644 --- a/samples/typescript_nodejs/06.using-cards/src/bots/dialogBot.ts +++ b/samples/typescript_nodejs/06.using-cards/src/bots/dialogBot.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { ActivityHandler, BotState, ConversationState, StatePropertyAccessor, UserState } from 'botbuilder'; +import { ActivityHandler, BotState, ConversationState, StatePropertyAccessor, UserState } from 'botbuilder'; import { Dialog, DialogState } from 'botbuilder-dialogs'; import { MainDialog } from '../dialogs/mainDialog'; export class DialogBot extends ActivityHandler { diff --git a/samples/typescript_nodejs/06.using-cards/src/dialogs/mainDialog.ts b/samples/typescript_nodejs/06.using-cards/src/dialogs/mainDialog.ts index 924d4cf70d..6c85de118c 100644 --- a/samples/typescript_nodejs/06.using-cards/src/dialogs/mainDialog.ts +++ b/samples/typescript_nodejs/06.using-cards/src/dialogs/mainDialog.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import AdaptiveCard from '../resources/adaptiveCard.json'; -import { AttachmentLayoutTypes, CardFactory, StatePropertyAccessor, TurnContext, UserState } from 'botbuilder'; +import { AttachmentLayoutTypes, CardFactory, StatePropertyAccessor, TurnContext } from 'botbuilder'; import { ChoicePrompt, ComponentDialog, @@ -15,7 +15,6 @@ import { const MAIN_WATERFALL_DIALOG = 'mainWaterfallDialog'; export class MainDialog extends ComponentDialog { - constructor() { super('MainDialog'); @@ -77,49 +76,49 @@ export class MainDialog extends ComponentDialog { console.log('MainDialog.showCardStep'); switch (stepContext.result.value) { - case 'Adaptive Card': - await stepContext.context.sendActivity({ attachments: [this.createAdaptiveCard()] }); - break; - case 'Animation Card': - await stepContext.context.sendActivity({ attachments: [this.createAnimationCard()] }); - break; - case 'Audio Card': - await stepContext.context.sendActivity({ attachments: [this.createAudioCard()] }); - break; - case 'OAuth Card': - await stepContext.context.sendActivity({ attachments: [this.createOAuthCard()] }); - break; - case 'Hero Card': - await stepContext.context.sendActivity({ attachments: [this.createHeroCard()] }); - break; - case 'Receipt Card': - await stepContext.context.sendActivity({ attachments: [this.createReceiptCard()] }); - break; - case 'Signin Card': - await stepContext.context.sendActivity({ attachments: [this.createSignInCard()] }); - break; - case 'Thumbnail Card': - await stepContext.context.sendActivity({ attachments: [this.createThumbnailCard()] }); - break; - case 'Video Card': - await stepContext.context.sendActivity({ attachments: [this.createVideoCard()] }); - break; - default: - await stepContext.context.sendActivity({ - attachmentLayout: AttachmentLayoutTypes.Carousel, - attachments: [ - this.createAdaptiveCard(), - this.createAnimationCard(), - this.createAudioCard(), - this.createOAuthCard(), - this.createHeroCard(), - this.createReceiptCard(), - this.createSignInCard(), - this.createThumbnailCard(), - this.createVideoCard() - ] - }); - break; + case 'Adaptive Card': + await stepContext.context.sendActivity({ attachments: [this.createAdaptiveCard()] }); + break; + case 'Animation Card': + await stepContext.context.sendActivity({ attachments: [this.createAnimationCard()] }); + break; + case 'Audio Card': + await stepContext.context.sendActivity({ attachments: [this.createAudioCard()] }); + break; + case 'OAuth Card': + await stepContext.context.sendActivity({ attachments: [this.createOAuthCard()] }); + break; + case 'Hero Card': + await stepContext.context.sendActivity({ attachments: [this.createHeroCard()] }); + break; + case 'Receipt Card': + await stepContext.context.sendActivity({ attachments: [this.createReceiptCard()] }); + break; + case 'Signin Card': + await stepContext.context.sendActivity({ attachments: [this.createSignInCard()] }); + break; + case 'Thumbnail Card': + await stepContext.context.sendActivity({ attachments: [this.createThumbnailCard()] }); + break; + case 'Video Card': + await stepContext.context.sendActivity({ attachments: [this.createVideoCard()] }); + break; + default: + await stepContext.context.sendActivity({ + attachmentLayout: AttachmentLayoutTypes.Carousel, + attachments: [ + this.createAdaptiveCard(), + this.createAnimationCard(), + this.createAudioCard(), + this.createOAuthCard(), + this.createHeroCard(), + this.createReceiptCard(), + this.createSignInCard(), + this.createThumbnailCard(), + this.createVideoCard() + ] + }); + break; } // Give the user instructions about what to do next diff --git a/samples/typescript_nodejs/06.using-cards/src/index.ts b/samples/typescript_nodejs/06.using-cards/src/index.ts index 4e34cf6404..1653a8dc06 100644 --- a/samples/typescript_nodejs/06.using-cards/src/index.ts +++ b/samples/typescript_nodejs/06.using-cards/src/index.ts @@ -35,12 +35,12 @@ adapter.onTurnError = async (context, error) => { // This check writes out errors to console log .vs. app insights. // NOTE: In production environment, you should consider logging this to Azure // application insights. - console.error(`\n [onTurnError] unhandled error: ${error}`); + console.error(`\n [onTurnError] unhandled error: ${ error }`); // Send a trace activity, which will be displayed in Bot Framework Emulator await context.sendTraceActivity( 'OnTurnError Trace', - `${error}`, + `${ error }`, 'https://www.botframework.com/schemas/error', 'TurnError' ); @@ -70,7 +70,7 @@ const server = restify.createServer(); server.use(restify.plugins.bodyParser()); server.listen(process.env.port || process.env.PORT || 3978, () => { - console.log(`\n${server.name} listening to ${server.url}.`); + console.log(`\n${ server.name } listening to ${ server.url }.`); console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator'); console.log('\nTo talk to your bot, open the emulator select "Open Bot"'); }); diff --git a/samples/typescript_nodejs/06.using-cards/tslint.json b/samples/typescript_nodejs/06.using-cards/tslint.json deleted file mode 100644 index ad00715f85..0000000000 --- a/samples/typescript_nodejs/06.using-cards/tslint.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "interface-name" : [true, "never-prefix"], - "max-line-length": [false], - "no-console": [false, "log", "error"], - "no-var-requires": false, - "quotemark": [true, "single"], - "one-variable-per-declaration": false, - "curly": [true, "ignore-same-line"], - "trailing-comma": [true, {"multiline": "never", "singleline": "never"}] - }, - "rulesDirectory": [] -} diff --git a/samples/typescript_nodejs/13.core-bot/.eslintrc.js b/samples/typescript_nodejs/13.core-bot/.eslintrc.js index ede4753f25..c9b0496c15 100644 --- a/samples/typescript_nodejs/13.core-bot/.eslintrc.js +++ b/samples/typescript_nodejs/13.core-bot/.eslintrc.js @@ -1,6 +1,7 @@ /* eslint-disable */ module.exports = { "extends": "standard", + "parser": "@typescript-eslint/parser", "rules": { "semi": [2, "always"], "indent": [2, 4], @@ -10,7 +11,10 @@ module.exports = { "anonymous": "never", "asyncArrow": "always" }], - "template-curly-spacing": [2, "always"] + "template-curly-spacing": [2, "always"], + "no-useless-constructor": 0, + "prefer-const": 0, + "array-callback-return": 0 }, "env": { "commonjs": true, diff --git a/samples/typescript_nodejs/13.core-bot/package.json b/samples/typescript_nodejs/13.core-bot/package.json index 8f51effe39..7668dce794 100644 --- a/samples/typescript_nodejs/13.core-bot/package.json +++ b/samples/typescript_nodejs/13.core-bot/package.json @@ -7,7 +7,7 @@ "main": "index.js", "scripts": { "build": "tsc --build", - "lint": "tslint -c tslint.json 'src/**/*.ts'", + "lint": "eslint -c .eslintrc.js --ext .ts src", "postinstall": "npm run build && node ./deploymentScripts/webConfigPrep.js", "start": "tsc --build && node ./lib/index.js", "test": "tsc --build && nyc mocha lib/tests/**/*.test.js", @@ -51,11 +51,18 @@ "@types/mocha": "^7.0.2", "@types/node": "^16.11.6", "@types/restify": "8.4.2", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "eslint": "^8.57.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "mocha": "^7.1.2", "nodemon": "~2.0.4", "nyc": "^15.0.1", "ts-node": "^8.10.1", - "tslint": "~6.1.2", - "typescript": "~4.3.2" + "typescript": "~4.9.3" } -} \ No newline at end of file +} diff --git a/samples/typescript_nodejs/13.core-bot/src/dialogs/cancelAndHelpDialog.ts b/samples/typescript_nodejs/13.core-bot/src/dialogs/cancelAndHelpDialog.ts index 9caca1e597..7b606d0aad 100644 --- a/samples/typescript_nodejs/13.core-bot/src/dialogs/cancelAndHelpDialog.ts +++ b/samples/typescript_nodejs/13.core-bot/src/dialogs/cancelAndHelpDialog.ts @@ -26,16 +26,18 @@ export class CancelAndHelpDialog extends ComponentDialog { const text = innerDc.context.activity.text.toLowerCase(); switch (text) { - case 'help': - case '?': - const helpMessageText = 'Show help here'; - await innerDc.context.sendActivity(helpMessageText, helpMessageText, InputHints.ExpectingInput); - return { status: DialogTurnStatus.waiting }; - case 'cancel': - case 'quit': - const cancelMessageText = 'Cancelling...'; - await innerDc.context.sendActivity(cancelMessageText, cancelMessageText, InputHints.IgnoringInput); - return await innerDc.cancelAllDialogs(); + case 'help': + case '?':{ + const helpMessageText = 'Show help here'; + await innerDc.context.sendActivity(helpMessageText, helpMessageText, InputHints.ExpectingInput); + return { status: DialogTurnStatus.waiting }; + } + case 'cancel': + case 'quit':{ + const cancelMessageText = 'Cancelling...'; + await innerDc.context.sendActivity(cancelMessageText, cancelMessageText, InputHints.IgnoringInput); + return await innerDc.cancelAllDialogs(); + } } } } diff --git a/samples/typescript_nodejs/13.core-bot/src/dialogs/dateResolverDialog.ts b/samples/typescript_nodejs/13.core-bot/src/dialogs/dateResolverDialog.ts index 447526281d..54cb5c7eb1 100644 --- a/samples/typescript_nodejs/13.core-bot/src/dialogs/dateResolverDialog.ts +++ b/samples/typescript_nodejs/13.core-bot/src/dialogs/dateResolverDialog.ts @@ -10,7 +10,6 @@ const DATETIME_PROMPT = 'datetimePrompt'; const WATERFALL_DIALOG = 'waterfallDialog'; export class DateResolverDialog extends CancelAndHelpDialog { - private static async dateTimePromptValidator(promptContext: PromptValidatorContext): Promise { if (promptContext.recognized.succeeded) { // This value will be a TIMEX. And we are only interested in a Date so grab the first result and drop the Time part. diff --git a/samples/typescript_nodejs/13.core-bot/src/dialogs/flightBookingRecognizer.ts b/samples/typescript_nodejs/13.core-bot/src/dialogs/flightBookingRecognizer.ts index 63bc37ad82..50c4904a93 100644 --- a/samples/typescript_nodejs/13.core-bot/src/dialogs/flightBookingRecognizer.ts +++ b/samples/typescript_nodejs/13.core-bot/src/dialogs/flightBookingRecognizer.ts @@ -13,7 +13,7 @@ export class FlightBookingRecognizer { // Set the recognizer options depending on which endpoint version you want to use e.g LuisRecognizerOptionsV2 or LuisRecognizerOptionsV3. // More details can be found in https://docs.microsoft.com/en-gb/azure/cognitive-services/luis/luis-migration-api-v3 const recognizerOptions: LuisRecognizerOptionsV3 = { - apiVersion : 'v3' + apiVersion: 'v3' }; this.recognizer = new LuisRecognizer(config, recognizerOptions); diff --git a/samples/typescript_nodejs/13.core-bot/src/dialogs/mainDialog.ts b/samples/typescript_nodejs/13.core-bot/src/dialogs/mainDialog.ts index fb530c5e42..dfdbc1287a 100644 --- a/samples/typescript_nodejs/13.core-bot/src/dialogs/mainDialog.ts +++ b/samples/typescript_nodejs/13.core-bot/src/dialogs/mainDialog.ts @@ -74,7 +74,7 @@ export class MainDialog extends ComponentDialog { return await stepContext.next(); } const weekLaterDate = moment().add(7, 'days').format('MMMM D, YYYY'); - const messageText = (stepContext.options as any).restartMsg ? (stepContext.options as any).restartMsg : `What can I help you with today?\nSay something like "Book a flight from Paris to Berlin on ${weekLaterDate}"`; + const messageText = (stepContext.options as any).restartMsg ? (stepContext.options as any).restartMsg : `What can I help you with today?\nSay something like "Book a flight from Paris to Berlin on ${ weekLaterDate }"`; const promptMessage = MessageFactory.text(messageText, messageText, InputHints.ExpectingInput); return await stepContext.prompt('TextPrompt', { prompt: promptMessage }); } @@ -94,7 +94,7 @@ export class MainDialog extends ComponentDialog { // Call LUIS and gather any potential booking details. (Note the TurnContext has the response to the prompt) const luisResult = await this.luisRecognizer.executeLuisQuery(stepContext.context); switch (LuisRecognizer.topIntent(luisResult)) { - case 'BookFlight': + case 'BookFlight':{ // Extract the values for the composite entities from the LUIS result. const fromEntities = this.luisRecognizer.getFromEntities(luisResult); const toEntities = this.luisRecognizer.getToEntities(luisResult); @@ -110,18 +110,19 @@ export class MainDialog extends ComponentDialog { // Run the BookingDialog passing in whatever details we have from the LUIS call, it will fill out the remainder. return await stepContext.beginDialog('bookingDialog', bookingDetails); - - case 'GetWeather': + } + case 'GetWeather':{ // We haven't implemented the GetWeatherDialog so we just display a TODO message. const getWeatherMessageText = 'TODO: get weather flow here'; await stepContext.context.sendActivity(getWeatherMessageText, getWeatherMessageText, InputHints.IgnoringInput); break; - - default: + } + default:{ // Catch all for unhandled intents const didntUnderstandMessageText = `Sorry, I didn't get that. Please try asking in a different way (intent was ${ LuisRecognizer.topIntent(luisResult) })`; await stepContext.context.sendActivity(didntUnderstandMessageText, didntUnderstandMessageText, InputHints.IgnoringInput); } + } return await stepContext.next(); } diff --git a/samples/typescript_nodejs/13.core-bot/src/index.ts b/samples/typescript_nodejs/13.core-bot/src/index.ts index 145ff19a4e..cf66514362 100644 --- a/samples/typescript_nodejs/13.core-bot/src/index.ts +++ b/samples/typescript_nodejs/13.core-bot/src/index.ts @@ -3,11 +3,6 @@ import * as path from 'path'; -import { config } from 'dotenv'; -// Note: Ensure you have a .env file and include LuisAppId, LuisAPIKey and LuisAPIHostName. -const ENV_FILE = path.join(__dirname, '..', '.env'); -config({ path: ENV_FILE }); - import * as restify from 'restify'; import { INodeSocket } from 'botframework-streaming'; @@ -31,11 +26,16 @@ import { MainDialog } from './dialogs/mainDialog'; // The bot's booking dialog import { BookingDialog } from './dialogs/bookingDialog'; -const BOOKING_DIALOG = 'bookingDialog'; // The helper-class recognizer that calls LUIS import { FlightBookingRecognizer } from './dialogs/flightBookingRecognizer'; +import { config } from 'dotenv'; +// Note: Ensure you have a .env file and include LuisAppId, LuisAPIKey and LuisAPIHostName. +const ENV_FILE = path.join(__dirname, '..', '.env'); +config({ path: ENV_FILE }); +const BOOKING_DIALOG = 'bookingDialog'; + const botFrameworkAuthentication = new ConfigurationBotFrameworkAuthentication(process.env as ConfigurationBotFrameworkAuthenticationOptions); // Create adapter. @@ -80,11 +80,10 @@ conversationState = new ConversationState(memoryStorage); userState = new UserState(memoryStorage); // If configured, pass in the FlightBookingRecognizer. (Defining it externally allows it to be mocked for tests) -let luisRecognizer; const { LuisAppId, LuisAPIKey, LuisAPIHostName } = process.env; const luisConfig: LuisApplication = { applicationId: LuisAppId, endpointKey: LuisAPIKey, endpoint: `https://${ LuisAPIHostName }` }; -luisRecognizer = new FlightBookingRecognizer(luisConfig); +const luisRecognizer = new FlightBookingRecognizer(luisConfig); // Create the main dialog. const bookingDialog = new BookingDialog(BOOKING_DIALOG); diff --git a/samples/typescript_nodejs/13.core-bot/src/tests/dialogs/mainDialog.test.ts b/samples/typescript_nodejs/13.core-bot/src/tests/dialogs/mainDialog.test.ts index 900d7a921b..b6d4bd5ab3 100644 --- a/samples/typescript_nodejs/13.core-bot/src/tests/dialogs/mainDialog.test.ts +++ b/samples/typescript_nodejs/13.core-bot/src/tests/dialogs/mainDialog.test.ts @@ -86,15 +86,15 @@ describe('MainDialog', () => { const reply = await client.sendActivity('hi'); const weekLaterDate = moment().add(7, 'days').format('MMMM D, YYYY'); - assert.strictEqual(reply.text, `What can I help you with today?\nSay something like "Book a flight from Paris to Berlin on ${weekLaterDate}"`, 'Did not show prompt'); + assert.strictEqual(reply.text, `What can I help you with today?\nSay something like "Book a flight from Paris to Berlin on ${ weekLaterDate }"`, 'Did not show prompt'); }); describe('Invokes tasks based on LUIS intent', () => { // Create array with test case data. const testCases = [ { utterance: 'I want to book a flight', intent: 'BookFlight', invokedDialogResponse: 'bookingDialog mock invoked', taskConfirmationMessage: 'I have you booked to Seattle from New York' }, - { utterance: `What's the weather like?`, intent: 'GetWeather', invokedDialogResponse: 'TODO: get weather flow here', taskConfirmationMessage: undefined }, - { utterance: 'bananas', intent: 'None', invokedDialogResponse: `Sorry, I didn't get that. Please try asking in a different way (intent was None)`, taskConfirmationMessage: undefined } + { utterance: 'What\'s the weather like?', intent: 'GetWeather', invokedDialogResponse: 'TODO: get weather flow here', taskConfirmationMessage: undefined }, + { utterance: 'bananas', intent: 'None', invokedDialogResponse: 'Sorry, I didn\'t get that. Please try asking in a different way (intent was None)', taskConfirmationMessage: undefined } ]; testCases.map((testData) => { @@ -110,7 +110,7 @@ describe('MainDialog', () => { console.log(`Test Case: ${ testData.intent }`); let reply = await client.sendActivity('Hi'); const weekLaterDate = moment().add(7, 'days').format('MMMM D, YYYY'); - assert.strictEqual(reply.text, `What can I help you with today?\nSay something like "Book a flight from Paris to Berlin on ${weekLaterDate}"`); + assert.strictEqual(reply.text, `What can I help you with today?\nSay something like "Book a flight from Paris to Berlin on ${ weekLaterDate }"`); reply = await client.sendActivity(testData.utterance); assert.strictEqual(reply.text, testData.invokedDialogResponse); @@ -150,7 +150,7 @@ describe('MainDialog', () => { console.log(`Test Case: ${ mockLuisResult.text }`); let reply = await client.sendActivity('Hi'); const weekLaterDate = moment().add(7, 'days').format('MMMM D, YYYY'); - assert.strictEqual(reply.text, `What can I help you with today?\nSay something like "Book a flight from Paris to Berlin on ${weekLaterDate}"`); + assert.strictEqual(reply.text, `What can I help you with today?\nSay something like "Book a flight from Paris to Berlin on ${ weekLaterDate }"`); reply = await client.sendActivity(mockLuisResult.text); assert.strictEqual(reply.text, testData.expectedMessage); diff --git a/samples/typescript_nodejs/13.core-bot/src/tests/dialogs/testData/bookingDialogTestCases.ts b/samples/typescript_nodejs/13.core-bot/src/tests/dialogs/testData/bookingDialogTestCases.ts index a42457e6cc..6c74366984 100644 --- a/samples/typescript_nodejs/13.core-bot/src/tests/dialogs/testData/bookingDialogTestCases.ts +++ b/samples/typescript_nodejs/13.core-bot/src/tests/dialogs/testData/bookingDialogTestCases.ts @@ -89,17 +89,17 @@ module.exports = [ expectedResult: { destination: 'Seattle', origin: 'Bahamas', - travelDate: bookingDialogToday + travelDate: bookingDialogToday }, expectedStatus: 'complete', initialData: { destination: 'Seattle', origin: 'Bahamas', - travelDate: bookingDialogToday + travelDate: bookingDialogToday }, name: 'All booking details given for today', steps: [ - ['hi', `Please confirm, I have you traveling to: Seattle from: Bahamas on: ${ bookingDialogToday }. Is this correct? (1) Yes or (2) No`], + ['hi', `Please confirm, I have you traveling to: Seattle from: Bahamas on: ${ bookingDialogToday }. Is this correct? (1) Yes or (2) No`], ['yes', null] ] }, diff --git a/samples/typescript_nodejs/13.core-bot/tslint.json b/samples/typescript_nodejs/13.core-bot/tslint.json deleted file mode 100644 index ad00715f85..0000000000 --- a/samples/typescript_nodejs/13.core-bot/tslint.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "interface-name" : [true, "never-prefix"], - "max-line-length": [false], - "no-console": [false, "log", "error"], - "no-var-requires": false, - "quotemark": [true, "single"], - "one-variable-per-declaration": false, - "curly": [true, "ignore-same-line"], - "trailing-comma": [true, {"multiline": "never", "singleline": "never"}] - }, - "rulesDirectory": [] -} diff --git a/samples/typescript_nodejs/16.proactive-messages/.eslintrc.js b/samples/typescript_nodejs/16.proactive-messages/.eslintrc.js new file mode 100644 index 0000000000..df3d4c1da2 --- /dev/null +++ b/samples/typescript_nodejs/16.proactive-messages/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + "extends": "standard", + "parser": "@typescript-eslint/parser", + "rules": { + "semi": [2, "always"], + "indent": [2, 4], + "no-return-await": 0, + "space-before-function-paren": [2, { + "named": "never", + "anonymous": "never", + "asyncArrow": "always" + }], + "template-curly-spacing": [2, "always"] + } +}; diff --git a/samples/typescript_nodejs/16.proactive-messages/package.json b/samples/typescript_nodejs/16.proactive-messages/package.json index 49e277db53..efe0cf58ca 100644 --- a/samples/typescript_nodejs/16.proactive-messages/package.json +++ b/samples/typescript_nodejs/16.proactive-messages/package.json @@ -7,7 +7,7 @@ "main": "./lib/index.js", "scripts": { "build": "tsc --build", - "lint": "tslint -c tslint.json 'src/**/*.ts'", + "lint": "eslint -c .eslintrc.js --ext .ts src", "postinstall": "npm run build && node ./deploymentScripts/webConfigPrep.js", "start": "tsc --build && node ./lib/index.js", "test": "echo \"Error: no test specified\" && exit 1", @@ -26,8 +26,15 @@ "devDependencies": { "@types/dotenv": "6.1.1", "@types/restify": "8.4.2", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "eslint": "^8.57.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "nodemon": "~1.19.4", - "tslint": "~5.20.0", - "typescript": "~4.3.2" + "typescript": "~4.9.3" } -} \ No newline at end of file +} diff --git a/samples/typescript_nodejs/16.proactive-messages/src/bot.ts b/samples/typescript_nodejs/16.proactive-messages/src/bot.ts index 813bde6cf9..4232c72dfe 100644 --- a/samples/typescript_nodejs/16.proactive-messages/src/bot.ts +++ b/samples/typescript_nodejs/16.proactive-messages/src/bot.ts @@ -25,11 +25,11 @@ export class EchoBot extends ActivityHandler { this.onMembersAdded(async (context, next) => { const membersAdded = context.activity.membersAdded; - const welcomeText = 'Hello and welcome!'; for (const member of membersAdded) { if (member.id !== context.activity.recipient.id) { const welcomeMessage = 'Welcome to the Proactive Bot sample. Navigate to http://localhost:3978/api/notify to proactively message everyone who has previously messaged this bot.'; - await context.sendActivity(welcomeMessage); } + await context.sendActivity(welcomeMessage); + } } // By calling next() you ensure that the next BotHandler is run. await next(); diff --git a/samples/typescript_nodejs/16.proactive-messages/src/index.ts b/samples/typescript_nodejs/16.proactive-messages/src/index.ts index 253a07b61c..88da1ad642 100644 --- a/samples/typescript_nodejs/16.proactive-messages/src/index.ts +++ b/samples/typescript_nodejs/16.proactive-messages/src/index.ts @@ -24,7 +24,7 @@ config({ path: ENV_FILE }); // Create HTTP server. const server = restify.createServer(); server.listen(process.env.port || process.env.PORT || 3978, () => { - console.log(`\n${server.name} listening to ${server.url}`); + console.log(`\n${ server.name } listening to ${ server.url }`); console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator'); console.log('\nTo talk to your bot, open the emulator select "Open Bot"'); }); diff --git a/samples/typescript_nodejs/16.proactive-messages/tslint.json b/samples/typescript_nodejs/16.proactive-messages/tslint.json deleted file mode 100644 index ad00715f85..0000000000 --- a/samples/typescript_nodejs/16.proactive-messages/tslint.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "interface-name" : [true, "never-prefix"], - "max-line-length": [false], - "no-console": [false, "log", "error"], - "no-var-requires": false, - "quotemark": [true, "single"], - "one-variable-per-declaration": false, - "curly": [true, "ignore-same-line"], - "trailing-comma": [true, {"multiline": "never", "singleline": "never"}] - }, - "rulesDirectory": [] -} From 8cf477ac8ca02b493445b6ddcfe62eedb4be7bea Mon Sep 17 00:00:00 2001 From: gandiddi <164224646+gandiddi@users.noreply.github.com> Date: Wed, 29 May 2024 21:06:33 +0530 Subject: [PATCH 16/21] Adding botbuilder-dialogs dependency in the requirements.txt (#3979) --- samples/python/23.facebook-events/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/python/23.facebook-events/requirements.txt b/samples/python/23.facebook-events/requirements.txt index 5f4a5af76c..cf01269071 100644 --- a/samples/python/23.facebook-events/requirements.txt +++ b/samples/python/23.facebook-events/requirements.txt @@ -1,2 +1,3 @@ jsonpickle==1.2 botbuilder-integration-aiohttp>=4.15.0 +botbuilder-dialogs>=4.15.0 \ No newline at end of file From dcf7786d12ba4eb50334a6f6570e462e093a8663 Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Fri, 31 May 2024 14:25:11 -0500 Subject: [PATCH 17/21] Updated immediate-accept-adapter to CloudAdapter --- .../HostedActivityService.cs | 4 +-- .../HostedTaskService.cs | 4 +-- .../csharp_dotnetcore/Bots/EchoBot.cs | 8 +++--- .../ImmediateAcceptAdapter.cs | 17 +++++------- .../ImmediateAcceptBot.csproj | 4 +-- .../csharp_dotnetcore/Program.cs | 8 ++++-- .../csharp_dotnetcore/README.md | 27 ++++++++++++------- .../csharp_dotnetcore/Startup.cs | 17 +++++++++--- 8 files changed, 54 insertions(+), 35 deletions(-) diff --git a/experimental/immediate-accept-adapter/csharp_dotnetcore/BackgroundActivityService/HostedActivityService.cs b/experimental/immediate-accept-adapter/csharp_dotnetcore/BackgroundActivityService/HostedActivityService.cs index 8189cc9051..e7f22a3314 100644 --- a/experimental/immediate-accept-adapter/csharp_dotnetcore/BackgroundActivityService/HostedActivityService.cs +++ b/experimental/immediate-accept-adapter/csharp_dotnetcore/BackgroundActivityService/HostedActivityService.cs @@ -124,7 +124,7 @@ private async Task BackgroundProcessing(CancellationToken stoppingToken) } else { - _logger.LogError("Work item not processed. Server is shutting down.", nameof(BackgroundProcessing)); + _logger.LogError("Work item not processed. Server is shutting down."); } } finally @@ -148,7 +148,7 @@ private Task GetTaskFromWorkItem(ActivityWithClaims activityWithClaims, Cancella catch (Exception ex) { // Bot Errors should be processed in the Adapter.OnTurnError. - _logger.LogError(ex, "Error occurred executing WorkItem.", nameof(HostedActivityService)); + _logger.LogError(ex, "Error occurred executing WorkItem."); } }, stoppingToken); } diff --git a/experimental/immediate-accept-adapter/csharp_dotnetcore/BackgroundTaskService/HostedTaskService.cs b/experimental/immediate-accept-adapter/csharp_dotnetcore/BackgroundTaskService/HostedTaskService.cs index 7e471e8b2d..2f325bb84b 100644 --- a/experimental/immediate-accept-adapter/csharp_dotnetcore/BackgroundTaskService/HostedTaskService.cs +++ b/experimental/immediate-accept-adapter/csharp_dotnetcore/BackgroundTaskService/HostedTaskService.cs @@ -103,7 +103,7 @@ private async Task BackgroundProcessing(CancellationToken stoppingToken) } else { - _logger.LogError("Work item not processed. Server is shutting down.", nameof(BackgroundProcessing)); + _logger.LogError("Work item not processed. Server is shutting down."); } } finally @@ -127,7 +127,7 @@ private Task GetTaskFromWorkItem(Func workItem, Cancell catch (Exception ex) { // Bot Errors should be processed in the Adapter.OnTurnError. - _logger.LogError(ex, "Error occurred executing WorkItem.", nameof(HostedTaskService)); + _logger.LogError(ex, "Error occurred executing WorkItem."); } }, stoppingToken); } diff --git a/experimental/immediate-accept-adapter/csharp_dotnetcore/Bots/EchoBot.cs b/experimental/immediate-accept-adapter/csharp_dotnetcore/Bots/EchoBot.cs index cfc29105cf..a02d28ffa9 100644 --- a/experimental/immediate-accept-adapter/csharp_dotnetcore/Bots/EchoBot.cs +++ b/experimental/immediate-accept-adapter/csharp_dotnetcore/Bots/EchoBot.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// -// Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.9.2 using System; using System.Collections.Generic; @@ -74,7 +72,7 @@ private async Task HandlePauseOrBackground(ITurnContext turnContext, string text // validate seconds were received in the text if (seconds < 1 || seconds > _shutdownTimeoutSeconds) { - await turnContext.SendActivityAsync($"Please enter seconds < {_shutdownTimeoutSeconds} > 0, and processing type. Example: 4 seconds or 4 background", cancellationToken: cancellationToken).ConfigureAwait(false); + await turnContext.SendActivityAsync($"Please enter seconds < {_shutdownTimeoutSeconds} > 0, and processing type. Example: 4 pause or 4 background", cancellationToken: cancellationToken).ConfigureAwait(false); } else { @@ -93,7 +91,7 @@ private async Task HandlePauseOrBackground(ITurnContext turnContext, string text if (text.Contains("pause")) { await turnContext.SendActivityAsync($"okay, pausing {seconds} seconds", cancellationToken: cancellationToken); - Thread.Sleep(TimeSpan.FromSeconds(seconds)); + await Task.Delay(TimeSpan.FromSeconds(seconds), cancellationToken); await turnContext.SendActivityAsync($"finished pausing {seconds} seconds {message}", cancellationToken: cancellationToken); } else @@ -120,7 +118,7 @@ await adapter.ContinueConversationAsync(_botId, conversationReference, async (in private async Task SendHelp(ITurnContext turnContext, CancellationToken cancellationToken) { - await turnContext.SendActivityAsync(MessageFactory.Text("send: 4 seconds ... and i will pause for 4 seconds while processing your message."), cancellationToken); + await turnContext.SendActivityAsync(MessageFactory.Text("send: 4 pause ... and i will pause for 4 seconds while processing your message."), cancellationToken); await turnContext.SendActivityAsync(MessageFactory.Text("send: 4 background ... and i will push your message to an additional background thread to process for 4 seconds."), cancellationToken); } diff --git a/experimental/immediate-accept-adapter/csharp_dotnetcore/ImmediateAcceptAdapter.cs b/experimental/immediate-accept-adapter/csharp_dotnetcore/ImmediateAcceptAdapter.cs index 8b4f146c7b..51b4e77a82 100644 --- a/experimental/immediate-accept-adapter/csharp_dotnetcore/ImmediateAcceptAdapter.cs +++ b/experimental/immediate-accept-adapter/csharp_dotnetcore/ImmediateAcceptAdapter.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// -// Generated with Bot Builder V4 SDK Template for Visual Studio CoreBot v4.9.2 using System; using System.Net; @@ -14,7 +12,6 @@ using Microsoft.Bot.Builder.TraceExtensions; using Microsoft.Bot.Connector.Authentication; using Microsoft.Bot.Schema; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace ImmediateAcceptBot @@ -25,10 +22,10 @@ namespace ImmediateAcceptBot /// /// /// If the activity is Not an Invoke, and DeliveryMode is Not ExpectReplies, and this - /// is NOT a Get request to upgrade to WebSockets, then the activity will be enqueuedto be processed + /// is NOT a Get request to upgrade to WebSockets, then the activity will be enqueued to be processed /// on a background thread. /// - public class ImmediateAcceptAdapter : BotFrameworkHttpAdapter, IBotFrameworkHttpAdapter + public class ImmediateAcceptAdapter : CloudAdapter { private readonly IActivityTaskQueue _activityTaskQueue; @@ -38,8 +35,8 @@ public class ImmediateAcceptAdapter : BotFrameworkHttpAdapter, IBotFrameworkHttp /// /// /// - public ImmediateAcceptAdapter(IConfiguration configuration, ILogger logger, IActivityTaskQueue activityTaskQueue) - : base(configuration, logger) + public ImmediateAcceptAdapter(BotFrameworkAuthentication auth, ILogger logger, IActivityTaskQueue activityTaskQueue) + : base(auth, logger) { _activityTaskQueue = activityTaskQueue; @@ -72,7 +69,7 @@ public ImmediateAcceptAdapter(IConfiguration configuration, ILoggerA cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// A task that represents the work queued to execute. - async Task IBotFrameworkHttpAdapter.ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken = default) + public new async Task ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken = default) { if (httpRequest == null) { @@ -116,10 +113,10 @@ async Task IBotFrameworkHttpAdapter.ProcessAsync(HttpRequest httpRequest, HttpRe try { // If authentication passes, queue a work item to process the inbound activity with the bot - var claimsIdentity = await JwtTokenValidation.AuthenticateRequest(activity, authHeader, CredentialProvider, ChannelProvider, HttpClient).ConfigureAwait(false); + var authResult = await BotFrameworkAuthentication.AuthenticateRequestAsync(activity, authHeader, cancellationToken).ConfigureAwait(false); // Queue the activity to be processed by the ActivityBackgroundService - _activityTaskQueue.QueueBackgroundActivity(claimsIdentity, activity); + _activityTaskQueue.QueueBackgroundActivity(authResult.ClaimsIdentity, activity); // Activity has been queued to process, so return Ok immediately httpResponse.StatusCode = (int)HttpStatusCode.OK; diff --git a/experimental/immediate-accept-adapter/csharp_dotnetcore/ImmediateAcceptBot.csproj b/experimental/immediate-accept-adapter/csharp_dotnetcore/ImmediateAcceptBot.csproj index f6c45b2a4c..69ccffba5e 100644 --- a/experimental/immediate-accept-adapter/csharp_dotnetcore/ImmediateAcceptBot.csproj +++ b/experimental/immediate-accept-adapter/csharp_dotnetcore/ImmediateAcceptBot.csproj @@ -1,13 +1,13 @@  - netcoreapp3.1 + net8 latest - + diff --git a/experimental/immediate-accept-adapter/csharp_dotnetcore/Program.cs b/experimental/immediate-accept-adapter/csharp_dotnetcore/Program.cs index 099c59f657..ceca99ed24 100644 --- a/experimental/immediate-accept-adapter/csharp_dotnetcore/Program.cs +++ b/experimental/immediate-accept-adapter/csharp_dotnetcore/Program.cs @@ -1,10 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// -// Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.9.2 using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; namespace ImmediateAcceptBot { @@ -19,6 +18,11 @@ public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { + webBuilder.ConfigureLogging((logging) => + { + logging.AddDebug(); + logging.AddConsole(); + }); webBuilder.UseStartup(); }); } diff --git a/experimental/immediate-accept-adapter/csharp_dotnetcore/README.md b/experimental/immediate-accept-adapter/csharp_dotnetcore/README.md index b6cb6eb561..3477afcb13 100644 --- a/experimental/immediate-accept-adapter/csharp_dotnetcore/README.md +++ b/experimental/immediate-accept-adapter/csharp_dotnetcore/README.md @@ -28,7 +28,7 @@ New method in BotFrameworkHttpAdapter implementation: /// A cancellation token that can be used by other objects or threads to receive /// notice of cancellation. /// A task that represents the work queued to execute. -async Task IBotFrameworkHttpAdapter.ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken = default) +public new async Task ProcessAsync(HttpRequest httpRequest, HttpResponse httpResponse, IBot bot, CancellationToken cancellationToken = default) { if (httpRequest == null) { @@ -72,10 +72,10 @@ async Task IBotFrameworkHttpAdapter.ProcessAsync(HttpRequest httpRequest, HttpRe try { // If authentication passes, queue a work item to process the inbound activity with the bot - var claimsIdentity = await JwtTokenValidation.AuthenticateRequest(activity, authHeader, CredentialProvider, ChannelProvider, HttpClient).ConfigureAwait(false); + var authResult = await BotFrameworkAuthentication.AuthenticateRequestAsync(activity, authHeader, cancellationToken).ConfigureAwait(false); // Queue the activity to be processed by the ActivityBackgroundService - _activityTaskQueue.QueueBackgroundActivity(claimsIdentity, activity); + _activityTaskQueue.QueueBackgroundActivity(authResult.ClaimsIdentity, activity); // Activity has been queued to process, so return Ok immediately httpResponse.StatusCode = (int)HttpStatusCode.OK; @@ -87,7 +87,7 @@ async Task IBotFrameworkHttpAdapter.ProcessAsync(HttpRequest httpRequest, HttpRe } } } -} +} ``` ## Startup.cs @@ -97,13 +97,16 @@ Register BackgroundServices and classes: ```cs public void ConfigureServices(IServiceCollection services) { - services.AddControllers().AddNewtonsoftJson(); + services.AddHttpClient().AddControllers().AddNewtonsoftJson(options => + { + options.SerializerSettings.MaxDepth = HttpHelper.BotMessageSerializerSettings.MaxDepth; + }); // Activity specific BackgroundService for processing athenticated activities. services.AddHostedService(); // Generic BackgroundService for processing tasks. services.AddHostedService(); - + // BackgroundTaskQueue and ActivityTaskQueue are the entry points for // the enqueueing activities or tasks to be processed by the BackgroundService. services.AddSingleton(); @@ -112,17 +115,23 @@ public void ConfigureServices(IServiceCollection services) // Configure the ShutdownTimeout based on appsettings. services.Configure(opts => opts.ShutdownTimeout = TimeSpan.FromSeconds(Configuration.GetValue("ShutdownTimeoutSeconds"))); - // Create the Bot Framework Adapter with error handling enabled. + // Create the Bot Framework Authentication to be used with the Bot Adapter. + services.AddSingleton(); + + // Create the ImmediateAcceptAdapter. + // Note: some classes use the base BotAdapter so we add an extra registration that pulls the same instance. services.AddSingleton(); + services.AddSingleton(sp => sp.GetService()); + services.AddSingleton(sp => sp.GetService()); // Create the bot. In this case the ASP Controller and ImmediateAcceptAdapter is expecting an IBot. - services.AddSingleton(); + services.AddTransient(); } ``` ## Interacting with the Bot -send: 4 seconds ... and the bot will pause for 4 seconds while processing your message. +send: 4 pause ... and the bot will pause for 4 seconds while processing your message. send: 4 background ... and the bot will push your message to an additional background thread to process for 4 seconds. ## Additional Resources diff --git a/experimental/immediate-accept-adapter/csharp_dotnetcore/Startup.cs b/experimental/immediate-accept-adapter/csharp_dotnetcore/Startup.cs index f8d9828698..a383e12e83 100644 --- a/experimental/immediate-accept-adapter/csharp_dotnetcore/Startup.cs +++ b/experimental/immediate-accept-adapter/csharp_dotnetcore/Startup.cs @@ -9,6 +9,8 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Integration.AspNet.Core; +using Microsoft.Bot.Connector.Authentication; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -27,7 +29,10 @@ public Startup(IConfiguration configuration) // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddControllers().AddNewtonsoftJson(); + services.AddHttpClient().AddControllers().AddNewtonsoftJson(options => + { + options.SerializerSettings.MaxDepth = HttpHelper.BotMessageSerializerSettings.MaxDepth; + }); // Activity specific BackgroundService for processing athenticated activities. services.AddHostedService(); @@ -42,11 +47,17 @@ public void ConfigureServices(IServiceCollection services) // Configure the ShutdownTimeout based on appsettings. services.Configure(opts => opts.ShutdownTimeout = TimeSpan.FromSeconds(Configuration.GetValue("ShutdownTimeoutSeconds"))); - // Create the Bot Framework Adapter with error handling enabled. + // Create the Bot Framework Authentication to be used with the Bot Adapter. + services.AddSingleton(); + + // Create the ImmediateAcceptAdapter. + // Note: some classes use the base BotAdapter so we add an extra registration that pulls the same instance. services.AddSingleton(); + services.AddSingleton(sp => sp.GetService()); + services.AddSingleton(sp => sp.GetService()); // Create the bot. In this case the ASP Controller and ImmediateAcceptAdapter is expecting an IBot. - services.AddSingleton(); + services.AddTransient(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. From ce328b01cc1315d6f36ca0c9aa0d9d1cf5ad11de Mon Sep 17 00:00:00 2001 From: Amrit10737726 <167064182+Amrit10737726@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:28:30 -0700 Subject: [PATCH 18/21] fix: [.NET Core] Remove .UseAuthorization if unnecessary for running bots #2920 (#3978) * .Authorization() was removed from Startup.cs because it is not required in the bot sample and is also not used by the SDK. * .Authorization() was removed from Startup.cs because it is not required in the bot sample and is also not used by the SDK. * Delete samples/csharp_dotnetcore/84.bot-authentication-certificate/AuthCertificateBot.csproj removing due to accidentally added * Delete samples/csharp_dotnetcore/85.bot-authentication-sni/AuthSNIBot.csproj removing due to accidentally added * Adding back the deleted .csproj files --------- Co-authored-by: Ganapathi Diddi --- samples/csharp_dotnetcore/02.echo-bot/Startup.cs | 1 - samples/csharp_dotnetcore/03.welcome-user/Startup.cs | 1 - samples/csharp_dotnetcore/05.multi-turn-prompt/Startup.cs | 1 - samples/csharp_dotnetcore/06.using-cards/Startup.cs | 1 - samples/csharp_dotnetcore/07.using-adaptive-cards/Startup.cs | 1 - samples/csharp_dotnetcore/08.suggested-actions/Startup.cs | 1 - samples/csharp_dotnetcore/12.customQABot/Startup.cs | 1 - samples/csharp_dotnetcore/13.core-bot/Startup.cs | 1 - samples/csharp_dotnetcore/15.handling-attachments/Startup.cs | 1 - samples/csharp_dotnetcore/16.proactive-messages/Startup.cs | 1 - samples/csharp_dotnetcore/17.multilingual-bot/Startup.cs | 1 - samples/csharp_dotnetcore/18.bot-authentication/Startup.cs | 1 - samples/csharp_dotnetcore/19.custom-dialogs/Startup.cs | 1 - samples/csharp_dotnetcore/21.corebot-app-insights/Startup.cs | 1 - samples/csharp_dotnetcore/23.facebook-events/Startup.cs | 1 - .../csharp_dotnetcore/24.bot-authentication-msgraph/Startup.cs | 1 - samples/csharp_dotnetcore/42.scaleout/Startup.cs | 1 - samples/csharp_dotnetcore/43.complex-dialog/Startup.cs | 1 - samples/csharp_dotnetcore/44.prompt-users-for-input/Startup.cs | 1 - samples/csharp_dotnetcore/45.state-management/Startup.cs | 1 - samples/csharp_dotnetcore/47.inspection/Startup.cs | 1 - .../csharp_dotnetcore/48.customQABot-all-features/Startup.cs | 1 - .../80.skills-simple-bot-to-bot/EchoSkillBot/Startup.cs | 1 - .../80.skills-simple-bot-to-bot/SimpleRootBot/Startup.cs | 1 - .../81.skills-skilldialog/DialogRootBot/Startup.cs | 2 -- .../81.skills-skilldialog/DialogSkillBot/Startup.cs | 1 - .../82.skills-sso-cloudadapter/RootBot/Startup.cs | 1 - .../82.skills-sso-cloudadapter/SkillBot/Startup.cs | 1 - .../84.bot-authentication-certificate/Startup.cs | 1 - samples/csharp_dotnetcore/85.bot-authentication-sni/Startup.cs | 1 - 30 files changed, 31 deletions(-) diff --git a/samples/csharp_dotnetcore/02.echo-bot/Startup.cs b/samples/csharp_dotnetcore/02.echo-bot/Startup.cs index 663e9cbf04..0362f26af7 100644 --- a/samples/csharp_dotnetcore/02.echo-bot/Startup.cs +++ b/samples/csharp_dotnetcore/02.echo-bot/Startup.cs @@ -53,7 +53,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) .UseStaticFiles() .UseWebSockets() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/03.welcome-user/Startup.cs b/samples/csharp_dotnetcore/03.welcome-user/Startup.cs index cc80622b28..d4bd1997a2 100644 --- a/samples/csharp_dotnetcore/03.welcome-user/Startup.cs +++ b/samples/csharp_dotnetcore/03.welcome-user/Startup.cs @@ -48,7 +48,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/05.multi-turn-prompt/Startup.cs b/samples/csharp_dotnetcore/05.multi-turn-prompt/Startup.cs index b59c2b581d..c327569754 100644 --- a/samples/csharp_dotnetcore/05.multi-turn-prompt/Startup.cs +++ b/samples/csharp_dotnetcore/05.multi-turn-prompt/Startup.cs @@ -54,7 +54,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/06.using-cards/Startup.cs b/samples/csharp_dotnetcore/06.using-cards/Startup.cs index 3265495d6f..4333877940 100644 --- a/samples/csharp_dotnetcore/06.using-cards/Startup.cs +++ b/samples/csharp_dotnetcore/06.using-cards/Startup.cs @@ -54,7 +54,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/07.using-adaptive-cards/Startup.cs b/samples/csharp_dotnetcore/07.using-adaptive-cards/Startup.cs index 23fd7ae765..87175b1e79 100644 --- a/samples/csharp_dotnetcore/07.using-adaptive-cards/Startup.cs +++ b/samples/csharp_dotnetcore/07.using-adaptive-cards/Startup.cs @@ -42,7 +42,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/08.suggested-actions/Startup.cs b/samples/csharp_dotnetcore/08.suggested-actions/Startup.cs index cf997a0b06..ef889cdd5a 100644 --- a/samples/csharp_dotnetcore/08.suggested-actions/Startup.cs +++ b/samples/csharp_dotnetcore/08.suggested-actions/Startup.cs @@ -42,7 +42,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/12.customQABot/Startup.cs b/samples/csharp_dotnetcore/12.customQABot/Startup.cs index 4df45516d0..2d4dfaddf9 100644 --- a/samples/csharp_dotnetcore/12.customQABot/Startup.cs +++ b/samples/csharp_dotnetcore/12.customQABot/Startup.cs @@ -44,7 +44,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) .UseStaticFiles() .UseWebSockets() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/13.core-bot/Startup.cs b/samples/csharp_dotnetcore/13.core-bot/Startup.cs index a191cd735f..e606a85886 100644 --- a/samples/csharp_dotnetcore/13.core-bot/Startup.cs +++ b/samples/csharp_dotnetcore/13.core-bot/Startup.cs @@ -63,7 +63,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) .UseStaticFiles() .UseWebSockets() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/15.handling-attachments/Startup.cs b/samples/csharp_dotnetcore/15.handling-attachments/Startup.cs index a3b3014631..ab3573e4de 100644 --- a/samples/csharp_dotnetcore/15.handling-attachments/Startup.cs +++ b/samples/csharp_dotnetcore/15.handling-attachments/Startup.cs @@ -42,7 +42,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/16.proactive-messages/Startup.cs b/samples/csharp_dotnetcore/16.proactive-messages/Startup.cs index cedbc1a603..2423fd4332 100644 --- a/samples/csharp_dotnetcore/16.proactive-messages/Startup.cs +++ b/samples/csharp_dotnetcore/16.proactive-messages/Startup.cs @@ -47,7 +47,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/17.multilingual-bot/Startup.cs b/samples/csharp_dotnetcore/17.multilingual-bot/Startup.cs index e35b39d293..80e49565f9 100644 --- a/samples/csharp_dotnetcore/17.multilingual-bot/Startup.cs +++ b/samples/csharp_dotnetcore/17.multilingual-bot/Startup.cs @@ -62,7 +62,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/18.bot-authentication/Startup.cs b/samples/csharp_dotnetcore/18.bot-authentication/Startup.cs index 7c5f0d8167..d5d50ccb82 100644 --- a/samples/csharp_dotnetcore/18.bot-authentication/Startup.cs +++ b/samples/csharp_dotnetcore/18.bot-authentication/Startup.cs @@ -54,7 +54,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/19.custom-dialogs/Startup.cs b/samples/csharp_dotnetcore/19.custom-dialogs/Startup.cs index 1a5edf4a3a..1a57766c02 100644 --- a/samples/csharp_dotnetcore/19.custom-dialogs/Startup.cs +++ b/samples/csharp_dotnetcore/19.custom-dialogs/Startup.cs @@ -54,7 +54,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/21.corebot-app-insights/Startup.cs b/samples/csharp_dotnetcore/21.corebot-app-insights/Startup.cs index 9b6bdcb163..21f6382921 100644 --- a/samples/csharp_dotnetcore/21.corebot-app-insights/Startup.cs +++ b/samples/csharp_dotnetcore/21.corebot-app-insights/Startup.cs @@ -84,7 +84,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) .UseStaticFiles() .UseWebSockets() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/23.facebook-events/Startup.cs b/samples/csharp_dotnetcore/23.facebook-events/Startup.cs index 4aa35479cf..29dbeb03ae 100644 --- a/samples/csharp_dotnetcore/23.facebook-events/Startup.cs +++ b/samples/csharp_dotnetcore/23.facebook-events/Startup.cs @@ -48,7 +48,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/24.bot-authentication-msgraph/Startup.cs b/samples/csharp_dotnetcore/24.bot-authentication-msgraph/Startup.cs index 7c5f0d8167..d5d50ccb82 100644 --- a/samples/csharp_dotnetcore/24.bot-authentication-msgraph/Startup.cs +++ b/samples/csharp_dotnetcore/24.bot-authentication-msgraph/Startup.cs @@ -54,7 +54,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/42.scaleout/Startup.cs b/samples/csharp_dotnetcore/42.scaleout/Startup.cs index 4263a4c10f..18a45334b0 100644 --- a/samples/csharp_dotnetcore/42.scaleout/Startup.cs +++ b/samples/csharp_dotnetcore/42.scaleout/Startup.cs @@ -55,7 +55,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/43.complex-dialog/Startup.cs b/samples/csharp_dotnetcore/43.complex-dialog/Startup.cs index 5c3c3deb3d..1a3d714353 100644 --- a/samples/csharp_dotnetcore/43.complex-dialog/Startup.cs +++ b/samples/csharp_dotnetcore/43.complex-dialog/Startup.cs @@ -52,7 +52,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/44.prompt-users-for-input/Startup.cs b/samples/csharp_dotnetcore/44.prompt-users-for-input/Startup.cs index 84f68041b2..9803f44fd3 100644 --- a/samples/csharp_dotnetcore/44.prompt-users-for-input/Startup.cs +++ b/samples/csharp_dotnetcore/44.prompt-users-for-input/Startup.cs @@ -51,7 +51,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/45.state-management/Startup.cs b/samples/csharp_dotnetcore/45.state-management/Startup.cs index 6d31abe4ba..e293ac1954 100644 --- a/samples/csharp_dotnetcore/45.state-management/Startup.cs +++ b/samples/csharp_dotnetcore/45.state-management/Startup.cs @@ -99,7 +99,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/47.inspection/Startup.cs b/samples/csharp_dotnetcore/47.inspection/Startup.cs index e5ef56f551..b24f268cf2 100644 --- a/samples/csharp_dotnetcore/47.inspection/Startup.cs +++ b/samples/csharp_dotnetcore/47.inspection/Startup.cs @@ -55,7 +55,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/48.customQABot-all-features/Startup.cs b/samples/csharp_dotnetcore/48.customQABot-all-features/Startup.cs index d45f9a1214..0c517c9889 100644 --- a/samples/csharp_dotnetcore/48.customQABot-all-features/Startup.cs +++ b/samples/csharp_dotnetcore/48.customQABot-all-features/Startup.cs @@ -66,7 +66,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) .UseStaticFiles() .UseWebSockets() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/Startup.cs b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/Startup.cs index a97a3c3386..c6d3202015 100644 --- a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/Startup.cs +++ b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/EchoSkillBot/Startup.cs @@ -75,7 +75,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/Startup.cs b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/Startup.cs index cc4e60f5a9..7361e4d022 100644 --- a/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/Startup.cs +++ b/samples/csharp_dotnetcore/80.skills-simple-bot-to-bot/SimpleRootBot/Startup.cs @@ -93,7 +93,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/Startup.cs b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/Startup.cs index 9b5f062c2c..5bc83f59db 100644 --- a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/Startup.cs +++ b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogRootBot/Startup.cs @@ -112,8 +112,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseWebSockets(); - app.UseAuthorization(); - app.UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/Startup.cs b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/Startup.cs index 04509fd203..4e59a452c0 100644 --- a/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/Startup.cs +++ b/samples/csharp_dotnetcore/81.skills-skilldialog/DialogSkillBot/Startup.cs @@ -96,7 +96,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) .UseStaticFiles() .UseWebSockets() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/Startup.cs b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/Startup.cs index 968e39e120..e0cb7796d5 100644 --- a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/Startup.cs +++ b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/RootBot/Startup.cs @@ -112,7 +112,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseWebSockets(); - app.UseAuthorization(); app.UseEndpoints(endpoints => { diff --git a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/Startup.cs b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/Startup.cs index 28d6e5fba1..fa68100739 100644 --- a/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/Startup.cs +++ b/samples/csharp_dotnetcore/82.skills-sso-cloudadapter/SkillBot/Startup.cs @@ -93,7 +93,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) .UseStaticFiles() .UseWebSockets() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/84.bot-authentication-certificate/Startup.cs b/samples/csharp_dotnetcore/84.bot-authentication-certificate/Startup.cs index d142ed94da..4830af6798 100644 --- a/samples/csharp_dotnetcore/84.bot-authentication-certificate/Startup.cs +++ b/samples/csharp_dotnetcore/84.bot-authentication-certificate/Startup.cs @@ -79,7 +79,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); diff --git a/samples/csharp_dotnetcore/85.bot-authentication-sni/Startup.cs b/samples/csharp_dotnetcore/85.bot-authentication-sni/Startup.cs index a310c4372f..2fdd7d4942 100644 --- a/samples/csharp_dotnetcore/85.bot-authentication-sni/Startup.cs +++ b/samples/csharp_dotnetcore/85.bot-authentication-sni/Startup.cs @@ -89,7 +89,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseDefaultFiles() .UseStaticFiles() .UseRouting() - .UseAuthorization() .UseEndpoints(endpoints => { endpoints.MapControllers(); From 530db3bcc3b2b973990bcc44478d780999ab0ce2 Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Tue, 4 Jun 2024 13:28:11 -0500 Subject: [PATCH 19/21] Using UserTokenClient in Python 18.bot-authentication --- .../dialogs/logout_dialog.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/samples/python/18.bot-authentication/dialogs/logout_dialog.py b/samples/python/18.bot-authentication/dialogs/logout_dialog.py index 3132dd1037..bf8cdcf4c3 100644 --- a/samples/python/18.bot-authentication/dialogs/logout_dialog.py +++ b/samples/python/18.bot-authentication/dialogs/logout_dialog.py @@ -4,6 +4,7 @@ from botbuilder.dialogs import DialogTurnResult, ComponentDialog, DialogContext from botbuilder.core import BotFrameworkAdapter from botbuilder.schema import ActivityTypes +from botframework.connector.auth.user_token_client import UserTokenClient class LogoutDialog(ComponentDialog): @@ -12,7 +13,9 @@ def __init__(self, dialog_id: str, connection_name: str): self.connection_name = connection_name - async def on_begin_dialog(self, inner_dc: DialogContext, options: object) -> DialogTurnResult: + async def on_begin_dialog( + self, inner_dc: DialogContext, options: object + ) -> DialogTurnResult: result = await self._interrupt(inner_dc) if result: return result @@ -28,7 +31,13 @@ async def _interrupt(self, inner_dc: DialogContext): if inner_dc.context.activity.type == ActivityTypes.message: text = inner_dc.context.activity.text.lower() if text == "logout": - bot_adapter: BotFrameworkAdapter = inner_dc.context.adapter - await bot_adapter.sign_out_user(inner_dc.context, self.connection_name) + user_token_client: UserTokenClient = inner_dc.context.turn_state.get( + UserTokenClient.__name__, None + ) + await user_token_client.sign_out_user( + inner_dc.context.activity.from_property.id, + self.connection_name, + inner_dc.context.activity.channel_id, + ) await inner_dc.context.send_activity("You have been signed out.") return await inner_dc.cancel_all_dialogs() From 1330610d8a76f6daccb57270916ef2af0310c097 Mon Sep 17 00:00:00 2001 From: Amrit10737726 <167064182+Amrit10737726@users.noreply.github.com> Date: Thu, 6 Jun 2024 06:56:50 -0700 Subject: [PATCH 20/21] modified ftpState from AllAllowed to Disabled (#3981) --- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../02.echo-bot/deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../13.core-bot/deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../42.scaleout/deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../47.inspection/deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../DialogRootBot/deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../servlet-echo/deploymentTemplates/template-with-new-rg.json | 2 +- .../deploymentTemplates/template-with-preexisting-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- .../deployUseExistResourceGroup/template-BotApp-with-rg.json | 2 +- .../deployWithNewResourceGroup/template-BotApp-new-rg.json | 2 +- 128 files changed, 128 insertions(+), 128 deletions(-) diff --git a/samples/csharp_dotnetcore/02.echo-bot/DeploymentTemplates/Linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/csharp_dotnetcore/02.echo-bot/DeploymentTemplates/Linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2c3488d52a..6a5937d63a 100644 --- a/samples/csharp_dotnetcore/02.echo-bot/DeploymentTemplates/Linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/csharp_dotnetcore/02.echo-bot/DeploymentTemplates/Linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -262,7 +262,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/csharp_dotnetcore/02.echo-bot/DeploymentTemplates/Linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/csharp_dotnetcore/02.echo-bot/DeploymentTemplates/Linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index 4a25e874f6..93b17bf7b7 100644 --- a/samples/csharp_dotnetcore/02.echo-bot/DeploymentTemplates/Linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/csharp_dotnetcore/02.echo-bot/DeploymentTemplates/Linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -279,7 +279,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/csharp_dotnetcore/13.core-bot/DeploymentTemplates/Linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/csharp_dotnetcore/13.core-bot/DeploymentTemplates/Linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2c3488d52a..6a5937d63a 100644 --- a/samples/csharp_dotnetcore/13.core-bot/DeploymentTemplates/Linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/csharp_dotnetcore/13.core-bot/DeploymentTemplates/Linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -262,7 +262,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/csharp_dotnetcore/13.core-bot/DeploymentTemplates/Linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/csharp_dotnetcore/13.core-bot/DeploymentTemplates/Linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index 4a25e874f6..93b17bf7b7 100644 --- a/samples/csharp_dotnetcore/13.core-bot/DeploymentTemplates/Linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/csharp_dotnetcore/13.core-bot/DeploymentTemplates/Linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -279,7 +279,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/java_springboot/02.echo-bot/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/02.echo-bot/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/02.echo-bot/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/02.echo-bot/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/02.echo-bot/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/02.echo-bot/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/02.echo-bot/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/02.echo-bot/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/03.welcome-user/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/03.welcome-user/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/03.welcome-user/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/03.welcome-user/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/03.welcome-user/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/03.welcome-user/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/03.welcome-user/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/03.welcome-user/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/05.multi-turn-prompt/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/05.multi-turn-prompt/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/05.multi-turn-prompt/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/05.multi-turn-prompt/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/05.multi-turn-prompt/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/05.multi-turn-prompt/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/05.multi-turn-prompt/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/05.multi-turn-prompt/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/06.using-cards/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/06.using-cards/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/06.using-cards/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/06.using-cards/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/06.using-cards/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/06.using-cards/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/06.using-cards/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/06.using-cards/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/07.using-adaptive-cards/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/07.using-adaptive-cards/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/07.using-adaptive-cards/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/07.using-adaptive-cards/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/07.using-adaptive-cards/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/07.using-adaptive-cards/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/07.using-adaptive-cards/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/07.using-adaptive-cards/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/08.suggested-actions/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/08.suggested-actions/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/08.suggested-actions/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/08.suggested-actions/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/08.suggested-actions/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/08.suggested-actions/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/08.suggested-actions/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/08.suggested-actions/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/13.core-bot/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/13.core-bot/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/13.core-bot/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/13.core-bot/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/13.core-bot/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/13.core-bot/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/13.core-bot/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/13.core-bot/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/15.handling-attachments/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/15.handling-attachments/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/15.handling-attachments/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/15.handling-attachments/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/15.handling-attachments/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/15.handling-attachments/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/15.handling-attachments/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/15.handling-attachments/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/16.proactive-messages/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/16.proactive-messages/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/16.proactive-messages/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/16.proactive-messages/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/16.proactive-messages/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/16.proactive-messages/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/16.proactive-messages/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/16.proactive-messages/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/17.multilingual-bot/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/17.multilingual-bot/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/17.multilingual-bot/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/17.multilingual-bot/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/17.multilingual-bot/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/17.multilingual-bot/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/17.multilingual-bot/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/17.multilingual-bot/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/18.bot-authentication/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/18.bot-authentication/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/18.bot-authentication/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/18.bot-authentication/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/18.bot-authentication/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/18.bot-authentication/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/18.bot-authentication/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/18.bot-authentication/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/19.custom-dialogs/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/19.custom-dialogs/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/19.custom-dialogs/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/19.custom-dialogs/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/19.custom-dialogs/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/19.custom-dialogs/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/19.custom-dialogs/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/19.custom-dialogs/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/21.corebot-app-insights/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/21.corebot-app-insights/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/21.corebot-app-insights/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/21.corebot-app-insights/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/21.corebot-app-insights/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/21.corebot-app-insights/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/21.corebot-app-insights/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/21.corebot-app-insights/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/23.facebook-events/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/23.facebook-events/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/23.facebook-events/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/23.facebook-events/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/23.facebook-events/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/23.facebook-events/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/23.facebook-events/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/23.facebook-events/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/24.bot-authentication-msgraph/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/24.bot-authentication-msgraph/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/24.bot-authentication-msgraph/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/24.bot-authentication-msgraph/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/24.bot-authentication-msgraph/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/24.bot-authentication-msgraph/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/24.bot-authentication-msgraph/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/24.bot-authentication-msgraph/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/42.scaleout/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/42.scaleout/deploymentTemplates/template-with-new-rg.json index 757465b698..04774d42ee 100644 --- a/samples/java_springboot/42.scaleout/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/42.scaleout/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/42.scaleout/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/42.scaleout/deploymentTemplates/template-with-preexisting-rg.json index 1f1e1b0b6e..68e7899903 100644 --- a/samples/java_springboot/42.scaleout/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/42.scaleout/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/43.complex-dialog/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/43.complex-dialog/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/43.complex-dialog/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/43.complex-dialog/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/43.complex-dialog/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/43.complex-dialog/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/43.complex-dialog/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/43.complex-dialog/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/44.prompt-users-for-input/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/44.prompt-users-for-input/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/44.prompt-users-for-input/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/44.prompt-users-for-input/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/44.prompt-users-for-input/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/44.prompt-users-for-input/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/44.prompt-users-for-input/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/44.prompt-users-for-input/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/45.state-management/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/45.state-management/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/45.state-management/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/45.state-management/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/45.state-management/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/45.state-management/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/45.state-management/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/45.state-management/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/47.inspection/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/47.inspection/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/47.inspection/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/47.inspection/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/47.inspection/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/47.inspection/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/47.inspection/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/47.inspection/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogRootBot/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/80.skills-simple-bot-to-bot/DialogSkillBot/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/servlet-echo/deploymentTemplates/template-with-new-rg.json b/samples/java_springboot/servlet-echo/deploymentTemplates/template-with-new-rg.json index 196cfb9339..a7cab85d15 100644 --- a/samples/java_springboot/servlet-echo/deploymentTemplates/template-with-new-rg.json +++ b/samples/java_springboot/servlet-echo/deploymentTemplates/template-with-new-rg.json @@ -255,7 +255,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/java_springboot/servlet-echo/deploymentTemplates/template-with-preexisting-rg.json b/samples/java_springboot/servlet-echo/deploymentTemplates/template-with-preexisting-rg.json index da5712312e..632599ff03 100644 --- a/samples/java_springboot/servlet-echo/deploymentTemplates/template-with-preexisting-rg.json +++ b/samples/java_springboot/servlet-echo/deploymentTemplates/template-with-preexisting-rg.json @@ -228,7 +228,7 @@ "scmIpSecurityRestrictionsUseMain": false, "http20Enabled": false, "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } }, diff --git a/samples/javascript_nodejs/02.echo-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/javascript_nodejs/02.echo-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index d116d6d6e2..29d28db9b9 100644 --- a/samples/javascript_nodejs/02.echo-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/javascript_nodejs/02.echo-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -213,7 +213,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/02.echo-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/javascript_nodejs/02.echo-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index 1b84694812..a8bea6399f 100644 --- a/samples/javascript_nodejs/02.echo-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/javascript_nodejs/02.echo-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -232,7 +232,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/13.core-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/javascript_nodejs/13.core-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index d116d6d6e2..29d28db9b9 100644 --- a/samples/javascript_nodejs/13.core-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/javascript_nodejs/13.core-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -213,7 +213,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/13.core-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/javascript_nodejs/13.core-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index 1b84694812..a8bea6399f 100644 --- a/samples/javascript_nodejs/13.core-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/javascript_nodejs/13.core-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -232,7 +232,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/83.named-pipe-sample/named-pipe-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/javascript_nodejs/83.named-pipe-sample/named-pipe-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index d116d6d6e2..29d28db9b9 100644 --- a/samples/javascript_nodejs/83.named-pipe-sample/named-pipe-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/javascript_nodejs/83.named-pipe-sample/named-pipe-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -213,7 +213,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/83.named-pipe-sample/named-pipe-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/javascript_nodejs/83.named-pipe-sample/named-pipe-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index 1b84694812..a8bea6399f 100644 --- a/samples/javascript_nodejs/83.named-pipe-sample/named-pipe-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/javascript_nodejs/83.named-pipe-sample/named-pipe-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -232,7 +232,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/84.bot-authentication-certificate/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/javascript_nodejs/84.bot-authentication-certificate/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index 5d4f2a2f8f..9134816c87 100644 --- a/samples/javascript_nodejs/84.bot-authentication-certificate/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/javascript_nodejs/84.bot-authentication-certificate/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -227,7 +227,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/84.bot-authentication-certificate/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/javascript_nodejs/84.bot-authentication-certificate/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index 1b84694812..a8bea6399f 100644 --- a/samples/javascript_nodejs/84.bot-authentication-certificate/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/javascript_nodejs/84.bot-authentication-certificate/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -232,7 +232,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/85.bot-authentication-sni/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/javascript_nodejs/85.bot-authentication-sni/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index d588b44a4b..61d4070e32 100644 --- a/samples/javascript_nodejs/85.bot-authentication-sni/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/javascript_nodejs/85.bot-authentication-sni/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -213,7 +213,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/85.bot-authentication-sni/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/javascript_nodejs/85.bot-authentication-sni/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index ada32ceab9..e64071d85a 100644 --- a/samples/javascript_nodejs/85.bot-authentication-sni/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/javascript_nodejs/85.bot-authentication-sni/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -232,7 +232,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index d116d6d6e2..29d28db9b9 100644 --- a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -213,7 +213,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index 1b84694812..a8bea6399f 100644 --- a/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/javascript_nodejs/86.echo-proxy-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -232,7 +232,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/03.welcome-user/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/05.multi-turn-prompt/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/06.using-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/07.using-adaptive-cards/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/08.suggested-actions/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/15.handling-attachments/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/16.proactive-messages/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/17.multilingual-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/18.bot-authentication/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/19.custom-dialogs/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/21.corebot-app-insights/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/23.facebook-events/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/24.bot-authentication-msgraph/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/42.scaleout/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/43.complex-dialog/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/44.prompt-for-user-input/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/45.state-management/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/47.inspection/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/echo-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/80.skills-simple-bot-to-bot/simple-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-root-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/81.skills-skilldialog/dialog-skill-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/wip/python_django/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/wip/python_quart/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/wip/python_quart/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/wip/python_tornado/02.echo-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json index 2493d4b002..a0fcd27b74 100644 --- a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -244,7 +244,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json index f6147701d3..a5af40f831 100644 --- a/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/python/wip/python_tornado/13.core-bot/deploymentTemplates/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -256,7 +256,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/typescript_nodejs/02.echo-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/typescript_nodejs/02.echo-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index d116d6d6e2..29d28db9b9 100644 --- a/samples/typescript_nodejs/02.echo-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/typescript_nodejs/02.echo-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -213,7 +213,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/typescript_nodejs/02.echo-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/typescript_nodejs/02.echo-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index 1b84694812..a8bea6399f 100644 --- a/samples/typescript_nodejs/02.echo-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/typescript_nodejs/02.echo-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -232,7 +232,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/typescript_nodejs/13.core-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json b/samples/typescript_nodejs/13.core-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json index d116d6d6e2..29d28db9b9 100644 --- a/samples/typescript_nodejs/13.core-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json +++ b/samples/typescript_nodejs/13.core-bot/deploymentTemplates/linux/deployUseExistResourceGroup/template-BotApp-with-rg.json @@ -213,7 +213,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } diff --git a/samples/typescript_nodejs/13.core-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json b/samples/typescript_nodejs/13.core-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json index 1b84694812..a8bea6399f 100644 --- a/samples/typescript_nodejs/13.core-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json +++ b/samples/typescript_nodejs/13.core-bot/deploymentTemplates/linux/deployWithNewResourceGroup/template-BotApp-new-rg.json @@ -232,7 +232,7 @@ "autoHealEnabled": false, "vnetName": "", "minTlsVersion": "1.2", - "ftpsState": "AllAllowed", + "ftpsState": "Disabled", "reservedInstanceCount": 0 } } From 9b6173682b83ae7f2e37334a87609edf0da8c454 Mon Sep 17 00:00:00 2001 From: Tracy Boehrer Date: Tue, 18 Jun 2024 10:02:18 -0500 Subject: [PATCH 21/21] Using CertificateServiceClientCredentialsFactory for SN+I sample --- .../AuthSNIBot.csproj | 2 +- .../Bots/AuthSNIBot.cs | 17 ++-- .../Bots/DialogBot.cs | 50 ---------- .../85.bot-authentication-sni/README.md | 97 ++++++------------- .../85.bot-authentication-sni/Startup.cs | 37 +++---- 5 files changed, 54 insertions(+), 149 deletions(-) delete mode 100644 samples/csharp_dotnetcore/85.bot-authentication-sni/Bots/DialogBot.cs diff --git a/samples/csharp_dotnetcore/85.bot-authentication-sni/AuthSNIBot.csproj b/samples/csharp_dotnetcore/85.bot-authentication-sni/AuthSNIBot.csproj index b27dce8076..d3e9ce08cc 100644 --- a/samples/csharp_dotnetcore/85.bot-authentication-sni/AuthSNIBot.csproj +++ b/samples/csharp_dotnetcore/85.bot-authentication-sni/AuthSNIBot.csproj @@ -6,7 +6,7 @@ - + diff --git a/samples/csharp_dotnetcore/85.bot-authentication-sni/Bots/AuthSNIBot.cs b/samples/csharp_dotnetcore/85.bot-authentication-sni/Bots/AuthSNIBot.cs index fd8300485a..9bf8146852 100644 --- a/samples/csharp_dotnetcore/85.bot-authentication-sni/Bots/AuthSNIBot.cs +++ b/samples/csharp_dotnetcore/85.bot-authentication-sni/Bots/AuthSNIBot.cs @@ -11,21 +11,22 @@ namespace Microsoft.BotBuilderSamples { public class AuthSNIBot : ActivityHandler { + protected override async Task OnMessageActivityAsync(ITurnContext turnContext, CancellationToken cancellationToken) + { + var replyText = $"Echo: {turnContext.Activity.Text}"; + await turnContext.SendActivityAsync(MessageFactory.Text(replyText, replyText), cancellationToken); + } + protected override async Task OnMembersAddedAsync(IList membersAdded, ITurnContext turnContext, CancellationToken cancellationToken) { - foreach (var member in turnContext.Activity.MembersAdded) + var welcomeText = "Hello and welcome!"; + foreach (var member in membersAdded) { if (member.Id != turnContext.Activity.Recipient.Id) { - await turnContext.SendActivityAsync(MessageFactory.Text("Welcome to the Bot with Subject Name/Issuer Authentication."), cancellationToken); + await turnContext.SendActivityAsync(MessageFactory.Text(welcomeText, welcomeText), cancellationToken); } } } - - protected override async Task OnMessageActivityAsync(ITurnContext turnContext, CancellationToken cancellationToken) - { - var replyText = "Running dialog with bot authenticated"; - await turnContext.SendActivityAsync(MessageFactory.Text(replyText, replyText), cancellationToken); - } } } diff --git a/samples/csharp_dotnetcore/85.bot-authentication-sni/Bots/DialogBot.cs b/samples/csharp_dotnetcore/85.bot-authentication-sni/Bots/DialogBot.cs deleted file mode 100644 index 5136835d99..0000000000 --- a/samples/csharp_dotnetcore/85.bot-authentication-sni/Bots/DialogBot.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Bot.Builder; -using Microsoft.Bot.Builder.Dialogs; -using Microsoft.Bot.Schema; -using Microsoft.Extensions.Logging; - -namespace Microsoft.BotBuilderSamples -{ - // This IBot implementation can run any type of Dialog. The use of type parameterization is to allows multiple different bots - // to be run at different endpoints within the same project. This can be achieved by defining distinct Controller types - // each with dependency on distinct IBot types, this way ASP Dependency Injection can glue everything together without ambiguity. - // The ConversationState is used by the Dialog system. The UserState isn't, however, it might have been used in a Dialog implementation, - // and the requirement is that all BotState objects are saved at the end of a turn. - public class DialogBot : ActivityHandler where T : Dialog - { - protected readonly BotState ConversationState; - protected readonly Dialog Dialog; - protected readonly ILogger Logger; - protected readonly BotState UserState; - - public DialogBot(ConversationState conversationState, UserState userState, T dialog, ILogger> logger) - { - ConversationState = conversationState; - UserState = userState; - Dialog = dialog; - Logger = logger; - } - - public override async Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken = default(CancellationToken)) - { - await base.OnTurnAsync(turnContext, cancellationToken); - - // Save any state changes that might have occurred during the turn. - await ConversationState.SaveChangesAsync(turnContext, false, cancellationToken); - await UserState.SaveChangesAsync(turnContext, false, cancellationToken); - } - - protected override async Task OnMessageActivityAsync(ITurnContext turnContext, CancellationToken cancellationToken) - { - Logger.LogInformation("Running dialog with Message Activity."); - - // Run the Dialog with the new message Activity. - await Dialog.RunAsync(turnContext, ConversationState.CreateProperty(nameof(DialogState)), cancellationToken); - } - } -} diff --git a/samples/csharp_dotnetcore/85.bot-authentication-sni/README.md b/samples/csharp_dotnetcore/85.bot-authentication-sni/README.md index c7c293656a..3055589b05 100644 --- a/samples/csharp_dotnetcore/85.bot-authentication-sni/README.md +++ b/samples/csharp_dotnetcore/85.bot-authentication-sni/README.md @@ -21,91 +21,56 @@ This bot has been created using [Bot Framework](https://dev.botframework.com/), git clone https://github.com/microsoft/botbuilder-samples.git ``` -- Set app settings variables - - - MicrosoftAppType: Type of the App. - - - MicrosoftAppId: App Id of your bot. - - - MicrosoftAppTenantId: Tenant Id to which your bot belongs. - - - KeyVaultName: Name of the KeyVault containing the certificate. - - - CertificateName: Name of the certificate in the KeyVault. - - -- Run the bot from a terminal or from Visual Studio: - - A) From a terminal, navigate to `samples/csharp_dotnetcore/85.bot-authentication-sni` - - ```bash - # run the bot - dotnet run - ``` - - B) Or from Visual Studio - +- Open from Visual Studio - Launch Visual Studio - File -> Open -> Project/Solution - Navigate to `samples/csharp_dotnetcore/85.bot-authentication-sni` folder - Select `AuthSNIBot.csproj` file - - Press `F5` to run the project -## Testing the bot using Bot Framework Emulator +- Create an SSL/TLS certificate using KeyVault + 1. Create a KeyVault resource and assign _the KeyVault Administrator_ role to have permission to create a new certificate. -[Bot Framework Emulator](https://github.com/microsoft/botframework-emulator) is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel. + 2. Under the Certificates section, hit on Generate/Import, complete the form, and create the certificate in PEM format. -- Install the latest Bot Framework Emulator from [here](https://github.com/Microsoft/BotFramework-Emulator/releases) + 3. Go to the details of the certificate that you created and enable it and record the subject name -### Connect to the bot using Bot Framework Emulator +- Create Azure App and Bot + - Create App Registration + - This can be either Single or Multi tenant + - Record the Application ID + - Add this to the Manifest + "trustedCertificateSubjects": [ + { + "authorityId": "00000000-0000-0000-0000-000000000001", + + "subjectName": "certificate_subject_name", + + "revokedCertificateIdentifiers": [] + } + ] + - Create an Azure Bot in the desired resource group. Use the App Registration from the previous step. -- Launch Bot Framework Emulator -- File -> Open Bot -- Enter a Bot URL of `http://localhost:3978/api/messages` +- Set appsettings.json variables -## Interacting with the bot + - MicrosoftAppType: {SingTenant | MultiTenant} -This sample uses the bot authentication capabilities of Azure Bot Service, providing features to make it easier to develop a bot that authenticates users using digital security certificates. You just need to provide the certificate data linked to the managed identity and run the bot, then communicate with it to validate its correct authentication. + - MicrosoftAppId: {appId} -## SSL/TLS certificate + - MicrosoftAppTenantId: {tenantId} -An SSL/TLS certificate is a digital object that allows systems to verify identity and subsequently establish an encrypted network connection with another system using the Secure Sockets Layer/Transport Layer Security (SSL/TLS) protocol. Certificates are issued using a cryptographic system known as public key infrastructure (PKI). PKI allows one party to establish the identity of another through the use of certificates if they both trust a third party, known as a certificate authority. SSL/TLS certificates therefore function as digital identity documents that protect network communications and establish the identity of websites on the Internet as well as resources on private networks. - -## How to create an SSL/TLS certificate - -There are two possible options to create SSL/TSL certificate. Below is a step-by-step description of each one: - -### Using local environment - -1. Run the following command in a local PowerShell - -``` -$cert = New-SelfSignedCertificate -CertStoreLocation "" -Subject "CN=" -KeySpec KeyExchange -``` - -1. Then, type _Manage User Certificates_ in the Windows search bar and hit enter - -2. The certificate will be located in the _user certificates_ folder, under _personal_ directory. - -3. Export the certificate to _pfx_ format including the key(The default location is _system32_ folder). - -4. Go to the certificate location and run the following command to generate a _pem_ file: - -``` -OpenSSL pkcs12 -in .pfx -out c:\.pem –nodes -``` + - KeyVaultName: Name of the KeyVault containing the certificate. -5. Upload the generated certificate to the Azure app registration. + - CertificateName: Name of the certificate in the KeyVault. -### Using KeyVault +- Run the bot from Visual Studio: -1. Create a KeyVault resource and assign _the KeyVault Administrator_ role to have permission to create a new certificate. +## Interacting with the bot -2. Under the Certificates section, hit on Generate/Import, complete the form, and create the certificate in PEM format. +This sample uses the bot authentication capabilities of Azure Bot Service, providing features to make it easier to develop a bot that authenticates users using digital security certificates. You just need to provide the certificate data linked to the managed identity and run the bot, then communicate with it to validate its correct authentication. -3. Go to the details of the certificate that you created and enable it. +## SSL/TLS certificate -4. Download the certificate in CER format and then upload it to the Azure app registration. +An SSL/TLS certificate is a digital object that allows systems to verify identity and subsequently establish an encrypted network connection with another system using the Secure Sockets Layer/Transport Layer Security (SSL/TLS) protocol. Certificates are issued using a cryptographic system known as public key infrastructure (PKI). PKI allows one party to establish the identity of another through the use of certificates if they both trust a third party, known as a certificate authority. SSL/TLS certificates therefore function as digital identity documents that protect network communications and establish the identity of websites on the Internet as well as resources on private networks. ## Deploy the bot to Azure diff --git a/samples/csharp_dotnetcore/85.bot-authentication-sni/Startup.cs b/samples/csharp_dotnetcore/85.bot-authentication-sni/Startup.cs index 2fdd7d4942..1a183b00ae 100644 --- a/samples/csharp_dotnetcore/85.bot-authentication-sni/Startup.cs +++ b/samples/csharp_dotnetcore/85.bot-authentication-sni/Startup.cs @@ -33,7 +33,15 @@ public void ConfigureServices(IServiceCollection services) options.SerializerSettings.MaxDepth = HttpHelper.BotMessageSerializerSettings.MaxDepth; }); - //Set sendX5C value to true to use SNI auhtentication. + + // + // NOTE + // + // This is a provisional sample for SN+I. It is likely to change in the future as this + // functionality is rolled into BF SDK. + // + + // Set sendX5C value to true to use SNI authentication. var sendX5C = true; // Using KeyVault. @@ -43,21 +51,13 @@ public void ConfigureServices(IServiceCollection services) var credential = new DefaultAzureCredential(); var client = new CertificateClient(new Uri(keyVaultUri), credential); - //Get certificate in X509Certificate format. + // Get certificate in X509Certificate format. var certificateName = _configuration["CertificateName"]; var certificate = client.DownloadCertificate(certificateName).Value; - // Using a local certificate. - //var certificate = X509Certificate2.CreateFromPemFile(@"{Pem file path}"); - - // MSAL certificate auth. - services.AddSingleton( - serviceProvider => ConfidentialClientApplicationBuilder.Create(_configuration["MicrosoftAppId"]) - .WithCertificate(certificate, sendX5C) - .Build()); - - // MSAL credential factory: regardless of secret, cert or custom auth, need to add the line below to enable MSAL. - services.AddSingleton(); + // Register CertificateServiceClientCredentialsFactory + services.AddSingleton( + new CertificateServiceClientCredentialsFactory(certificate, _configuration["MicrosoftAppId"], _configuration["MicrosoftAppTenantId"], null, null, sendX5C)); // Create the Bot Framework Authentication to be used with the Bot Adapter. services.AddSingleton(); @@ -65,15 +65,6 @@ public void ConfigureServices(IServiceCollection services) // Create the Bot Adapter with error handling enabled. services.AddSingleton(); - // Create the storage we'll be using for User and Conversation state. (Memory is great for testing purposes.) - services.AddSingleton(); - - // Create the User state. (Used in this bot's Dialog implementation.) - services.AddSingleton(); - - // Create the Conversation state. (Used by the Dialog system itself.) - services.AddSingleton(); - // Create the bot as a transient. In this case the ASP Controller is expecting an IBot. services.AddTransient(); } @@ -93,8 +84,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { endpoints.MapControllers(); }); - - // app.UseHttpsRedirection(); } } }