Skip to content

Commit

Permalink
[AnomalyDetector] Update AnomalyDetector README (#11110)
Browse files Browse the repository at this point in the history
* Update AnomalyDetector README

* Update pto beta

* Update changelog

* Address PR comments
  • Loading branch information
joheredi authored Sep 18, 2020
1 parent f2c3880 commit 15e22fd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
3 changes: 2 additions & 1 deletion sdk/anomalydetector/ai-anomaly-detector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 3.0.0-preview.2 (Unreleased)
## 3.0.0-beta.2 (2020-09-17)

- Fix missing types in package [#10916](https://github.com/Azure/azure-sdk-for-js/pull/10916)

## 3.0.0-preview.1 (2020-08-27)

Expand Down
22 changes: 13 additions & 9 deletions sdk/anomalydetector/ai-anomaly-detector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
[Source code](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/anomalydetector/ai-anomaly-detector/) |
[Package (NPM)](https://www.npmjs.com/package/@azure/ai-anomaly-detector) |
[API reference documentation](https://aka.ms/azsdk/net/docs/ref/anomalydetector) |
[Product documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/anomaly-detector/) |[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/anomalydetector/ai-anomaly-detector/samples)
[Product documentation](https://docs.microsoft.com/azure/cognitive-services/anomaly-detector/) |
[Samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/anomalydetector/ai-anomaly-detector/samples)

## Key concepts

Coming soon (#10865)
The `AnomalyDetectorClient` provides methods for anomaly detection:

- `detectEntireSeries` - Detects anomalies on an entire data set
- `detectLastPoint` - Detects anomalies in the latest data point
- `detectChangePoint` - Evaluates change point score of every series point

## Getting started

Expand All @@ -20,8 +24,8 @@ Coming soon (#10865)

### Prerequisites

- An [Azure subscription][azure_sub].
- An existing [Cognitive Services][cognitive_resource] or Anomaly Detector resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].
- An [Azure subscription](https://azure.microsoft.com/free/).
- An existing Anomaly Detector resource.

If you use the Azure CLI, replace `<your-resource-group-name>` and `<your-resource-name>` with your own unique names:

Expand All @@ -41,15 +45,15 @@ npm install @azure/ai-anomaly-detector

To create a client object to access the Anomaly Detector API, you will need the `endpoint` of your Anomaly Detector resource and a `credential`. The Anomaly Detector client can use either Azure Active Directory credentials or an API key credential to authenticate.

You can find the endpoint for your Anomaly Detector resource either in the [Azure Portal][azure_portal] or by using the [Azure CLI][azure_cli] snippet below:
You can find the endpoint for your Anomaly Detector resource in the Azure Portal by clicking `Keys and Endpoint` under Resource Management in the menu or by using the Azure CLI snippet below:

```bash
az cognitiveservices account show --name <your-resource-name> --resource-group <your-resource-group-name> --query "endpoint"
```

#### Using an API Key

Use the [Azure Portal][azure_portal] to browse to your Anomaly Detector resource and retrieve an API key, or use the [Azure CLI][azure_cli] snippet below:
Use the Azure Portal to browse to your Anomaly Detector resource and retrieve an API key by clicking `Keys and Endpoint` under Resource Management, or use the Azure CLI snippet below:

**Note:** Sometimes the API key is referred to as a "subscription key" or "subscription API key."

Expand All @@ -67,14 +71,14 @@ const client = new AnomalyDetectorClient("<endpoint>", new AzureKeyCredential("<

#### Using an Azure Active Directory Credential

Client API key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below,
Client API key authentication is used in most of the examples, but you can also authenticate with Azure Active Directory using the [Azure Identity library]. To use the DefaultAzureCredential provider shown below,
or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:

```bash
npm install @azure/identity
```

You will also need to [register a new AAD application][register_aad_app] and grant access to Anomaly Detector by assigning the `"Cognitive Services User"` role to your service principal (note: other roles such as `"Owner"` will not grant the necessary permissions, only `"Cognitive Services User"` will suffice to run the examples and the sample code).
You will also need to register a new AAD application and grant access to Anomaly Detector by assigning the `"Cognitive Services User"` role to your service principal (note: other roles such as `"Owner"` will not grant the necessary permissions, only `"Cognitive Services User"` will suffice to run the examples and the sample code).

Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.

Expand All @@ -87,7 +91,7 @@ const client = new AnomalyDetectorClient("<endpoint>", new DefaultAzureCredentia

## Examples

Coming soon (#10865)
Samples can be found [here](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/anomalydetector/ai-anomaly-detector/samples)

## Troubleshooting

Expand Down
2 changes: 1 addition & 1 deletion sdk/anomalydetector/ai-anomaly-detector/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/ai-anomaly-detector",
"version": "3.0.0-preview.2",
"version": "3.0.0-beta.2",
"description": "An isomorphic client library for the Azure Anomaly Detector service.",
"sdk-type": "client",
"main": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as coreHttp from "@azure/core-http";
import { GeneratedClientOptionalParams } from "./models";

const packageName = "@azure/ai-form-recognizer";
const packageVersion = "3.0.0-preview.2";
const packageVersion = "3.0.0-beta.2";

export class GeneratedClientContext extends coreHttp.ServiceClient {
endpoint: string;
Expand Down

0 comments on commit 15e22fd

Please sign in to comment.