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/ai-services/openai/how-to/use-web-app.md
+53-7Lines changed: 53 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,26 +20,24 @@ Along with Azure OpenAI Studio, APIs, and SDKs, you can use the available standa
20
20
21
21
## Important considerations
22
22
23
-
- Publishing creates an Azure App Service instance in your subscription. It might incur costs depending on the [pricing plan](https://azure.microsoft.com/pricing/details/app-service/windows/) that you select. When you're done with your app, you can delete it from the Azure portal.
24
-
- GPT-4 Turbo with Vision models are not supported.
23
+
- Publishing creates an Azure App Service instance in your subscription. It might incur costs depending on the [pricing plan](https://azure.microsoft.com/pricing/details/app-service/windows/) that you select. When finished with your app, you can delete it from the Azure portal.
24
+
- GPT-4 Turbo with Vision models aren't supported.
25
25
- By default, the app is deployed with the Microsoft identity provider already configured. The identity provider restricts access to the app to members of your Azure tenant. To add or modify authentication:
26
26
1. Go to the [Azure portal](https://portal.azure.com/#home) and search for the app name that you specified during publishing. Select the web app, and then select **Authentication** on the left menu. Then select **Add identity provider**.
27
27
28
28
:::image type="content" source="../media/quickstarts/web-app-authentication.png" alt-text="Screenshot of the authentication pane in the Azure portal." lightbox="../media/quickstarts/web-app-authentication.png":::
29
29
30
30
1. Select Microsoft as the identity provider. The default settings on this page restrict the app to your tenant only, so you don't need to change anything else here. Select **Add**.
31
31
32
-
Now users will be asked to sign in with their Microsoft Entra account to access your app. You can follow a similar process to add another identity provider if you prefer. The app doesn't use the user's sign-in information in any way other than verifying that the user is a member of your tenant.
32
+
Now users are asked to sign in with their Microsoft Entra account to access your app. You can follow a similar process to add another identity provider if you prefer. The app doesn't use the user's sign-in information in any way other than verifying that the user is a member of your tenant.
33
33
34
34
## Web app customization
35
35
36
36
You can customize the app's front-end and back-end logic. The app provides several [environment variables](https://github.com/microsoft/sample-app-aoai-chatGPT#common-customization-scenarios-eg-updating-the-default-chat-logo-and-headers) for common customization scenarios such as changing the icon in the app.
37
37
38
38
When you're customizing the app, we recommend:
39
39
40
-
- Resetting the chat session (clear chat) if users change any settings. Notify the users that their chat history will be lost.
41
-
42
-
- Clearly communicating how each setting that you implement will affect the user experience.
40
+
- Clearly communicating how each setting that you implement affects the user experience.
43
41
44
42
- Updating the app settings for each of your deployed apps to use new API keys after you rotate keys for your Azure OpenAI or Azure AI Search resource.
45
43
@@ -82,7 +80,55 @@ After you turn on chat history, your users can show and hide it in the upper-rig
82
80
83
81
## Deleting your Cosmos DB instance
84
82
85
-
Deleting your web app does not delete your Cosmos DB instance automatically. To delete your Cosmos DB instance along with all stored chats, you need to go to the associated resource in the [Azure portal](https://portal.azure.com) and delete it. If you delete the Cosmos DB resource but keep the chat history option turned on in the studio, your users are notified of a connection error but can continue to use the web app without access to the chat history.
83
+
Deleting your web app doesn't delete your Cosmos DB instance automatically. To delete your Cosmos DB instance along with all stored chats, you need to go to the associated resource in the [Azure portal](https://portal.azure.com) and delete it. If you delete the Cosmos DB resource but keep the chat history option selected on subsequent updates from the Azure OpenAI Studio, the application notifies the user of a connection error. However, the user can continue to use the web app without access to the chat history.
84
+
85
+
## Enabling Microsoft Entra ID authentication between services
86
+
87
+
To enable Microsoft Entra ID for intra-service authentication for your web app, follow these steps.
88
+
89
+
### Enable managed identity on your Azure OpenAI resource and Azure App Service
90
+
91
+
You can enable managed identity for the Azure OpenAI resource and the Azure App Service by navigating to "Identity" and turning on the system assigned managed identity in the Azure portal for each resource.
92
+
93
+
94
+
:::image type="content" source="../media/use-your-data/openai-managed-identity.png" alt-text="Screenshot that shows the application identity configuration in the Azure portal." lightbox="../media/use-your-data/openai-managed-identity.png":::
95
+
96
+
> [!NOTE]
97
+
> If you're using an embedding model deployed to the same resource used for inference, you only need to enable managed identity on one Azure OpenAI resource. If using an embedding model deployed to a different resource from the one used for inference, you also need to enable managed identity on the Azure OpenAI resource used to deploy your embedding model.
98
+
99
+
### Enable role-based access control (RBAC) on your Azure Search resource (optional)
100
+
101
+
If using On Your Data with Azure Search, you should follow this step.
102
+
103
+
To enable your Azure OpenAI resource to access your Azure Search resource, you need to enable role-based access control on your Azure Search resource. Learn more about [enabling RBAC roles](../../../search/search-security-enable-roles.md) for your resources.
104
+
105
+
### Assign RBAC roles to enable intra-service communication
106
+
107
+
The following table summarizes the RBAC role assignments needed for all Azure resources associated with your application.
To assign these roles, follow [these instructions](../../../role-based-access-control/role-assignments-portal.yml) to create the needed role assignments.
117
+
118
+
### App Settings Changes
119
+
120
+
In the webapp application settings, navigate to "Environment Variables" and make the following changes:
121
+
122
+
* Remove the environment variable `AZURE_OPENAI_KEY`, as it's no longer needed.
123
+
* If using On Your Data with Azure Search and are using Microsoft Entra ID authentication between Azure OpenAI and Azure Search, you should also delete the `AZURE_SEARCH_KEY` environment variables for the data source access keys as well.
124
+
125
+
If using an embedding model deployed to the same resource as your model used for inference, there are no other settings changes required.
126
+
127
+
However, if you're using an embedding model deployed to a different resource, make the following extra changes to your app's environment variables:
128
+
* Set `AZURE_OPENAI_EMBEDDING_ENDPOINT` variable to the full API path of the embedding API for the resource you're using for embeddings, for example, `https://<your embedding AOAI resource name>.openai.azure.com/openai/deployments/<your embedding deployment name>/embeddings`
129
+
* Delete the `AZURE_OPENAI_EMBEDDING_KEY` variable to use Microsoft Entra ID authentication.
130
+
131
+
Once all of the environment variable changes are completed, restart the webapp to begin using Microsoft Entra ID authentication between services in the webapp. It will take a few minutes after restarting for any settings changes to take effect.
0 commit comments