Skip to content

feat: Down merge from dev & resolved conflicts #1826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 12 additions & 37 deletions docs/azure_app_service_auth_setup.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,33 @@
# Set Up Authentication in Azure App Service

This document provides step-by-step instructions to configure Azure App Registrations for a front-end application.

## Prerequisites

- Access to **Microsoft Entra ID**
- Necessary permissions to create and manage **App Registrations**

## Step 1: Add Authentication in Azure App Service configuration

1. Click on `Authentication` from left menu.

![Authentication](images/AppAuthentication.png)

2. Click on `+ Add Provider` to see a list of identity providers.
2. Click on `+ Add identity provider` to see a list of identity providers.

![Authentication Identity](images/AppAuthenticationIdentity.png)

3. Click on `+ Add Provider` to see a list of identity providers.
3. Click on `Identity Provider` dropdown to see a list of identity providers.

![Add Provider](images/AppAuthIdentityProvider.png)

4. Select the first option `Microsoft Entra Id` from the drop-down list. If `Create new app registration` is disabled, go to [Step 1a](#step-1a-creating-a-new-app-registration).
4. Select the first option `Microsoft Entra Id` from the drop-down list and select `client secret expiration` under App registration.
> NOTE: If `Create new app registration` is disabled, then go to [Create new app registration](/docs/create_new_app_registration.md) and come back to this step to complete the app authentication.

![Add Provider](images/AppAuthIdentityProviderAdd.png)

5. Accept the default values and click on `Add` button to go back to the previous page with the identify provider added.

![Add Provider](images/AppAuthIdentityProviderAdded.png)

### Step 1a: Creating a new App Registration

1. Click on `Home` and select `Microsoft Entra ID`.

![Microsoft Entra ID](images/MicrosoftEntraID.png)

2. Click on `App registrations`.

![App registrations](images/Appregistrations.png)

3. Click on `+ New registration`.

![New Registrations](images/NewRegistration.png)

4. Provide the `Name`, select supported account types as `Accounts in this organizational directory only(Contoso only - Single tenant)`, select platform as `Web`, enter/select the `URL` and register.

![Add Details](images/AddDetails.png)

5. After application is created sucessfully, then click on `Add a Redirect URL`.

![Redirect URL](images/AddRedirectURL.png)

6. Click on `+ Add a platform`.

![+ Add platform](images/AddPlatform.png)

7. Click on `Web`.

![Web](images/Web.png)

8. Enter the `web app URL` (Provide the app service name in place of XXXX) and Save. Then go back to [Step 1](#step-1-add-authentication-in-azure-app-service-configuration) and follow from _Point 4_ choose `Pick an existing app registration in this directory` from the Add an Identity Provider page and provide the newly registered App Name.
E.g. https://appservicename.azurewebsites.net/.auth/login/aad/callback

![Add Details](images/WebAppURL.png)
6. You have successfully added app authentication, and now required to log in to access the application.
35 changes: 35 additions & 0 deletions docs/create_new_app_registration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Creating a new App Registration

1. Click on `Home` and select `Microsoft Entra ID`.

![Microsoft Entra ID](images/MicrosoftEntraID.png)

2. Click on `App registrations`.

![App registrations](images/Appregistrations.png)

3. Click on `+ New registration`.

![New Registrations](images/NewRegistration.png)

4. Provide the `Name`, select supported account types as `Accounts in this organizational directory only(Contoso only - Single tenant)`, select platform as `Web`, enter/select the `URL` and register.

![Add Details](images/AddDetails.png)

5. After application is created successfully, then click on `Add a Redirect URL`.

![Redirect URL](images/AddRedirectURL.png)

6. Click on `+ Add a platform`.

![+ Add platform](images/AddPlatform.png)

7. Click on `Web`.

![Web](images/Web.png)

8. Enter the `web app URL` (Provide the app service name in place of XXXX) and Save. Then go back to [Set Up Authentication in Azure App Service](/docs/azure_app_service_auth_setup.md) Step 1 page and follow from _Point 4_ choose `Pick an existing app registration in this directory` from the Add an Identity Provider page and provide the newly registered App Name.

E.g. <<https://<< appservicename >>.azurewebsites.net/.auth/login/aad/callback>>

![Add Details](images/WebAppURL.png)
Binary file modified docs/images/AppAuthIdentityProvider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/AppAuthIdentityProviderAdd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/AppAuthIdentityProviderAdded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/AppAuthentication.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/AppAuthenticationIdentity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion infra/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -12297,4 +12297,4 @@
"value": "[variables('semanticKernelSystemPrompt')]"
}
}
}
}
71 changes: 71 additions & 0 deletions tests/e2e-test/tests/test_poc_chat_with_your_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import logging

from config.constants import *
from pages.adminPage import AdminPage
from pages.webUserPage import WebUserPage

logger = logging.getLogger(__name__)


def test_golden_path_web_page_demo_script(login_logout):
"""Validate Golden path test case for Chat with your Data"""
page = login_logout
page.goto(ADMIN_URL)
logger.info("Step 1: Validate Admin page is loaded.")
admin_page = AdminPage(page)
assert (
admin_page_title == page.locator(admin_page.ADMIN_PAGE_TITLE).text_content()
), "page title not found"
logger.info("Step 2: Validate Files are uploaded or not")
admin_page.click_delete_data_tab()
assert (
page.locator(admin_page.DELETE_CHECK_BOXES).count() >= 1
), "Files are not uploaded."
logger.info("Step 3: Validate Web page is loaded.")
page.goto(WEB_URL)
home_page = WebUserPage(page)
logger.info("Step 5: Validate Chat history has been deleted.")
home_page.delete_chat_history()

failed_questions = []
logger.info("Step 6: Validate Golden Path prompts response")

def ask_question_and_check(question, attempt):
home_page.wait_for_load(4000)
home_page.enter_a_question(question)
home_page.click_send_button()
home_page.validate_response_status(question)

response_text = page.locator(home_page.ANSWER_TEXT)
response_count = response_text.count()

if response_count == 0:
return False # no response found

response_text_content = response_text.nth(response_count - 1).text_content()

if response_text_content == invalid_response:
print(f"[Attempt {attempt}] Invalid response for prompt: {question}")
return False
return True

# First run through all questions
for question in questions:
if not ask_question_and_check(question, attempt=1):
failed_questions.append(question)

# Retry failed questions once more
if failed_questions:
logger.info("Step 7: Retry failed question one more time.")
for question in failed_questions:
if not ask_question_and_check(question, attempt=2):
home_page.soft_assert(
False,
f"Failed after retry- Invalid response for prompt: {question}",
)

logger.info("Step 8: Validate chat history.")
home_page.show_chat_history()
logger.info("Step 9: Validate chat history closed.")
home_page.close_chat_history()
home_page.assert_all()