diff --git a/packages/fx-core/templates/plugins/resource/aad/auth/bot/README.txt b/packages/fx-core/templates/plugins/resource/aad/auth/bot/README.txt index b5147f9db5..7ac73e53bc 100644 --- a/packages/fx-core/templates/plugins/resource/aad/auth/bot/README.txt +++ b/packages/fx-core/templates/plugins/resource/aad/auth/bot/README.txt @@ -11,7 +11,7 @@ Files generated/updated in your project 2. Update file - 'templates/appPackage/manifest.template.json' - An `webApplicationInfo` object will be added into your Teams app manifest template. This field is required by Teams when enabling SSO. | 3. New file - `Auth/bot` - - Sample code, redirect pages and a `README.md` file. These files are provided for reference. See below for more information. | + - Sample code, redirect pages and a `README.txt` file. These files are provided for reference. See below for more information. | 4. Update file - 'appsettings.json' and 'appsettings.Development.json' - Configs that will be used by TeamsFx SDK will be added into your app settings. Please update add the 'TeamsFx' object if you have other appsettings files. diff --git a/packages/fx-core/templates/plugins/resource/webapp/bicep/webappConfiguration.template.bicep b/packages/fx-core/templates/plugins/resource/webapp/bicep/webappConfiguration.template.bicep index e082db67c6..c4426b7402 100644 --- a/packages/fx-core/templates/plugins/resource/webapp/bicep/webappConfiguration.template.bicep +++ b/packages/fx-core/templates/plugins/resource/webapp/bicep/webappConfiguration.template.bicep @@ -7,17 +7,19 @@ param provisionOutputs object param currentAppSettings object var webappName = split(provisionOutputs.webappOutput.value.webappResourceId, '/')[8] +{{#if (contains "fx-resource-aad-app-for-teams" plugins)}} var m365ClientId = provisionParameters['m365ClientId'] -{{#if (contains "fx-resource-key-vault" plugins)}} + {{#if (contains "fx-resource-key-vault" plugins)}} var m365ClientSecret = \{{fx-resource-key-vault.References.m365ClientSecretReference}} -{{else}} + {{else}} var m365ClientSecret = provisionParameters['m365ClientSecret'] -{{/if}} + {{/if}} var m365TenantId = provisionParameters['m365TenantId'] var m365OauthAuthorityHost = provisionParameters['m365OauthAuthorityHost'] var oauthAuthority = uri(m365OauthAuthorityHost, m365TenantId) -var webappEndpoint = provisionOutputs.webappOutput.value.endpoint var initiateLoginEndpoint = uri(webappEndpoint, 'auth-start.html') +{{/if}} +var webappEndpoint = provisionOutputs.webappOutput.value.endpoint {{#if (contains "fx-resource-bot" plugins) }} var botAadAppClientId = provisionParameters['botAadAppClientId'] {{#if (contains "fx-resource-key-vault" plugins) }} @@ -31,10 +33,12 @@ resource appSettings 'Microsoft.Web/sites/config@2021-02-01' = { name: '${webappName}/appsettings' properties: union({ TAB_APP_ENDPOINT: webappEndpoint + {{#if (contains "fx-resource-aad-app-for-teams" plugins)}} TeamsFx__Authentication__ClientId: m365ClientId TeamsFx__Authentication__ClientSecret: m365ClientSecret TeamsFx__Authentication__InitiateLoginEndpoint: initiateLoginEndpoint TeamsFx__Authentication__OAuthAuthority: oauthAuthority + {{/if}} {{#if (contains "fx-resource-bot" plugins) }} BOT_ID: botAadAppClientId BOT_PASSWORD: botAadAppClientSecret diff --git a/packages/fx-core/tests/plugins/resource/dotnet/unit/arm.test.ts b/packages/fx-core/tests/plugins/resource/dotnet/unit/arm.test.ts index 604961e4da..eabbfe9608 100644 --- a/packages/fx-core/tests/plugins/resource/dotnet/unit/arm.test.ts +++ b/packages/fx-core/tests/plugins/resource/dotnet/unit/arm.test.ts @@ -101,8 +101,8 @@ var m365ClientSecret = provisionParameters['m365ClientSecret'] var m365TenantId = provisionParameters['m365TenantId'] var m365OauthAuthorityHost = provisionParameters['m365OauthAuthorityHost'] var oauthAuthority = uri(m365OauthAuthorityHost, m365TenantId) -var webappEndpoint = provisionOutputs.webappOutput.value.endpoint var initiateLoginEndpoint = uri(webappEndpoint, 'auth-start.html') +var webappEndpoint = provisionOutputs.webappOutput.value.endpoint resource appSettings 'Microsoft.Web/sites/config@2021-02-01' = { name: '\${webappName}/appsettings'