Skip to content
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

Clarify requirements before deploying to Azure #291

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
75 changes: 38 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -73,7 +73,7 @@ You will need the following items to run the sample:

```bash
cd <path to chat-copilot>/scripts/
```
```

**Ubuntu/Debian Linux**

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.

Expand All @@ -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

Expand All @@ -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

Expand Down