Sample readme updates + Ignoring .env files (#41)

### Motivation and Context

It is generally recommended to add .env files to .gitignore for public
repositories.

`.env` files often contain sensitive information such as access keys,
passwords, and other credentials that should not be shared publicly.
Including these files in the repository, could potentially lead to
security risks.

`launchSettings.json` was added and included as part of the ignore for
the same reasons above as it contains environment definitions which can
contain sensitive information.

Small `auth-api-webapp-react` sample readme improvements.
Add `lauchSettings.json` to `kernel-syntax-examples` sample.

### Description 

To avoid any problem I added `env.development` files with original
template content and added an extra step into the samples readme
following the same language used the first step in `graph-api-skills`
sample regarding the `appsettings.Development.json` file.

Improved `auth-api-webapp-react` readme and added a troubleshooting
section for clarity.

---------

Co-authored-by: Shawn Callegari <[email protected]>
This commit is contained in:
Roger Barreto
2023-03-15 18:57:02 -07:00
committed by GitHub
co-authored by Shawn Callegari
parent 914ae553c0
commit ed5d641d4b
5 changed files with 34 additions and 8 deletions
+2 -1
View File
@@ -409,7 +409,8 @@ FodyWeavers.xsd
*.crt
*.key
.env
launchSettings.json
appsettings.development.json
testsettings.development.json
config.development.yaml
+13 -3
View File
@@ -12,14 +12,14 @@
1. You will need an [Open AI Key](https://openai.com/api/) or
[Azure Open AI Service key](https://learn.microsoft.com/azure/cognitive-services/openai/quickstart)
for this sample
2. Ensure the service API is already running `http://localhost:7071`. If not learn
how to start it [here](../../dotnet/KernelHttpServer/README.md).
2. Ensure the KernelHttpServer sample is already running at `http://localhost:7071`. If not, follow the steps
to start it [here](../../dotnet/KernelHttpServer/README.md).
3. You will also need to
[register your application](https://learn.microsoft.com/azure/active-directory/develop/quickstart-register-app)
in the Azure Portal. Follow the steps to register your app
[here](https://learn.microsoft.com/azure/active-directory/develop/quickstart-register-app).
- Select **`Single-page application (SPA)`** as platform type, and the Redirect URI will be **`http://localhost:3000`**
- It is recommended you use the **`Personal Microsoft accounts`** account type for this sample.
- Select **`Personal Microsoft accounts only`** as supported account types for this sample
4. Once registered, copy the **Application (client) ID** from the Azure Portal and paste
the GUID into the **[.env](.env)** file next to `REACT_APP_GRAPH_CLIENT_ID=` (first line of the .env file).
5. **Run** the following command `yarn install` (if you have never run the sample before)
@@ -39,3 +39,13 @@ Each function will call Microsoft Graph and/or Open AI to perform the tasks.
> [!CAUTION]
> Each function will call Open AI which will use tokens that you will be billed for.
## Troubleshooting
### unauthorized_client: The client does not exist or is not enabled for consumers.
1. Ensure in your Application Manifest that **`Personal Microsoft accounts`** are allowed to sign in.
- `"signInAudience": "PersonalMicrosoftAccount"` or
- `"signInAudience": "AzureADandPersonalMicrosoftAccount"`
2. If you are not able to change the manifest, create a new Application following the instructions in [Running the sample](#running-the-sample), step 3.
@@ -12,8 +12,8 @@
1. You will need an [Open AI Key](https://openai.com/api/) or
[Azure Open AI Service key](https://learn.microsoft.com/azure/cognitive-services/openai/quickstart)
for this sample.
2. Ensure the service API is already running `http://localhost:7071`. If not learn
how to start it [here](../../dotnet/KernelHttpServer/README.md).
2. Ensure the KernelHttpServer sample is already running at `http://localhost:7071`. If not, follow the steps
to start it [here](../../dotnet/KernelHttpServer/README.md).
3. **Run** the following command `yarn install` (if you have never run the sample before)
and/or `yarn start` from the command line.
4. A browser will automatically open, otherwise you can navigate to `http://localhost:3000` to use the sample.
@@ -12,8 +12,8 @@ Watch the [Chat Summary Quick Start Video](https://aka.ms/SK-Samples-SimChat-Vid
1. You will need an [Open AI Key](https://openai.com/api/) or
[Azure Open AI Service key](https://learn.microsoft.com/azure/cognitive-services/openai/quickstart)
for this sample.
2. Ensure the service API is already running `http://localhost:7071`. If not learn
how to start it [here](../../dotnet/KernelHttpServer/README.md).
2. Ensure the KernelHttpServer sample is already running at `http://localhost:7071`. If not, follow the steps
to start it [here](../../dotnet/KernelHttpServer/README.md).
3. **Run** the following command `yarn install` (if you have never run the sample before)
and/or `yarn start` from the command line.
4. A browser will automatically open, otherwise you can navigate to `http://localhost:3000` to use the sample.
@@ -0,0 +1,15 @@
{
"profiles": {
"KernelSyntaxExamples": {
"commandName": "Project",
"environmentVariables": {
"BING_API_KEY": "",
"OPENAI_API_KEY": "",
"AZURE_OPENAI_DEPLOYMENT_LABEL": "azure-text-davinci-002",
"AZURE_OPENAI_DEPLOYMENT_NAME": "text-davinci-002",
"AZURE_OPENAI_ENDPOINT": "",
"AZURE_OPENAI_KEY": ""
}
}
}
}