Skip to content

Commit 848fc69

Browse files
committed
in-process
1 parent 1aa293a commit 848fc69

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

articles/azure-functions/functions-add-openai-text-completion.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ Use these steps to grant access in your new Azure OpenAI resource to these ident
9595
9696
1. Select **Add** > **Add role assignment**.
9797
98-
1. On the **Role** tab on the next screen, search for and select **Cognitive Services OpenAI User** and then select **Next**.
98+
1. On the **Role** tab on the next screen, search for and select these two roles and then select **Next**:
99+
100+
+ **Cognitive Services OpenAI User**
101+
+ **Azure AI User**
99102
100103
1. On the **Members** tab, select **Assign access to** > **Managed identity** then **Select members**.
101104
@@ -107,11 +110,11 @@ Use these steps to grant access in your new Azure OpenAI resource to these ident
107110
108111
1. Choose your Azure account used during local development and then **Select** > **Review + assign**.
109112
110-
1. On the **Review + assign** tab, select **Review + assign** to assign the role.
113+
1. On the **Review + assign** tab, select **Review + assign** to assign the users to the roles.
111114
112115
### [Azure CLI](#tab/azure-cli)
113116
114-
1. Use the [`az role assignment create`](/cli/azure/role/assignment#az-role-assignment-create) command to add your user-assigned managed identity to the `Cognitive Services OpenAI User` role:
117+
1. Use the [`az role assignment create`](/cli/azure/role/assignment#az-role-assignment-create) command to add your user-assigned managed identity to the `Cognitive Services OpenAI User` and `Azure AI User` roles:
115118
116119
```azurecli
117120
# Get the principal ID for the user-assigned managed identity.
@@ -120,21 +123,25 @@ Use these steps to grant access in your new Azure OpenAI resource to these ident
120123
# Get the fully-qualified ID of the Azure OpenAI resource.
121124
openaiId=$(az cognitiveservices account show --name `<OPENAI_RESOURCE_NAME>` \
122125
--resource-group `<RESOURCE_GROUP>` --query "id" --output tsv)
123-
# Create the role assignment.
126+
# Create the role assignments.
124127
az role assignment create --assignee $principalId \
125128
--role "Cognitive Services OpenAI User" --scope $openaiId
129+
az role assignment create --assignee $principalId \
130+
--role "Azure AI User" --scope $openaiId
126131
```
127132
128133
In these commands, replace `<OPENAI_RESOURCE_NAME>` with the name of your new Azure OpenAI resource and `<RESOURCE_GROUP>` the resource group. The [`az identity show`](/cli/azure/identity#az-identity-show) and [`az cognitiveservices account show`](/cli/azure/cognitiveservices/account#az-cognitiveservices-account-show) commands are used to obtain the principal ID of the user-assigned managed identity and the fully-qualified ID of the Azure OpenAI resource, respectively.
129134
130-
1. Use the [`az role assignment create`](/cli/azure/role/assignment#az-role-assignment-create) command again to create the same role assignment for your Azure account, so you can connect during local development:
135+
1. Use the [`az role assignment create`](/cli/azure/role/assignment#az-role-assignment-create) command again to create the same role assignments for your Azure account, so you can connect during local development:
131136
132137
```azurecli
133138
# Get your current Azure account ID.
134139
accountId=$(az ad signed-in-user show --query id -o tsv)
135140
# Add your current Azure account to the 'Cognitive Services OpenAI User' role.
136141
az role assignment create --assignee $accountId \
137142
--role "Cognitive Services OpenAI User" --scope $openaiId
143+
az role assignment create --assignee $accountId \
144+
--role "Azure AI User" --scope $openaiId
138145
```
139146
140147
The [`az ad signed-in-user show`](/cli/azure/ad/signed-in-user#az-ad-signed-in-user-show) command is used to obtain your Azure account ID. This code reuses `$openaiId` from the previous step, which is the fully-qualified ID of the Azure OpenAI resource .
@@ -361,17 +368,15 @@ You can add these settings in one of these ways:
361368

362369
1. In the **App settings** tab, select **+ Add**, and then enter the **Name** and **Value** of the new key-value pair, and select **Apply**.
363370

364-
1. Repeat the previous step to add all of the required settings, and then select **Apply**.
371+
1. Repeat the previous step to add all of the required settings, and then select **Apply** > **Confirm**.
365372

366373
### [Azure CLI](#tab/azure-cli)
367374

368375
The [`az functionapp config appsettings set`](/cli/azure/functionapp/config/appsettings#az-functionapp-config-appsettings-set) command adds or updates application settings in your function app.
369376

370377
```azurecli-interactive
371-
az functionapp config appsettings set \
372-
--name <APP_NAME> \
373-
--resource-group <RESOURCE_GROUP_NAME> \
374-
--settings \
378+
az functionapp config appsettings set --name <APP_NAME> \
379+
--resource-group <RESOURCE_GROUP_NAME> --settings \
375380
AzureOpenAI__endpoint=https://<OPENAI_RESOURCE_NAME>.search.windows.net \
376381
AzureOpenAI__credential=managedidentity \
377382
AzureOpenAI__managedIdentityResourceId=<USER_RESOURCE_ID> \

0 commit comments

Comments
 (0)