diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7640f2547..10d871321 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,15 +25,17 @@ jobs: AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZURE_PRINCIPAL_ID: ${{ secrets.AZURE_PRINCIPAL_ID }} - AZURE_PRINCIPAL_NAME: ${{ secrets.AZURE_PRINCIPAL_NAME }} - AZURE_PRINCIPAL_TYPE: 'ServicePrincipal' + PRINCIPAL_ID: ${{ secrets.PRINCIPAL_ID }} + PRINCIPAL_NAME: ${{ secrets.PRINCIPAL_NAME }} + PRINCIPAL_TYPE: 'ServicePrincipal' outputs: imageTag: ${{ steps.set-image-tag.outputs.imageTag }} web_url: ${{ steps.extract-urls.outputs.web_url }} admin_url: ${{ steps.extract-urls.outputs.admin_url }} DEPLOYMENT_SUCCESS: ${{ steps.final-status.outputs.DEPLOYMENT_SUCCESS }} + resource_group: ${{ steps.check_create_rg.outputs.RESOURCE_GROUP_NAME }} + solution_suffix: ${{ steps.generate_solution_prefix.outputs.SOLUTION_SUFFIX }} steps: - name: Checkout code @@ -206,9 +208,9 @@ jobs: DISABLE_AUTHENTICATION=true NO_AUTH=true SKIP_AUTH=true - AZURE_PRINCIPAL_ID - AZURE_PRINCIPAL_NAME - AZURE_PRINCIPAL_TYPE + PRINCIPAL_ID + PRINCIPAL_NAME + PRINCIPAL_TYPE - name: Extract URLs from deployment id: extract-urls @@ -401,9 +403,10 @@ jobs: AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZURE_ENV_NAME: ${{ github.run_id }} + AZURE_ENV_NAME: ${{ needs.deploy.outputs.solution_suffix }} # Get from deploy job AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} imageTag: ${{ needs.deploy.outputs.imageTag }} + AZURE_RESOURCE_GROUP: ${{ needs.deploy.outputs.resource_group }} steps: - name: Checkout code @@ -423,6 +426,7 @@ jobs: AZURE_SUBSCRIPTION_ID AZURE_ENV_NAME AZURE_LOCATION + AZURE_RESOURCE_GROUP - name: Send Notification on Failure if: failure() diff --git a/Makefile b/Makefile index 63a32c8e0..da9566de8 100644 --- a/Makefile +++ b/Makefile @@ -57,11 +57,6 @@ azd-login: ## ๐Ÿ”‘ Login to Azure with azd and a SPN @echo -e "\e[34m$@\e[0m" || true @azd auth login --client-id ${AZURE_CLIENT_ID} --client-secret ${AZURE_CLIENT_SECRET} --tenant-id ${AZURE_TENANT_ID} -azd-login: ## ๐Ÿ”‘ Login to Azure with azd and a SPN - @echo -e "\e[34m$@\e[0m" || true - @azd auth login --client-id ${AZURE_CLIENT_ID} --client-secret ${AZURE_CLIENT_SECRET} --tenant-id ${AZURE_TENANT_ID} - -# Fixed Makefile section for deploy target # Fixed Makefile section for deploy target deploy: azd-login ## Deploy everything to Azure @echo -e "\e[34m$@\e[0m" || true @@ -126,15 +121,10 @@ deploy: azd-login ## Deploy everything to Azure echo "$$PG_HOST_VAL" > pg_host.txt - - - @echo "=== PostgreSQL Configuration ===" - @echo "Username: admintest (hardcoded)" @echo "Database: postgres (hardcoded)" @echo "Port: 5432 (hardcoded)" @echo "Host: $$(cat pg_host.txt 2>/dev/null || echo 'Not available')" - @echo "Password: Initial_0524 (hardcoded)" # Helper target to check current authentication status check-auth: @@ -178,4 +168,5 @@ disable-auth-fixed: destroy: azd-login ## ๐Ÿงจ Destroy everything in Azure @echo -e "\e[34m$@\e[0m" || true + @azd env select $(AZURE_ENV_NAME) || true @azd down --force --purge --no-prompt diff --git a/docs/TEAMS_LOCAL_DEPLOYMENT.md b/docs/TEAMS_LOCAL_DEPLOYMENT.md index 8e62c37c3..ec5684c56 100644 --- a/docs/TEAMS_LOCAL_DEPLOYMENT.md +++ b/docs/TEAMS_LOCAL_DEPLOYMENT.md @@ -29,16 +29,21 @@ Or use the [Azure Functions VS Code extension](https://marketplace.visualstudio. 2. Open the file env\\.env.local 3. Locate the environment variable _AZURE_FUNCTION_URL_. -4. Replace the `` with your local Teams Backend URL (i.e., http://localhost:7071/api/GetConversationResponse) +4. Update the environment variables in the file with your local development URLs: + - Replace the `` placeholder with your local Teams Backend Function URL: `http://localhost:7071/api/GetConversationResponse` + - Set the `AZURE_APP_API_BASE_URL` to your local API URL: `http://127.0.0.1:5050/` + ```env AZURE_FUNCTION_URL=http://localhost:7071/api/GetConversationResponse + AZURE_APP_API_BASE_URL=http://127.0.0.1:5050/ ``` ![Env](images/teams-local-3.png) 5. Save the file. -6. Select Teams Toolkit from the navigation panel. -7. Verify your signed into O365 and Azure with sideloading enabled. -8. Select the "play" button next to Local. +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" +7. Select Teams Toolkit from the navigation panel. +8. Verify your signed into O365 and Azure with sideloading enabled. +9. Select the "play" button next to Local. ![Teams Toolkit](images/teams-local-2.png) diff --git a/infra/main.parameters.json b/infra/main.parameters.json index a83b0b8f3..98750ea5d 100644 --- a/infra/main.parameters.json +++ b/infra/main.parameters.json @@ -10,9 +10,9 @@ }, "principal": { "value": { - "id": "${AZURE_PRINCIPAL_ID}", - "name": "${AZURE_PRINCIPAL_NAME}", - "type": "${AZURE_PRINCIPAL_TYPE=User}" + "id": "${PRINCIPAL_ID}", + "name": "${PRINCIPAL_NAME}", + "type": "${PRINCIPAL_TYPE=User}" } }, "appEnvironment": { diff --git a/infra/main.waf.parameters.json b/infra/main.waf.parameters.json index 7d5423ca1..f23301f34 100644 --- a/infra/main.waf.parameters.json +++ b/infra/main.waf.parameters.json @@ -10,9 +10,9 @@ }, "principal": { "value": { - "id": "${AZURE_PRINCIPAL_ID}", - "name": "${AZURE_PRINCIPAL_NAME}", - "type": "${AZURE_PRINCIPAL_TYPE=User}" + "id": "${PRINCIPAL_ID}", + "name": "${PRINCIPAL_NAME}", + "type": "${PRINCIPAL_TYPE=User}" } }, "appEnvironment": {