Skip to content

Commit

Permalink
Merge pull request #5936 from OfficeDev/bowsong/hot_fix
Browse files Browse the repository at this point in the history
fix(sso): update bicep for tab for dotnet
  • Loading branch information
adashen authored Aug 29, 2022
2 parents f33127b + db692dd commit 96865ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 96865ad

Please sign in to comment.