Skip to content

Commit a9a6679

Browse files
authored
[TA] Enable healthcare AAD (Azure#22302)
1 parent b75f088 commit a9a6679

File tree

4 files changed

+2551
-28
lines changed

4 files changed

+2551
-28
lines changed

sdk/textanalytics/Azure.AI.TextAnalytics/src/TextAnalyticsClient.cs

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,15 +2125,10 @@ private Response<RecognizeLinkedEntitiesResultCollection> RecognizeLinkedEntitie
21252125
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support"/>.
21262126
/// For document length limits, maximum batch size, and supported text encoding, see
21272127
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/data-limits?tabs=version-3"/>.
2128+
/// </summary>
21282129
/// <remarks>
2129-
/// <para>Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.</para>
2130-
/// <para>
2131-
/// Note: In order to use this functionality, request to access public preview is required.
2132-
/// Azure Active Directory (AAD) is not currently supported. For more information see
2133-
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview"/>.
2134-
/// </para>
2130+
/// Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.
21352131
/// </remarks>
2136-
/// </summary>
21372132
/// <param name="documents">The documents to analyze.</param>
21382133
/// <param name="language">The language that the document is written in.</param>
21392134
/// <param name="options">The additional configurable <see cref="AnalyzeHealthcareEntitiesOptions"/> </param>
@@ -2158,15 +2153,10 @@ public virtual async Task<AnalyzeHealthcareEntitiesOperation> StartAnalyzeHealth
21582153
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support"/>.
21592154
/// For document length limits, maximum batch size, and supported text encoding, see
21602155
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/data-limits?tabs=version-3"/>.
2156+
/// </summary>
21612157
/// <remarks>
2162-
/// <para>Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.</para>
2163-
/// <para>
2164-
/// Note: In order to use this functionality, request to access public preview is required.
2165-
/// Azure Active Directory (AAD) is not currently supported. For more information see
2166-
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview"/>.
2167-
/// </para>
2158+
/// Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.
21682159
/// </remarks>
2169-
/// </summary>
21702160
/// <param name="documents">The documents to analyze.</param>
21712161
/// <param name="language">The language that the document is written in.
21722162
/// If unspecified, this value will be set to the default language in
@@ -2198,15 +2188,10 @@ public virtual AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities
21982188
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support"/>.
21992189
/// For document length limits, maximum batch size, and supported text encoding, see
22002190
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/data-limits?tabs=version-3"/>.
2191+
/// </summary>
22012192
/// <remarks>
2202-
/// <para>Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.</para>
2203-
/// <para>
2204-
/// Note: In order to use this functionality, request to access public preview is required.
2205-
/// Azure Active Directory (AAD) is not currently supported. For more information see
2206-
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview"/>.
2207-
/// </para>
2193+
/// Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.
22082194
/// </remarks>
2209-
/// </summary>
22102195
/// <param name="documents">The documents to analyze.</param>
22112196
/// <param name="options">The additional configurable options<see cref="AnalyzeHealthcareEntitiesOptions"/></param>
22122197
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
@@ -2231,15 +2216,10 @@ public virtual AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities
22312216
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support"/>.
22322217
/// For document length limits, maximum batch size, and supported text encoding, see
22332218
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/data-limits?tabs=version-3"/>.
2219+
/// </summary>
22342220
/// <remarks>
2235-
/// <para>Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.</para>
2236-
/// <para>
2237-
/// Note: In order to use this functionality, request to access public preview is required.
2238-
/// Azure Active Directory (AAD) is not currently supported. For more information see
2239-
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview"/>.
2240-
/// </para>
2221+
/// Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.
22412222
/// </remarks>
2242-
/// </summary>
22432223
/// <param name="documents">The documents to analyze.</param>
22442224
/// <param name="options">The additional configurable options<see cref="AnalyzeHealthcareEntitiesOptions"/></param>
22452225
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>

sdk/textanalytics/Azure.AI.TextAnalytics/tests/RecognizeHealthcareEntitiesTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ public RecognizeHealthcareEntitiesTests(bool isAsync, TextAnalyticsClientOptions
5353
"heart failure"
5454
};
5555

56+
[RecordedTest]
57+
public async Task RecognizeHealthcareEntitiesWithAADTest()
58+
{
59+
TextAnalyticsClient client = GetClient(useTokenCredential: true);
60+
61+
AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchDocuments);
62+
63+
await operation.WaitForCompletionAsync();
64+
65+
ValidateOperationProperties(operation);
66+
67+
List<AnalyzeHealthcareEntitiesResultCollection> resultInPages = operation.Value.ToEnumerableAsync().Result;
68+
Assert.AreEqual(1, resultInPages.Count);
69+
70+
//Take the first page
71+
var resultCollection = resultInPages.FirstOrDefault();
72+
Assert.AreEqual(s_batchDocuments.Count, resultCollection.Count);
73+
}
74+
5675
[RecordedTest]
5776
public async Task RecognizeHealthcareEntitiesTest()
5877
{

0 commit comments

Comments
 (0)