Skip to content

Commit

Permalink
[TA] Enable healthcare AAD (#22302)
Browse files Browse the repository at this point in the history
  • Loading branch information
maririos authored Jun 30, 2021
1 parent b75f088 commit a9a6679
Show file tree
Hide file tree
Showing 4 changed files with 2,551 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2125,15 +2125,10 @@ private Response<RecognizeLinkedEntitiesResultCollection> RecognizeLinkedEntitie
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support"/>.
/// For document length limits, maximum batch size, and supported text encoding, see
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/data-limits?tabs=version-3"/>.
/// </summary>
/// <remarks>
/// <para>Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.</para>
/// <para>
/// Note: In order to use this functionality, request to access public preview is required.
/// Azure Active Directory (AAD) is not currently supported. For more information see
/// <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"/>.
/// </para>
/// Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.
/// </remarks>
/// </summary>
/// <param name="documents">The documents to analyze.</param>
/// <param name="language">The language that the document is written in.</param>
/// <param name="options">The additional configurable <see cref="AnalyzeHealthcareEntitiesOptions"/> </param>
Expand All @@ -2158,15 +2153,10 @@ public virtual async Task<AnalyzeHealthcareEntitiesOperation> StartAnalyzeHealth
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support"/>.
/// For document length limits, maximum batch size, and supported text encoding, see
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/data-limits?tabs=version-3"/>.
/// </summary>
/// <remarks>
/// <para>Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.</para>
/// <para>
/// Note: In order to use this functionality, request to access public preview is required.
/// Azure Active Directory (AAD) is not currently supported. For more information see
/// <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"/>.
/// </para>
/// Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.
/// </remarks>
/// </summary>
/// <param name="documents">The documents to analyze.</param>
/// <param name="language">The language that the document is written in.
/// If unspecified, this value will be set to the default language in
Expand Down Expand Up @@ -2198,15 +2188,10 @@ public virtual AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support"/>.
/// For document length limits, maximum batch size, and supported text encoding, see
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/data-limits?tabs=version-3"/>.
/// </summary>
/// <remarks>
/// <para>Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.</para>
/// <para>
/// Note: In order to use this functionality, request to access public preview is required.
/// Azure Active Directory (AAD) is not currently supported. For more information see
/// <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"/>.
/// </para>
/// Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.
/// </remarks>
/// </summary>
/// <param name="documents">The documents to analyze.</param>
/// <param name="options">The additional configurable options<see cref="AnalyzeHealthcareEntitiesOptions"/></param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
Expand All @@ -2231,15 +2216,10 @@ public virtual AnalyzeHealthcareEntitiesOperation StartAnalyzeHealthcareEntities
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support"/>.
/// For document length limits, maximum batch size, and supported text encoding, see
/// <see href="https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/data-limits?tabs=version-3"/>.
/// </summary>
/// <remarks>
/// <para>Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.</para>
/// <para>
/// Note: In order to use this functionality, request to access public preview is required.
/// Azure Active Directory (AAD) is not currently supported. For more information see
/// <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"/>.
/// </para>
/// Method is only available for <see cref="TextAnalyticsClientOptions.ServiceVersion.V3_1"/> and up.
/// </remarks>
/// </summary>
/// <param name="documents">The documents to analyze.</param>
/// <param name="options">The additional configurable options<see cref="AnalyzeHealthcareEntitiesOptions"/></param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ public RecognizeHealthcareEntitiesTests(bool isAsync, TextAnalyticsClientOptions
"heart failure"
};

[RecordedTest]
public async Task RecognizeHealthcareEntitiesWithAADTest()
{
TextAnalyticsClient client = GetClient(useTokenCredential: true);

AnalyzeHealthcareEntitiesOperation operation = await client.StartAnalyzeHealthcareEntitiesAsync(s_batchDocuments);

await operation.WaitForCompletionAsync();

ValidateOperationProperties(operation);

List<AnalyzeHealthcareEntitiesResultCollection> resultInPages = operation.Value.ToEnumerableAsync().Result;
Assert.AreEqual(1, resultInPages.Count);

//Take the first page
var resultCollection = resultInPages.FirstOrDefault();
Assert.AreEqual(s_batchDocuments.Count, resultCollection.Count);
}

[RecordedTest]
public async Task RecognizeHealthcareEntitiesTest()
{
Expand Down
Loading

0 comments on commit a9a6679

Please sign in to comment.