Skip to content

Commit

Permalink
more details on azure config
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jun 14, 2024
1 parent c0a2623 commit f912bc2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
32 changes: 23 additions & 9 deletions docs/src/content/docs/getting-started/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,19 @@ You can use a managed identity (recommended) or a API key to authenticate with t

<li>

Open your [Azure OpenAI resource](https://portal.azure.com) and navigate to **Resource Management**, then **Keys and Endpoint**.
Open your [Azure OpenAI resource](https://portal.azure.com)

</li>
<li>

Navigate to **Access Control**, then **View My Access**. Make sure your
user or service principal has the **Cognitive Services OpenAI User/Contributor** role.
If you get a `401` error, it's typically here that you will fix it.

</li>
<li>
Navigate to **Resource Management**, then **Keys and Endpoint**.
</li>
<li>

Update the `.env` file with the endpoint.
Expand Down Expand Up @@ -192,20 +201,25 @@ script({
```

</li>
</ol>

<li>
</Steps>

If you are using the command line, you will need to [login with the Azure CLI](https://learn.microsoft.com/en-us/javascript/api/overview/azure/identity-readme?view=azure-node-latest#authenticate-via-the-azure-cli).
#### Visual Studio Code

```sh
az login
```
Visual Studio Code will ask you to allow using the **Microsoft** account
and then will open a browser where you can choose the user or service principal.

</li>
- If you are getting `401` errors after a while, try signing out in the user menu (lower left in Visual Studio Code) and back in.

</ol>
#### CLI

</Steps>
Login with [Azure CLI](https://learn.microsoft.com/en-us/javascript/api/overview/azure/identity-readme?view=azure-node-latest#authenticate-via-the-azure-cli)
then use the [cli](/genaiscript/reference/cli) as usual.

```sh
az login
```

### API Key

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const MAX_TOOL_CALLS = 100
export const AZURE_OPENAI_API_VERSION = "2024-02-01"
export const AZURE_OPENAI_TOKEN_SCOPES = Object.freeze([
"https://cognitiveservices.azure.com/.default",
// "offline_access",
"offline_access",
])
export const TOOL_ID = "genaiscript"
export const GENAISCRIPT_FOLDER = "." + TOOL_ID
Expand Down

0 comments on commit f912bc2

Please sign in to comment.