You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-add-openai-text-completion.md
+15-10Lines changed: 15 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,10 @@ Use these steps to grant access in your new Azure OpenAI resource to these ident
95
95
96
96
1. Select **Add** > **Add role assignment**.
97
97
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**
99
102
100
103
1. On the **Members** tab, select **Assign access to** > **Managed identity** then **Select members**.
101
104
@@ -107,11 +110,11 @@ Use these steps to grant access in your new Azure OpenAI resource to these ident
107
110
108
111
1. Choose your Azure account used during local development and then **Select** > **Review + assign**.
109
112
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.
111
114
112
115
### [Azure CLI](#tab/azure-cli)
113
116
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:
115
118
116
119
```azurecli
117
120
# 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
120
123
# Get the fully-qualified ID of the Azure OpenAI resource.
121
124
openaiId=$(az cognitiveservices account show --name `<OPENAI_RESOURCE_NAME>` \
az role assignment create --assignee $principalId \
130
+
--role "Azure AI User" --scope $openaiId
126
131
```
127
132
128
133
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.
129
134
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:
131
136
132
137
```azurecli
133
138
# Get your current Azure account ID.
134
139
accountId=$(az ad signed-in-user show --query id -o tsv)
135
140
# Add your current Azure account to the 'Cognitive Services OpenAI User' role.
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:
361
368
362
369
1. In the **App settings** tab, select **+ Add**, and then enter the **Name** and **Value** of the new key-value pair, and select **Apply**.
363
370
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**.
365
372
366
373
### [Azure CLI](#tab/azure-cli)
367
374
368
375
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.
369
376
370
377
```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> \
0 commit comments