Skip to content

Commit

Permalink
refactor: add a new env variable for the tab valid domain
Browse files Browse the repository at this point in the history
  • Loading branch information
huimiu committed Jun 11, 2024
1 parent b153bc3 commit ca750e6
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion developer-assist-dashboard/appPackage/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"messageTeamMembers"
],
"validDomains": [
"${{TAB_DOMAIN}}"
"${{TAB_HOSTNAME}}"
],
"webApplicationInfo": {
"id": "${{AAD_APP_CLIENT_ID}}",
Expand Down
1 change: 1 addition & 0 deletions developer-assist-dashboard/infra/azure.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ resource functionStorage 'Microsoft.Storage/storageAccounts@2021-06-01' = {
// The output will be persisted in .env.{envName}. Visit https://aka.ms/teamsfx-actions/arm-deploy for more details.
output TAB_AZURE_STORAGE_RESOURCE_ID string = storage.id // used in deploy stage
output TAB_DOMAIN string = siteDomain
output TAB_HOSTNAME string = siteDomain
output TAB_ENDPOINT string = tabEndpoint
output API_FUNCTION_ENDPOINT string = apiEndpoint
output API_FUNCTION_RESOURCE_ID string = functionApp.id
5 changes: 3 additions & 2 deletions developer-assist-dashboard/teamsapp.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ provision:
writeToEnvironmentFile:
teamsAppId: TEAMS_APP_ID

- uses: script # Set TAB_DOMAIN and TAB_ENDPOINT for local launch
- uses: script # Set required variables for local launch
with:
run:
echo "::set-teamsfx-env TAB_DOMAIN=localhost";
echo "::set-teamsfx-env TAB_HOSTNAME=localhost";
echo "::set-teamsfx-env TAB_DOMAIN=localhost:53000";
echo "::set-teamsfx-env TAB_ENDPOINT=https://localhost:53000";
echo "::set-teamsfx-env FUNC_NAME=callService";
echo "::set-teamsfx-env FUNC_ENDPOINT=http://localhost:7071";
Expand Down
2 changes: 1 addition & 1 deletion hello-world-bot-with-tab/appPackage/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"messageTeamMembers"
],
"validDomains": [
"${{TAB_DOMAIN}}",
"${{TAB_HOSTNAME}}",
"${{BOT_DOMAIN}}"
],
"showLoadingIndicator": false
Expand Down
1 change: 1 addition & 0 deletions hello-world-bot-with-tab/infra/azure.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ var siteDomain = replace(replace(storage.properties.primaryEndpoints.web, 'https
// The output will be persisted in .env.{envName}. Visit https://aka.ms/teamsfx-actions/arm-deploy for more details.
output TAB_AZURE_STORAGE_RESOURCE_ID string = storage.id // used in deploy stage
output TAB_DOMAIN string = siteDomain
output TAB_HOSTNAME string = siteDomain
output TAB_ENDPOINT string = 'https://${siteDomain}'
output BOT_AZURE_APP_SERVICE_RESOURCE_ID string = webApp.id
output BOT_DOMAIN string = webApp.properties.defaultHostName
6 changes: 4 additions & 2 deletions hello-world-bot-with-tab/teamsapp.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ provision:
channels:
- name: msteams

- uses: script # Set TAB_DOMAIN and TAB_ENDPOINT for local launch
- uses: script # Set required variables for local launch
with:
run: echo "::set-teamsfx-env TAB_DOMAIN=localhost";
run:
echo "::set-teamsfx-env TAB_HOSTNAME=localhost";
echo "::set-teamsfx-env TAB_DOMAIN=localhost:53000";
echo "::set-teamsfx-env TAB_ENDPOINT=https://localhost:53000";
# Validate using manifest schema
- uses: teamsApp/validateManifest
Expand Down
2 changes: 1 addition & 1 deletion hello-world-in-meeting/appPackage/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"messageTeamMembers"
],
"validDomains": [
"${{TAB_DOMAIN}}"
"${{TAB_HOSTNAME}}"
],
"showLoadingIndicator": false
}
1 change: 1 addition & 0 deletions hello-world-in-meeting/infra/azure.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ var siteDomain = replace(replace(storage.properties.primaryEndpoints.web, 'https
// The output will be persisted in .env.{envName}. Visit https://aka.ms/teamsfx-actions/arm-deploy for more details.
output TAB_AZURE_STORAGE_RESOURCE_ID string = storage.id // used in deploy stage
output TAB_DOMAIN string = siteDomain
output TAB_HOSTNAME string = siteDomain
output TAB_ENDPOINT string = 'https://${siteDomain}'
5 changes: 3 additions & 2 deletions hello-world-in-meeting/teamsapp.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ provision:
writeToEnvironmentFile:
teamsAppId: TEAMS_APP_ID

- uses: script # Set TAB_DOMAIN and TAB_ENDPOINT for local launch
- uses: script # Set required variables for local launch
with:
run:
echo "::set-teamsfx-env TAB_DOMAIN=localhost";
echo "::set-teamsfx-env TAB_HOSTNAME=localhost";
echo "::set-teamsfx-env TAB_DOMAIN=localhost:53000";
echo "::set-teamsfx-env TAB_ENDPOINT=https://localhost:53000";
# Validate using manifest schema
- uses: teamsApp/validateManifest
Expand Down
2 changes: 1 addition & 1 deletion team-central-dashboard/appPackage/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"messageTeamMembers"
],
"validDomains": [
"${{TAB_DOMAIN}}"
"${{TAB_HOSTNAME}}"
],
"webApplicationInfo": {
"id": "${{AAD_APP_CLIENT_ID}}",
Expand Down
1 change: 1 addition & 0 deletions team-central-dashboard/infra/azure.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ resource functionStorage 'Microsoft.Storage/storageAccounts@2021-06-01' = {
// The output will be persisted in .env.{envName}. Visit https://aka.ms/teamsfx-actions/arm-deploy for more details.
output TAB_AZURE_STORAGE_RESOURCE_ID string = storage.id // used in deploy stage
output TAB_DOMAIN string = siteDomain
output TAB_HOSTNAME string = siteDomain
output TAB_ENDPOINT string = tabEndpoint
output API_FUNCTION_ENDPOINT string = apiEndpoint
output API_FUNCTION_RESOURCE_ID string = functionApp.id
3 changes: 2 additions & 1 deletion team-central-dashboard/teamsapp.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ provision:
- uses: script # Set required variables for local launch
with:
run:
echo "::set-teamsfx-env TAB_DOMAIN=localhost";
echo "::set-teamsfx-env TAB_HOSTNAME=localhost";
echo "::set-teamsfx-env TAB_DOMAIN=localhost:53000";
echo "::set-teamsfx-env TAB_ENDPOINT=https://localhost:53000";
echo "::set-teamsfx-env FUNC_NAME=callGraph";
echo "::set-teamsfx-env FUNC_ENDPOINT=http://localhost:7071";
Expand Down

0 comments on commit ca750e6

Please sign in to comment.