From d2c6aae9ddda89472db259f36318f74ec6128cd9 Mon Sep 17 00:00:00 2001 From: Ben Thomas Date: Fri, 1 Sep 2023 08:11:00 -0700 Subject: [PATCH] Adding text to clarify that th requirements still need to be met before deploying to Azure. --- README.md | 75 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 1f9915540..94dc9dfb8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This sample allows you to build your own integrated large language model (LLM) chat copilot. The sample is built on Microsoft [Semantic Kernel](https://github.com/microsoft/semantic-kernel) and has two components: a frontend [React web app](./webapp/) and a backend [.NET web API service](./webapi/). -These quick-start instructions run the sample locally. To deploy the sample to Azure, please view [Deploying Chat Copilot](./scripts/deploy/README.md). +These quick-start instructions run the sample locally. To deploy the sample to Azure, please view [Deploying Chat Copilot](./scripts/deploy/README.md) after meeting the [requirements](#requirements) described below. > **IMPORTANT:** This sample is for educational purposes only and is not recommended for production deployments. @@ -73,7 +73,7 @@ You will need the following items to run the sample: ```bash cd /scripts/ - ``` + ``` **Ubuntu/Debian Linux** @@ -101,19 +101,17 @@ You will need the following items to run the sample: - `API_KEY`: The `API key` for OpenAI. - 2. For Azure OpenAI ```bash ./configure.sh --aiservice AzureOpenAI \ --endpoint {AZURE_OPENAI_ENDPOINT} \ - --apikey {API_KEY} + --apikey {API_KEY} ``` - `AZURE_OPENAI_ENDPOINT`: The Azure OpenAI resource `Endpoint` address. - `API_KEY`: The `API key` for Azure OpenAI. - **IMPORTANT:** If you deployed models `gpt-35-turbo` and `text-embedding-ada-002` with custom names (instead of each own's given name), you need to specify the deployment names with three additional parameters: @@ -149,12 +147,13 @@ By default, Chat Copilot runs locally without authentication, using a guest user ### Instructions 1. Create an [application registration](https://learn.microsoft.com/azure/active-directory/develop/quickstart-register-app) for the frontend web app, using the values below - - `Supported account types`: "_Accounts in this organizational directory only ({YOUR TENANT} only - Single tenant)_" - - `Redirect URI (optional)`: _Single-page application (SPA)_ and use _http://localhost:3000_. + + - `Supported account types`: "_Accounts in this organizational directory only ({YOUR TENANT} only - Single tenant)_" + - `Redirect URI (optional)`: _Single-page application (SPA)_ and use _http://localhost:3000_. 2. Create a second [application registration](https://learn.microsoft.com/azure/active-directory/develop/quickstart-register-app) for the backend web api, using the values below: - - `Supported account types`: "_Accounts in this organizational directory only ({YOUR TENANT} only - Single tenant)_" - - Do **not** configure a `Redirect URI (optional)` + - `Supported account types`: "_Accounts in this organizational directory only ({YOUR TENANT} only - Single tenant)_" + - Do **not** configure a `Redirect URI (optional)` > NOTE: Other account types can be used to allow multitenant and personal Microsoft accounts to use your application if you desire. Doing so may result in more users and therefore higher costs. @@ -181,15 +180,16 @@ By default, Chat Copilot runs locally without authentication, using a guest user 4. Set _Admin consent display name_ and _User consent display name_ to `Access copilot chat as a user` 5. Set _Admin consent description_ and _User consent description_ to `Allows the accesses to the Copilot chat web API as a user` - + 4. Add the web app frontend as an authorized client application - 1. Click *Add a client application* - 2. For *Client ID*, enter the frontend's application (client) ID + 1. Click _Add a client application_ - 3. Check the checkbox under *Authorized scopes* + 2. For _Client ID_, enter the frontend's application (client) ID - 4. Click *Add application* + 3. Check the checkbox under _Authorized scopes_ + + 4. Click _Add application_ 4. Add permissions to web app frontend to access web api as user @@ -209,38 +209,39 @@ By default, Chat Copilot runs locally without authentication, using a guest user 5. Run the Configure script with additional parameters to set up authentication. - **Powershell** + **Powershell** - ```powershell - .\Configure.ps1 -AiService {AI_SERVICE} -APIKey {API_KEY} -Endpoint {AZURE_OPENAI_ENDPOINT} -FrontendClientId {FRONTEND_APPLICATION_ID} -BackendClientId {BACKEND_APPLICATION_ID} -TenantId {TENANT_ID} -Instance {AZURE_AD_INSTANCE} - ``` + ```powershell + .\Configure.ps1 -AiService {AI_SERVICE} -APIKey {API_KEY} -Endpoint {AZURE_OPENAI_ENDPOINT} -FrontendClientId {FRONTEND_APPLICATION_ID} -BackendClientId {BACKEND_APPLICATION_ID} -TenantId {TENANT_ID} -Instance {AZURE_AD_INSTANCE} + ``` - **Bash** - ```bash - ./configure.sh --aiservice {AI_SERVICE} --apikey {API_KEY} --endpoint {AZURE_OPENAI_ENDPOINT} --frontend-clientid {FRONTEND_APPLICATION_ID} --backend-clientid {BACKEND_APPLICATION_ID} --tenantid {TENANT_ID} --instance {AZURE_AD_INSTANCE} - ``` + **Bash** + + ```bash + ./configure.sh --aiservice {AI_SERVICE} --apikey {API_KEY} --endpoint {AZURE_OPENAI_ENDPOINT} --frontend-clientid {FRONTEND_APPLICATION_ID} --backend-clientid {BACKEND_APPLICATION_ID} --tenantid {TENANT_ID} --instance {AZURE_AD_INSTANCE} + ``` - - `AI_SERVICE`: `AzureOpenAI` or `OpenAI`. - - `API_KEY`: The `API key` for Azure OpenAI or for OpenAI. - - `AZURE_OPENAI_ENDPOINT`: The Azure OpenAI resource `Endpoint` address. Omit `-Endpoint` if using OpenAI. - - `FRONTEND_APPLICATION_ID`: The `Application (client) ID` associated with the application registration for the frontend. - - `BACKEND_APPLICATION_ID`: The `Application (client) ID` associated with the application registration for the backend. - - `TENANT_ID` : Your Azure AD tenant ID - - `AZURE_AD_INSTANCE` _(optional)_: The Azure AD cloud instance for the authenticating users. Defaults to `https://login.microsoftonline.com`. + - `AI_SERVICE`: `AzureOpenAI` or `OpenAI`. + - `API_KEY`: The `API key` for Azure OpenAI or for OpenAI. + - `AZURE_OPENAI_ENDPOINT`: The Azure OpenAI resource `Endpoint` address. Omit `-Endpoint` if using OpenAI. + - `FRONTEND_APPLICATION_ID`: The `Application (client) ID` associated with the application registration for the frontend. + - `BACKEND_APPLICATION_ID`: The `Application (client) ID` associated with the application registration for the backend. + - `TENANT_ID` : Your Azure AD tenant ID + - `AZURE_AD_INSTANCE` _(optional)_: The Azure AD cloud instance for the authenticating users. Defaults to `https://login.microsoftonline.com`. 6. Run Chat Copilot locally. This step starts both the backend API and frontend application. - **Powershell** + **Powershell** - ```powershell - .\Start.ps1 - ``` + ```powershell + .\Start.ps1 + ``` - **Bash** + **Bash** - ```bash - ./start.sh - ``` + ```bash + ./start.sh + ``` # Troubleshooting