Skip to content

Commit 20c04b7

Browse files
authored
Merge pull request #227337 from laujan/63749-update-multi-single-service-authentication
remove tip
2 parents ea7c5aa + 09172fc commit 20c04b7

25 files changed

+219
-230
lines changed

articles/applied-ai-services/.openpublishing.redirection.applied-ai-services.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@
155155
"source_path_from_root": "/articles/applied-ai-services/form-recognizer/quickstarts/try-v3-form-recognizer-studio.md",
156156
"redirect_url": "/azure/applied-ai-services/form-recognizer/quickstarts/try-form-recognizer-studio",
157157
"redirect_document_id": true
158+
},
159+
{
160+
"source_path_from_root": "/articles/applied-ai-services/form-recognizer/form-recognizer-studio-overview.md",
161+
"redirect_url": "/azure/applied-ai-services/form-recognizer/studio-overview",
162+
"redirect_document_id": true
158163
}
159164
]
160165
}

articles/applied-ai-services/form-recognizer/how-to-guides/includes/v2-1/csharp-sdk.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ manager: nitinme
66
ms.service: applied-ai-services
77
ms.subservice: forms-recognizer
88
ms.topic: include
9-
ms.date: 09/16/2022
9+
ms.date: 02/14/2023
1010
ms.author: lajanuar
1111
ms.custom: devx-track-csharp
1212
---
@@ -28,10 +28,8 @@ ms.custom: devx-track-csharp
2828
* The [Visual Studio IDE](https://visualstudio.microsoft.com/vs/) or current version of [.NET Core](https://dotnet.microsoft.com/download/dotnet-core).
2929
* An Azure Storage blob that contains a set of training data. See [Build a training data set for a custom model](../../../build-training-data-set.md) for tips and options for putting together your training data set. For this project, you can use the files under the **Train** folder of the [sample data set](https://go.microsoft.com/fwlink/?linkid=2090451) (download and extract *sample_data.zip*).
3030
* Once you have your Azure subscription, <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesFormRecognizer" title="Create a Form Recognizer resource" target="_blank">create a Form Recognizer resource </a> in the Azure portal to get your key and endpoint. After it deploys, select **Go to resource**.
31-
* You'll need the key and endpoint from the resource you create to connect your application to the Form Recognizer API. Paste your key and endpoint into the code below later in the project.
31+
* You need the key and endpoint from the resource you create to connect your application to the Form Recognizer API. Paste your key and endpoint into the sample code later in the project.
3232
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
33-
> [!TIP]
34-
> Create a Cognitive Services resource if you plan to access multiple cognitive services under a single endpoint/key. For Form Recognizer access only, create a Form Recognizer resource. Please note that you'll need a single-service resource if you intend to use [Azure Active Directory authentication](../../../../../active-directory/authentication/overview-authentication.md).
3533

3634
## Setting up
3735

@@ -78,7 +76,7 @@ In the application's **Program** class, create variables for your resource's key
7876
7977
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/FormRecognizer/FormRecognizerQuickstart.cs?name=snippet_creds)]
8078

81-
In the application's **Main** method, add a call to the asynchronous tasks used in this project. You'll implement them later:
79+
In the application's **Main** method, add a call to the asynchronous tasks used in this project:
8280

8381
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/FormRecognizer/FormRecognizerQuickstart-preview.cs?name=snippet_main)]
8482

@@ -98,8 +96,8 @@ With Form Recognizer, you can create two different client types. The first, `For
9896

9997
`FormTrainingClient` provides operations for:
10098

101-
* Training custom models to analyze all fields and values found in your custom forms. A `CustomFormModel` is returned indicating the form types the model will analyze, and the fields it will extract for each form type.
102-
* Training custom models to analyze specific fields and values you specify by labeling your custom forms. A `CustomFormModel` is returned indicating the fields the model will extract, and the estimated accuracy for each field.
99+
* Training custom models to analyze all fields and values found in your custom forms. A `CustomFormModel` is returned indicating the form types the model analyzes, and the fields it extracts for each form type.
100+
* Training custom models to analyze specific fields and values you specify by labeling your custom forms. A `CustomFormModel` is returned indicating the fields the model extracts, and the estimated accuracy for each field.
103101
* Managing models created in your account.
104102
* Copying a custom model from one Form Recognizer resource to another.
105103

@@ -110,7 +108,7 @@ See examples for [Train a Model](#train-a-custom-model) and [Manage Custom Model
110108
111109
## Authenticate the client
112110

113-
Below **Main**, create a new method named `AuthenticateClient`. You'll use this method in other tasks to authenticate your requests to the Form Recognizer service. This method uses the `AzureKeyCredential` object, so that if needed, you can update the key without creating new client objects.
111+
Below **Main**, create a new method named `AuthenticateClient`. You use this method in other tasks to authenticate your requests to the Form Recognizer service. This method uses the `AzureKeyCredential` object, so that if needed, you can update the key without creating new client objects.
114112

115113
> [!IMPORTANT]
116114
> Get your key and endpoint from the Azure portal. If the Form Recognizer resource you created in the **Prerequisites** section deployed successfully, click the **Go to Resource** button under **Next Steps**. You can find your key and endpoint in the resource's **key and endpoint** page, under **resource management**.
@@ -119,20 +117,20 @@ Below **Main**, create a new method named `AuthenticateClient`. You'll use this
119117
120118
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/FormRecognizer/FormRecognizerQuickstart.cs?name=snippet_auth)]
121119

122-
Repeat the steps above for a new method that authenticates a training client.
120+
Repeat the steps for a new method that authenticates a training client.
123121

124122
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/FormRecognizer/FormRecognizerQuickstart.cs?name=snippet_auth_training)]
125123

126124
## Get assets for testing
127125

128-
You'll also need to add references to the URLs for your training and testing data. Add these references to the root of your **Program** class.
126+
You also need to add references to the URLs for your training and testing data. Add these references to the root of your **Program** class.
129127

130-
* To retrieve the SAS URL for your custom model training data, go to your storage resource in the Azure portal and select the **Storage Explorer** tab. Navigate to your container, right-click, and select **Get shared access signature**. It's important to get the SAS for your container, not for the storage account itself. Make sure the **Read**, **Write**, **Delete** and **List** permissions are checked, and click **Create**. Then copy the value in the **URL** section to a temporary location. It should have the form: `https://<storage account>.blob.core.windows.net/<container name>?<SAS value>`.
128+
* To retrieve the SAS URL for your custom model training data, go to your storage resource in the Azure portal and select the **Storage Explorer** tab. Navigate to your container, right-click, and select **Get shared access signature**. It's important to get the SAS for your container, not for the storage account itself. Make sure the **Read**, **Write**, **Delete** and **List** permissions are checked, and select **Create**. Then copy the value in the **URL** section to a temporary location. It should have the form: `https://<storage account>.blob.core.windows.net/<container name>?<SAS value>`.
131129

132130
:::image type="content" source="../../../media/quickstarts/get-sas-url.png" alt-text="Screenshot of SAS URL retrieval.":::
133131

134132
* Then, repeat the above steps to get the SAS URL of an individual document in blob storage container. Save it to a temporary location as well.
135-
* Finally, save the URL of the sample image(s) included below (also available on [GitHub](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_forms)).
133+
* Finally, save the URL of the included sample image(s) (also available on [GitHub](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_forms)).
136134

137135
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/FormRecognizer/FormRecognizerQuickstart-preview.cs?name=snippet_urls)]
138136

@@ -424,9 +422,9 @@ Submodel Form Type: form-63c013e3-1cab-43eb-84b0-f4b20cb9214c
424422
This section demonstrates how to extract key/value information and other content from your custom template types, using models you trained with your own forms.
425423

426424
> [!IMPORTANT]
427-
> In order to implement this scenario, you must have already trained a model so you can pass its ID into the method below.
425+
> In order to implement this scenario, you must have already trained a model so you can pass its ID into the following method.
428426
429-
You'll use the `StartRecognizeCustomFormsFromUri` method.
427+
You use the `StartRecognizeCustomFormsFromUri` method.
430428

431429
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/FormRecognizer/FormRecognizerQuickstart.cs?name=snippet_analyze)]
432430

@@ -500,7 +498,7 @@ Field 'Azure.AI.FormRecognizer.Models.FieldValue:
500498

501499
## Manage custom models
502500

503-
This section demonstrates how to manage the custom models stored in your account. You'll do multiple operations within the following method:
501+
This section demonstrates how to manage the custom models stored in your account. You complete multiple operations within the following method:
504502

505503
[!code-csharp[](~/cognitive-services-quickstart-code/dotnet/FormRecognizer/FormRecognizerQuickstart.cs?name=snippet_manage)]
506504

@@ -603,7 +601,7 @@ If you want to clean up and remove a Cognitive Services subscription, you can de
603601

604602
## Troubleshooting
605603

606-
When you interact with the Cognitive Services Form Recognizer client library using the .NET SDK, errors returned by the service will result in a `RequestFailedException`. They'll include the same HTTP status code that would have been returned by a REST API request.
604+
When you interact with the Cognitive Services Form Recognizer client library using the .NET SDK, errors returned by the service result in a `RequestFailedException`. They include the same HTTP status code that would have been returned by a REST API request.
607605

608606
For example, if you submit a receipt image with an invalid URI, a `400` error is returned, indicating "Bad Request".
609607

@@ -618,7 +616,7 @@ catch (RequestFailedException e)
618616
}
619617
```
620618

621-
You'll notice that additional information, like the client request ID of the operation, is logged.
619+
You notice that additional information, like the client request ID of the operation, is logged.
622620

623621
```console
624622

articles/applied-ai-services/form-recognizer/how-to-guides/includes/v2-1/java-sdk.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ manager: nitinme
66
ms.service: applied-ai-services
77
ms.subservice: forms-recognizer
88
ms.topic: include
9-
ms.date: 09/16/2022
9+
ms.date: 02/14/2023
1010
ms.custom: devx-track-java
1111
ms.author: lajanuar
1212
---
@@ -27,11 +27,10 @@ ms.author: lajanuar
2727
* The current version of the [Java Development Kit (JDK)](https://www.oracle.com/technetwork/java/javase/downloads/index.html)
2828
* The [Gradle build tool](https://gradle.org/install/), or another dependency manager.
2929
* Once you have your Azure subscription, <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesFormRecognizer" title="Create a Form Recognizer resource" target="_blank">create a Form Recognizer resource </a> in the Azure portal to get your key and endpoint. After it deploys, select **Go to resource**.
30-
* You'll need the key and endpoint from the resource you create to connect your application to the Form Recognizer API. Paste your key and endpoint into the code below.
30+
* You need the key and endpoint from the resource you create to connect your application to the Form Recognizer API. Paste your key and endpoint into the sample code.
3131
* You can use the free pricing tier (`F0`) to try the service, and upgrade later to a paid tier for production.
3232
* An Azure Storage blob that contains a set of training data. See [Build a training data set for a custom model](../../../build-training-data-set.md) for tips and options for putting together your training data set. For this project, you can use the files under the **Train** folder of the [sample data set](https://go.microsoft.com/fwlink/?linkid=2090451) (download and extract *sample_data.zip*).
33-
> [!TIP]
34-
> Create a Cognitive Services resource if you plan to access multiple cognitive services under a single endpoint/key. For Form Recognizer access only, create a Form Recognizer resource. Please note that you'll need a single-service resource if you intend to use [Azure Active Directory authentication](../../../../../active-directory/authentication/overview-authentication.md).
33+
3534

3635
## Setting up
3736

@@ -47,7 +46,7 @@ mkdir myapp && cd myapp
4746
mkdir myapp; cd myapp
4847
```
4948

50-
Run the `gradle init` command from your working directory. This command will create essential build files for Gradle, including *build.gradle.kts*, which is used at runtime to create and configure your application.
49+
Run the `gradle init` command from your working directory. This command creates essential build files for Gradle, including *build.gradle.kts*, which is used at runtime to create and configure your application.
5150

5251
```console
5352
gradle init --type basic
@@ -98,9 +97,9 @@ In the application's **FormRecognizer** class, create variables for your resourc
9897
>
9998
> Remember to remove the key from your code when you're done, and never post it publicly. For production, use secure methods to store and access your credentials. For more information, *see* Cognitive Services [security](../../../../../cognitive-services/security-features.md).
10099
101-
In the application's **main** method, add calls for the methods used in this project. You'll define these calls later. You'll also need to add references to the URLs for your training and testing data.
100+
In the application's **main** method, add calls for the methods used in this project. You define these calls later. You also need to add references to the URLs for your training and testing data.
102101

103-
* To retrieve the SAS URL for your custom model training data, go to your storage resource in the Azure portal and select the **Storage Explorer** tab. Navigate to your container, right-click, and select **Get shared access signature**. It's important to get the SAS for your container, not for the storage account itself. Make sure the **Read**, **Write**, **Delete** and **List** permissions are checked, and click **Create**. Then copy the value in the **URL** section to a temporary location. It should have the form: `https://<storage account>.blob.core.windows.net/<container name>?<SAS value>`.
102+
* To retrieve the SAS URL for your custom model training data, go to your storage resource in the Azure portal and select the **Storage Explorer** tab. Navigate to your container, right-click, and select **Get shared access signature**. It's important to get the SAS for your container, not for the storage account itself. Make sure the **Read**, **Write**, **Delete** and **List** permissions are checked, and select **Create**. Then copy the value in the **URL** section to a temporary location. It should have the form: `https://<storage account>.blob.core.windows.net/<container name>?<SAS value>`.
104103

105104
:::image type="content" source="../../../media/quickstarts/get-sas-url.png" alt-text="Screenshot of SAS URL retrieval.":::
106105

@@ -128,8 +127,8 @@ With Form Recognizer, you can create two different client types. The first, `For
128127

129128
`FormTrainingClient` provides operations for:
130129

131-
* Training custom models to analyze all fields and values found in your custom forms. A `CustomFormModel` is returned indicating the form types the model will analyze, and the fields it will extract for each form type.
132-
* Training custom models to analyze specific fields and values you specify by labeling your custom forms. A `CustomFormModel` is returned indicating the fields the model will extract and the estimated accuracy for each field.
130+
* Training custom models to analyze all fields and values found in your custom forms. A `CustomFormModel` is returned indicating the form types the model analyzes, and the fields it extracts for each form type.
131+
* Training custom models to analyze specific fields and values you specify by labeling your custom forms. A `CustomFormModel` is returned indicating the fields the model extracts and the estimated accuracy for each field.
133132
* Managing models created in your account.
134133
* Copying a custom model from one Form Recognizer resource to another.
135134

@@ -138,7 +137,7 @@ With Form Recognizer, you can create two different client types. The first, `For
138137
139138
## Authenticate the client
140139

141-
At the top of your **main** method, add the following code. Here, you'll authenticate two client objects using the subscription variables you defined above. You'll use an **AzureKeyCredential** object, so that if needed, you can update the key without creating new client objects.
140+
At the top of your **main** method, add the following code. Here, you authenticate two client objects using the subscription variables you defined previously. You use an **AzureKeyCredential** object, so that if needed, you can update the key without creating new client objects.
142141

143142
[!code-java[](~/cognitive-services-quickstart-code/java/FormRecognizer/FormRecognizer.java?name=snippet_auth)]
144143

@@ -335,9 +334,9 @@ The model found field 'field-6' with label: VAT ID
335334
This section demonstrates how to extract key/value information and other content from your custom template types, using models you trained with your own forms.
336335

337336
> [!IMPORTANT]
338-
> In order to implement this scenario, you must have already trained a model so you can pass its ID into the method below. See the [Train a model](#train-a-model-without-labels) section.
337+
> In order to implement this scenario, you must have already trained a model so you can pass its ID into the method operation. See the [Train a model](#train-a-model-without-labels) section.
339338
340-
You'll use the **beginRecognizeCustomFormsFromUrl** method.
339+
You use the **beginRecognizeCustomFormsFromUrl** method.
341340

342341
[!code-java[](~/cognitive-services-quickstart-code/java/FormRecognizer/FormRecognizer.java?name=snippet_analyze_call)]
343342

@@ -365,7 +364,7 @@ Field 'field-6' has label 'VAT ID' with a confidence score of 1.00.
365364

366365
## Manage custom models
367366

368-
This section demonstrates how to manage the custom models stored in your account. The following code does all of the model management tasks in a single method, as an example. Start by copying the method signature below:
367+
This section demonstrates how to manage the custom models stored in your account. The following code does all of the model management tasks in a single method, as an example. Start by copying the following method signature:
369368

370369
[!code-java[](~/cognitive-services-quickstart-code/java/FormRecognizer/FormRecognizer.java?name=snippet_manage)]
371370

@@ -448,7 +447,7 @@ try {
448447

449448
### Enable client logging
450449

451-
Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and speeding up their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help locate the root issue. View the [logging wiki](https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK) for guidance about enabling logging.
450+
Azure SDKs for Java offer a consistent logging story to help aid in troubleshooting application errors and speeding up their resolution. The logs produced capture the flow of an application before reaching the terminal state to help locate the root issue. View the [logging wiki](https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK) for guidance about enabling logging.
452451

453452
## Next steps
454453

0 commit comments

Comments
 (0)