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/api-center/frequently-asked-questions.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ sections:
21
21
22
22
API Management is a runtime API governance and observability solution that enables you to expose APIs securely at scale, monitor their health, and analyze their usage. [Learn more](../api-management/api-management-key-concepts.md)
23
23
24
-
API Center is a design-time API governance and centralized API discovery solution. Use an API center to collect and maintain your organization's API inventory with rich metadata, and assess and help enforce API design consistency and quality.
24
+
API Center is a design-time API governance and centralized API discovery solution. It acts as a repository and governance tool for all APIs within an organization, regardless of where they are in their lifecycle or where they are deployed. Use an API center to collect and maintain your organization's API inventory with rich metadata, and assess and help enforce API design consistency and quality.
25
25
26
-
Both services support portals for developers to discover APIs. In API Management, the developer portal is scoped to a single instance. In API Center, the portal can show APIs from any number of API Management instances, APIs managed with other API management solutions, and unmanaged APIs.
26
+
Read more in [The Rising Significance of APIs - Azure API Management & API Center](https://techcommunity.microsoft.com/t5/azure-integration-services-blog/the-rising-significance-of-apis-azure-api-management-amp-api/ba-p/4181292).
27
27
28
28
- question: How do I use Azure API Center with my API management solution?
29
29
answer: |
@@ -56,4 +56,4 @@ sections:
56
56
additionalContent: |
57
57
## Related content
58
58
59
-
To learn more, see [Azure API Center overview](overview.md).
59
+
To learn more, see [Azure API Center overview](overview.md).
Copy file name to clipboardExpand all lines: articles/app-service/includes/deploy-intelligent-apps/deploy-intelligent-apps-linux-java-pivot.md
+33-43Lines changed: 33 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,51 +29,11 @@ For this Spring Boot application, we are building off the [quickstart](../../qui
29
29
}
30
30
```
31
31
32
-
### Secure your app with managed identity
33
-
34
-
Although optional, it's highly recommended to secure your application using [managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. Skip this step if you are not using Azure OpenAI. This enables your application to access the Azure OpenAI resource without needing to manage API keys.
35
-
36
-
Follow the steps below to secure your application:
37
-
38
-
Add the Azure OpenAI dependency package. This package enables using Azure credentials in your app.
39
-
40
-
```java
41
-
<dependency>
42
-
<groupId>com.azure</groupId>
43
-
<artifactId>azure-ai-openai</artifactId>
44
-
<version>1.0.0-beta.9</version>
45
-
</dependency>
46
-
```
47
-
48
-
Next, include the default Azure default credentials when creating the client
Once the credentials are added to the application, you’ll then need to enable managed identity in your application and grant access to the resource.
60
-
61
-
1. In your web app resource, navigate to the **Identity** blade and turn on **System assigned** and click **Save**
62
-
2. Once System assigned identity is turned on, it will register the web app with Microsoft Entra ID and the web app can be granted permissions to access protected resources.
63
-
3. Go to your Azure OpenAI resource and navigate to the **Access control (IAM)** blade on the left pane.
64
-
4. Find the Grant access to this resource card and click on **Add role assignment**
65
-
5. Search for the **Cognitive Services OpenAI User** role and click **Next**
66
-
6. On the **Members** tab, find **Assign access to** and choose the **Managed identity** option
67
-
7. Next, click on **+Select Members** and find your web app
68
-
8. Click **Review + assign**
69
-
70
-
Your web app is now added as a cognitive service OpenAI user and can communicate to your Azure OpenAI resource.
71
-
72
32
### API Keys and Endpoints
73
33
74
34
First, you need to grab the keys and endpoint values from Azure OpenAI, or OpenAI and add them as secrets for use in your application. Retrieve and save the values for later use to build the client.
75
35
76
-
For Azure OpenAI, see [this documentation](../../../ai-services/openai/quickstart.md?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint) to retrieve the key and endpoint values. For our application, you need the following values:
36
+
For Azure OpenAI, see [this documentation](../../../ai-services/openai/quickstart.md?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint) to retrieve the key and endpoint values. If you're planning to use [managed identity](../../overview-managed-identity.md) to secure your app you'll only need the `endpoint` value. Otherwise, you need each of the following:
77
37
78
38
-`endpoint`
79
39
-`apiKey`
@@ -139,11 +99,11 @@ For OpenAI:
139
99
140
100
Before you can create the client, you first need to add the Azure SDK dependency. Add the following Azure OpenAI package to the *pom.xl* file and run the **mvn package** command to build the package.
Although optional, it's highly recommended to secure your application using [managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. Skip this step if you are not using Azure OpenAI. This enables your application to access the Azure OpenAI resource without needing to manage API keys.
146
+
147
+
Follow the steps below to secure your application:
148
+
149
+
The Azure SDK package previously installed in the previous section enables the use of default credentials in your app. Include the default Azure default credentials when you create the client.
Once the credentials are added to the application, you’ll then need to enable managed identity in your application and grant access to the resource.
161
+
162
+
1. In your web app resource, navigate to the **Identity** blade and turn on **System assigned** and click **Save**
163
+
2. Once System assigned identity is turned on, it will register the web app with Microsoft Entra ID and the web app can be granted permissions to access protected resources.
164
+
3. Go to your Azure OpenAI resource and navigate to the **Access control (IAM)** blade on the left pane.
165
+
4. Find the Grant access to this resource card and click on **Add role assignment**
166
+
5. Search for the **Cognitive Services OpenAI User** role and click **Next**
167
+
6. On the **Members** tab, find **Assign access to** and choose the **Managed identity** option
168
+
7. Next, click on **+Select Members** and find your web app
169
+
8. Click **Review + assign**
170
+
171
+
Your web app is now added as a cognitive service OpenAI user and can communicate to your Azure OpenAI resource.
172
+
183
173
### Setup prompt and call to OpenAI
184
174
185
175
Now that our OpenAI service is created we can use the chat completions method to send our request message to OpenAI and return a response. Here's where we add our chat message prompt to the code to be passed to the chat completions method. Use the following code to set up the chat completions method:
Copy file name to clipboardExpand all lines: articles/app-service/includes/deploy-intelligent-apps/deploy-intelligent-apps-linux-python-pivot.md
+44-43Lines changed: 44 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ You can use Azure App Service to work with popular AI frameworks like LangChain
19
19
20
20
For this Flask web application, we are building off the [quickstart](../../quickstart-python.md?tabs=flask%2Cwindows%2Cazure-cli%2Cvscode-deploy%2Cdeploy-instructions-azportal%2Cterminal-bash%2Cdeploy-instructions-zip-azcli#1---sample-application) app and updating the *app.py* file to send and receive requests to an Azure OpenAI OR OpenAI service using LangChain.
21
21
22
-
First, copy and replace the *index.html* file with the following code:
22
+
First, copy, and replace the *index.html* file with the following code:
23
23
24
24
```html
25
25
<!doctype html>
@@ -54,7 +54,7 @@ First, copy and replace the *index.html* file with the following code:
54
54
</html>
55
55
```
56
56
57
-
Next, copy and replace the *hello.html* file with the following code:
57
+
Next, copy, and replace the *hello.html* file with the following code:
58
58
59
59
```html
60
60
<!doctype html>
@@ -82,54 +82,16 @@ Next, copy and replace the *hello.html* file with the following code:
82
82
83
83
After the files are updated, we can start preparing our environment variables to work with OpenAI.
84
84
85
-
### Secure your app with managed identity
86
-
87
-
Although optional, it's highly recommended to secure your application using [managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. Skip this step if you are not using Azure OpenAI. This enables your application to access the Azure OpenAI resource without needing to manage API keys.
88
-
89
-
Follow the steps below to secure your application:
90
-
91
-
Add the identity package `Azure.Identity`. This package enables using Azure credentials in your app. Install the package and import the default credential and bearer token provider.
92
-
93
-
```python
94
-
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
95
-
```
96
-
97
-
Next, include the default Azure credentials and token provider in the AzureOpenAI options.
Once the credentials are added to the application, you’ll then need to enable managed identity in your application and grant access to the resource.
112
-
113
-
1. In your web app resource, navigate to the **Identity** blade and turn on **System assigned** and click **Save**
114
-
2. Once System assigned identity is turned on, it will register the web app with Microsoft Entra ID and the web app can be granted permissions to access protected resources.
115
-
3. Go to your Azure OpenAI resource and navigate to the **Access control (IAM)** blade on the left pane.
116
-
4. Find the Grant access to this resource card and click on **Add role assignment**
117
-
5. Search for the **Cognitive Services OpenAI User** role and click **Next**
118
-
6. On the **Members** tab, find **Assign access to** and choose the **Managed identity** option
119
-
7. Next, click on **+Select Members** and find your web app
120
-
8. Click **Review + assign**
121
-
122
-
Your web app is now added as a cognitive service OpenAI user and can communicate to your Azure OpenAI resource.
123
-
124
85
### API Keys and Endpoints
125
86
126
87
In order to make calls to OpenAI with your client, you need to first grab the Keys and Endpoint values from Azure OpenAI, or OpenAI and add them as secrets for use in your application. Retrieve and save the values for later use.
127
88
128
-
For Azure OpenAI, see [this documentation](../../../ai-services/openai/quickstart.md?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint) to retrieve the key and endpoint values. For our application, youneed the following values:
89
+
For Azure OpenAI, see [this documentation](../../../ai-services/openai/quickstart.md?pivots=programming-language-csharp&tabs=command-line%2Cpython#retrieve-key-and-endpoint) to retrieve the key and endpoint values. If you're planning to use [managed identity](../../overview-managed-identity.md) to secure your app you'll only need the `api_version` and `azure__endpoint`values. Otherwise, you need each of the following:
129
90
130
91
-`api_key`
131
92
-`api_version`
132
93
-`azure_deployment`
94
+
-`azure_endpoint`
133
95
-`model_name`
134
96
135
97
For OpenAI, see this [documentation](https://platform.openai.com/docs/api-reference) to retrieve the API keys. For our application, you need the following values:
@@ -202,7 +164,7 @@ from langchain_openai import AzureOpenAI~~
202
164
203
165
After LangChain is imported into our file, you can add the code that will call to OpenAI with the LangChain invoke chat method. Update *app.py `http://app.py`* to include the following code:
204
166
205
-
For Azure OpenAI, use the following code:
167
+
For Azure OpenAI, use the following code. If you plan to use managed identity you can use the credentials outlined in the following section for the Azure OpenAI parameters.
206
168
207
169
```python
208
170
@app.route('/hello', methods=['POST'])
@@ -294,6 +256,45 @@ if __name__ == '__main__':
294
256
295
257
Now save the application and follow the next steps to deploy it to App Service. If you would like to test it locally first at this step, you can swap out the key and endpoint values with the literal string values of your OpenAI service. For example: model_name = 'gpt-4-turbo';
296
258
259
+
### Secure your app with managed identity
260
+
261
+
Although optional, it's highly recommended to secure your application using [managed identity](../../overview-managed-identity.md) to authenticate your app to your Azure OpenAI resource. Skip this step if you are not using Azure OpenAI. This enables your application to access the Azure OpenAI resource without needing to manage API keys.
262
+
263
+
Follow the steps below to secure your application:
264
+
265
+
Add the identity package `Azure.Identity`. This package enables using Azure credentials in your app. Install the package and import the default credential and bearer token provider.
266
+
267
+
```python
268
+
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
269
+
```
270
+
271
+
Next, include the default Azure credentials and token provider in the AzureOpenAI options.
Once the credentials are added to the application, youll then need to enable managed identity in your application and grant access to the resource.
286
+
287
+
1. In your web app resource, navigate to the **Identity** blade and turn on **System assigned** and click **Save**
288
+
2. Once System assigned identity is turned on, it registers the web app with Microsoft Entra ID and the web app can be granted permissions to access protected resources.
289
+
3. Go to your Azure OpenAI resource and navigate to the **Access control (IAM)** blade on the left pane.
290
+
4. Find the Grant access to this resource card and click on **Add role assignment**
291
+
5. Search for the **Cognitive Services OpenAI User** role and click **Next**
292
+
6. On the **Members** tab, find **Assign access to** and choose the **Managed identity** option
293
+
7. Next, click on **+Select Members** and find your web app
294
+
8. Click **Review + assign**
295
+
296
+
Your web app is now added as a cognitive service OpenAI user and can communicate to your Azure OpenAI resource.
297
+
297
298
### Deploy to App Service
298
299
299
300
Before deploying to App Service, you need to edit the *requirments.txt* file and add an environment variable to your web app so it recognizes the LangChain library and build properly.
Copy file name to clipboardExpand all lines: articles/app-service/includes/quickstart-python/deploy-cli.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,6 @@ ms.author: charris
4
4
ms.topic: include
5
5
ms.date: 04/01/2022
6
6
---
7
-
Since the `az webapp up` command created the necessary resources and deployed your application in a single step, you can move on to [4 - Browse to the app](#4---browse-to-the-app).
7
+
Since the `az webapp up` command created the necessary resources and deployed your application in a single step, you can move on to the next step.
Copy file name to clipboardExpand all lines: articles/app-service/includes/quickstart-python/deploy-visual-studio-code.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,6 @@ ms.author: charris
4
4
ms.topic: include
5
5
ms.date: 04/01/2022
6
6
---
7
-
Since the previous step created the necessary resources and deployed your application in a single step, you can move on to [4 - Browse to the app](#4---browse-to-the-app).
7
+
Since the previous step created the necessary resources and deployed your application in a single step, you can move on to the next step.
0 commit comments