Skip to content

Commit 9d4fa10

Browse files
Pavan-MicrosoftRoopan-MicrosoftAjitPadhi-Microsoftross-p-smithgpickett
authored
fix: Standardize principal variables, improve resource group handling, and enhance local Teams dev setup (#1925)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Roopan-Microsoft <[email protected]> Co-authored-by: Ajit Padhi <[email protected]> Co-authored-by: Roopan P M <[email protected]> Co-authored-by: Ross Smith <[email protected]> Co-authored-by: gpickett <[email protected]> Co-authored-by: Francia Riesco <[email protected]> Co-authored-by: Francia Riesco <[email protected]> Co-authored-by: Prajwal D C <[email protected]> Co-authored-by: Harmanpreet-Microsoft <[email protected]> Co-authored-by: UtkarshMishra-Microsoft <[email protected]> Co-authored-by: Priyanka-Microsoft <[email protected]> Co-authored-by: Prasanjeet-Microsoft <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kiran-Siluveru-Microsoft <[email protected]> Co-authored-by: Prashant-Microsoft <[email protected]> Co-authored-by: Rohini-Microsoft <[email protected]> Co-authored-by: Avijit-Microsoft <[email protected]> Co-authored-by: RaviKiran-Microsoft <[email protected]> Co-authored-by: Somesh Joshi <[email protected]> Co-authored-by: Himanshi Agrawal <[email protected]> Co-authored-by: pradeepjha-microsoft <[email protected]> Co-authored-by: Harmanpreet Kaur <[email protected]> Co-authored-by: Bangarraju-Microsoft <[email protected]> Co-authored-by: Harsh-Microsoft <[email protected]> Co-authored-by: Kanchan-Microsoft <[email protected]> Co-authored-by: Cristopher Coronado <[email protected]> Co-authored-by: Cristopher Coronado Moreira <[email protected]> Co-authored-by: Vamshi-Microsoft <[email protected]> Co-authored-by: Thanusree-Microsoft <[email protected]> Co-authored-by: Niraj Chaudhari (Persistent Systems Inc) <[email protected]> Co-authored-by: Rohini-Microsoft <[email protected]>
1 parent cba7632 commit 9d4fa10

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ jobs:
2525
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
2626
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
2727
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
28-
AZURE_PRINCIPAL_ID: ${{ secrets.AZURE_PRINCIPAL_ID }}
29-
AZURE_PRINCIPAL_NAME: ${{ secrets.AZURE_PRINCIPAL_NAME }}
30-
AZURE_PRINCIPAL_TYPE: 'ServicePrincipal'
28+
PRINCIPAL_ID: ${{ secrets.PRINCIPAL_ID }}
29+
PRINCIPAL_NAME: ${{ secrets.PRINCIPAL_NAME }}
30+
PRINCIPAL_TYPE: 'ServicePrincipal'
3131

3232
outputs:
3333
imageTag: ${{ steps.set-image-tag.outputs.imageTag }}
3434
web_url: ${{ steps.extract-urls.outputs.web_url }}
3535
admin_url: ${{ steps.extract-urls.outputs.admin_url }}
3636
DEPLOYMENT_SUCCESS: ${{ steps.final-status.outputs.DEPLOYMENT_SUCCESS }}
37+
resource_group: ${{ steps.check_create_rg.outputs.RESOURCE_GROUP_NAME }}
38+
solution_suffix: ${{ steps.generate_solution_prefix.outputs.SOLUTION_SUFFIX }}
3739

3840
steps:
3941
- name: Checkout code
@@ -206,9 +208,9 @@ jobs:
206208
DISABLE_AUTHENTICATION=true
207209
NO_AUTH=true
208210
SKIP_AUTH=true
209-
AZURE_PRINCIPAL_ID
210-
AZURE_PRINCIPAL_NAME
211-
AZURE_PRINCIPAL_TYPE
211+
PRINCIPAL_ID
212+
PRINCIPAL_NAME
213+
PRINCIPAL_TYPE
212214
213215
- name: Extract URLs from deployment
214216
id: extract-urls
@@ -401,9 +403,10 @@ jobs:
401403
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
402404
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
403405
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
404-
AZURE_ENV_NAME: ${{ github.run_id }}
406+
AZURE_ENV_NAME: ${{ needs.deploy.outputs.solution_suffix }} # Get from deploy job
405407
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
406408
imageTag: ${{ needs.deploy.outputs.imageTag }}
409+
AZURE_RESOURCE_GROUP: ${{ needs.deploy.outputs.resource_group }}
407410

408411
steps:
409412
- name: Checkout code
@@ -423,6 +426,7 @@ jobs:
423426
AZURE_SUBSCRIPTION_ID
424427
AZURE_ENV_NAME
425428
AZURE_LOCATION
429+
AZURE_RESOURCE_GROUP
426430
427431
- name: Send Notification on Failure
428432
if: failure()

Makefile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ azd-login: ## 🔑 Login to Azure with azd and a SPN
5757
@echo -e "\e[34m$@\e[0m" || true
5858
@azd auth login --client-id ${AZURE_CLIENT_ID} --client-secret ${AZURE_CLIENT_SECRET} --tenant-id ${AZURE_TENANT_ID}
5959

60-
azd-login: ## 🔑 Login to Azure with azd and a SPN
61-
@echo -e "\e[34m$@\e[0m" || true
62-
@azd auth login --client-id ${AZURE_CLIENT_ID} --client-secret ${AZURE_CLIENT_SECRET} --tenant-id ${AZURE_TENANT_ID}
63-
64-
# Fixed Makefile section for deploy target
6560
# Fixed Makefile section for deploy target
6661
deploy: azd-login ## Deploy everything to Azure
6762
@echo -e "\e[34m$@\e[0m" || true
@@ -126,15 +121,10 @@ deploy: azd-login ## Deploy everything to Azure
126121
echo "$$PG_HOST_VAL" > pg_host.txt
127122

128123

129-
130-
131-
132124
@echo "=== PostgreSQL Configuration ==="
133-
@echo "Username: admintest (hardcoded)"
134125
@echo "Database: postgres (hardcoded)"
135126
@echo "Port: 5432 (hardcoded)"
136127
@echo "Host: $$(cat pg_host.txt 2>/dev/null || echo 'Not available')"
137-
@echo "Password: Initial_0524 (hardcoded)"
138128

139129
# Helper target to check current authentication status
140130
check-auth:
@@ -178,4 +168,5 @@ disable-auth-fixed:
178168

179169
destroy: azd-login ## 🧨 Destroy everything in Azure
180170
@echo -e "\e[34m$@\e[0m" || true
171+
@azd env select $(AZURE_ENV_NAME) || true
181172
@azd down --force --purge --no-prompt

docs/TEAMS_LOCAL_DEPLOYMENT.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,21 @@ Or use the [Azure Functions VS Code extension](https://marketplace.visualstudio.
2929
2. Open the file env\\.env.local
3030
3. Locate the environment variable _AZURE_FUNCTION_URL_.
3131

32-
4. Replace the `<AZURE_FUNCTION_URL>` with your local Teams Backend URL (i.e., http://localhost:7071/api/GetConversationResponse)
32+
4. Update the environment variables in the file with your local development URLs:
33+
- Replace the `<AZURE_FUNCTION_URL>` placeholder with your local Teams Backend Function URL: `http://localhost:7071/api/GetConversationResponse`
34+
- Set the `AZURE_APP_API_BASE_URL` to your local API URL: `http://127.0.0.1:5050/`
35+
3336
```env
3437
AZURE_FUNCTION_URL=http://localhost:7071/api/GetConversationResponse
38+
AZURE_APP_API_BASE_URL=http://127.0.0.1:5050/
3539
```
3640
![Env](images/teams-local-3.png)
3741
3842
5. Save the file.
39-
6. Select Teams Toolkit from the navigation panel.
40-
7. Verify your signed into O365 and Azure with sideloading enabled.
41-
8. Select the "play" button next to Local.
43+
6. For local development, ensure that multitenant mode is enabled in the Teams extension. In `index.ts`, check that the `MicrosoftAppType` is set to "MultiTenant" instead of "SingleTenant"
44+
7. Select Teams Toolkit from the navigation panel.
45+
8. Verify your signed into O365 and Azure with sideloading enabled.
46+
9. Select the "play" button next to Local.
4247
4348
![Teams Toolkit](images/teams-local-2.png)
4449

infra/main.parameters.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
},
1111
"principal": {
1212
"value": {
13-
"id": "${AZURE_PRINCIPAL_ID}",
14-
"name": "${AZURE_PRINCIPAL_NAME}",
15-
"type": "${AZURE_PRINCIPAL_TYPE=User}"
13+
"id": "${PRINCIPAL_ID}",
14+
"name": "${PRINCIPAL_NAME}",
15+
"type": "${PRINCIPAL_TYPE=User}"
1616
}
1717
},
1818
"appEnvironment": {

infra/main.waf.parameters.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
},
1111
"principal": {
1212
"value": {
13-
"id": "${AZURE_PRINCIPAL_ID}",
14-
"name": "${AZURE_PRINCIPAL_NAME}",
15-
"type": "${AZURE_PRINCIPAL_TYPE=User}"
13+
"id": "${PRINCIPAL_ID}",
14+
"name": "${PRINCIPAL_NAME}",
15+
"type": "${PRINCIPAL_TYPE=User}"
1616
}
1717
},
1818
"appEnvironment": {

0 commit comments

Comments
 (0)