diff --git a/docs-ref-services/preview/ai-form-recognizer-readme.md b/docs-ref-services/preview/ai-form-recognizer-readme.md deleted file mode 100644 index 7054de1a0544..000000000000 --- a/docs-ref-services/preview/ai-form-recognizer-readme.md +++ /dev/null @@ -1,720 +0,0 @@ ---- -title: Azure Form Recognizer client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/ai-form-recognizer, formrecognizer -author: witemple-msft -ms.author: witemple -ms.date: 04/12/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: formrecognizer ---- -# Azure Form Recognizer client library for JavaScript - version 4.1.0-beta.1 - - -Azure Cognitive Services [Form Recognizer](https://azure.microsoft.com/services/cognitive-services/form-recognizer/) is a cloud service that uses machine learning to analyze text and structured data from your documents. It includes the following main features: - -- Layout - Extract text, table structures, and selection marks, along with their bounding region coordinates, from documents. -- Document - Analyze entities, key-value pairs, tables, and selection marks from documents using the general prebuilt document model. -- Read - Read information about textual elements, such as page words and lines in addition to text language information. -- Prebuilt - Analyze data from certain types of common documents (such as receipts, invoices, business cards, or identity documents) using prebuilt models. -- Custom - Build custom models to extract text, field values, selection marks, and table data from documents. Custom models are built with your own data, so they're tailored to your documents. -- Classifiers - Build custom classifiers to categorize documents into predefined classes. - -[Source code](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/) | -[Package (NPM)](https://www.npmjs.com/package/@azure/ai-form-recognizer) | -[API reference documentation](/javascript/api/@azure/ai-form-recognizer) | -[Product documentation](/azure/cognitive-services/form-recognizer/) | -[Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples) - -#### **_Breaking change advisory_ ⚠️** - -In version 4.0.0, this package introduces a full redesign of the Azure Form Recognizer client library. To leverage features of the newest Form Recognizer service API (version "2022-08-31" and newer), the new SDK is required, and application code must be changed to use the new clients. Please see the [Migration Guide](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/MIGRATION-v3_v4.md) for detailed instructions on how to update application code from version 3.x of the Form Recognizer SDK to the new version (4.x). Additionally, the [CHANGELOG](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/CHANGELOG.md) contains an outline of the changes since version 3.x. This package targets Azure Form Recognizer service API version `2022-08-31` and newer. To continue to use Form Recognizer API version 2.1, please use major version 3 of the client package (`@azure/ai-form-recognizer@^3.2.0`). - -### Install the `@azure/ai-form-recognizer` package - -Install the Azure Form Recognizer client library for JavaScript with `npm`: - -```bash -npm install @azure/ai-form-recognizer -``` - -## Getting started - -```javascript -const { DocumentAnalysisClient } = require("@azure/ai-form-recognizer"); -const { DefaultAzureCredential } = require("@azure/identity"); - -const fs = require("fs"); - -const credential = new DefaultAzureCredential(); -const client = new DocumentAnalysisClient( - "https://.cognitiveservices.azure.com", - credential -); - -// Form Recognizer supports many different types of files. -const file = fs.createReadStream("path/to/file.jpg"); -const poller = await client.beginAnalyzeDocument("", file); - -const { pages, tables, styles, keyValuePairs, entities, documents } = await poller.pollUntilDone(); -``` - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- A [Cognitive Services or Form Recognizer resource][fr_or_cs_resource]. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. - -#### Create a Form Recognizer resource - -Form Recognizer supports both [multi-service and single-service access][multi_and_single_service]. 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. - -You can create the resource using - -**Option 1:** [Azure Portal][azure_portal_create_fr_resource] - -**Option 2:** [Azure CLI][azure_cli_create_fr_resource]. - -Below is an example of how you can create a Form Recognizer resource using the CLI: - -```bash -# Create a new resource group to hold the Form Recognizer resource - -# if using an existing resource group, skip this step -az group create --name my-resource-group --location westus2 -``` - -If you use the Azure CLI, replace `` and `` with your own unique names: - -```bash -az cognitiveservices account create --kind FormRecognizer --resource-group --name --sku --location -``` - -### Create and authenticate a client - -In order to interact with the Form Recognizer service, you'll need to select either a `DocumentAnalysisClient` or a `DocumentModelAdministrationClient`, and create an instance of this type. In the following examples, we will use `DocumentAnalysisClient`. To create a client instance to access the Form Recognizer API, you will need the `endpoint` of your Form Recognizer resource and a `credential`. The Form Recognizer clients can use either an `AzureKeyCredential` with an API key of your resource or a `TokenCredential` that uses Azure Active Directory RBAC to authorize the client. - -You can find the endpoint for your Form Recognizer resource either in the [Azure Portal][azure_portal] or by using the [Azure CLI][azure_cli] snippet below: - -```bash -az cognitiveservices account show --name --resource-group --query "properties.endpoint" -``` - -#### Use an API key - -Use the [Azure Portal][azure_portal] to browse to your Form Recognizer resource and retrieve an API key, or use the [Azure CLI][azure_cli] snippet below: - -**Note:** Sometimes the API key is referred to as a "subscription key" or "subscription API key." - -```bash -az cognitiveservices account keys list --resource-group --name -``` - -Once you have an API key and endpoint, you can use it as follows: - -```js -const { DocumentAnalysisClient, AzureKeyCredential } = require("@azure/ai-form-recognizer"); - -const client = new DocumentAnalysisClient("", new AzureKeyCredential("")); -``` - -#### Use Azure Active Directory - -API key authorization is used in most of the examples, but you can also authenticate the client with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: - -```bash -npm install @azure/identity -``` - -To authenticate using a service principal, you will also need to [register an AAD application][register_aad_app] and grant access to Form Recognizer 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`. - -```js -const { DocumentAnalysisClient } = require("@azure/ai-form-recognizer"); -const { DefaultAzureCredential } = require("@azure/identity"); - -const client = new DocumentAnalysisClient("", new DefaultAzureCredential()); -``` - -## Key concepts - -### `DocumentAnalysisClient` - -`DocumentAnalysisClient` provides operations for analyzing input documents using custom and prebuilt models. It has three methods: - -- `beginAnalyzeDocument`, which extracts data from an input document file stream using a custom or prebuilt model given by its model ID. For information about the prebuilt models supported in all resources and their model IDs/outputs, please see [the service's documentation of the models][fr-models]. -- `beginAnalyzeDocumentFromUrl`, which performs the same function as `beginAnalyzeDocument`, but submits a publicly-accessible URL of a file instead of a file stream. - -### `DocumentModelAdministrationClient` - -`DocumentModelAdministrationClient` provides operations for managing (creating, reading, listing, and deleting) models in the Form Recognizer resource: - -- `beginBuildDocumentModel` starts an operation to create a new document model from your own training data set. The created model can extract fields according to a custom schema. The training data are expected to be located in an Azure Storage container and organized according to a particular convention. See the [service's documentation on creating a training data set][fr-build-training-set] for a more detailed explanation of applying labels to a training data set. -- `beginComposeDocumentModel` starts an operation to compose multiple models into a single model. When used for custom form recognition, the new composed model will first perform a classification of the input documents to determine which of its submodels is most appropriate. -- `beginCopyModelTo` starts an operation to copy a custom model from one Form Recognizer resource to another (or even to the same Form Recognizer resource). It requires a `CopyAuthorization` from the target Form Recognizer resource, which can be generated using the `getCopyAuthorization` method. -- `getResourceDetails` retrieves information about the Form Recognizer resource's limits, such as the number of custom models and the maximum number of models the resource can support. -- `getDocumentModel`, `listDocumentModels`, and `deleteDocumentModel` enable managing models in the resource. -- `getOperation` and `listOperations` enable viewing the status of model creation operations, even those operations that are ongoing or that have failed. Operations are retained for 24 hours. - -Please note that models can also be created using the Form Recognizer service's graphical user interface: [Form Recognizer Studio (Preview)][fr-studio]. - -Sample code snippets that illustrate the use of `DocumentModelAdministrationClient` to build a model can be found [below, in the "Build a Model" example section.](#build-a-model). - -### Long-running operations - -Long-running operations (LROs) are operations which consist of an initial request sent to the service to start an operation, followed by polling for a result at a certain interval to determine if the operation has completed and whether it failed or succeeded. Ultimately, the LRO will either fail with an error or produce a result. - -In Azure Form Recognizer, operations that create models (including copying and composing models) as well as the analysis/data-extraction operations are LROs. The SDK clients provide asynchronous `begin` methods that return `Promise` objects. The `PollerLike` object represents the operation, which runs asynchronously on the service's infrastructure, and a program can wait for the operation to complete by calling and awaiting the `pollUntilDone` method on the poller returned from the `begin` method. Sample code snippets are provided to illustrate using long-running operations in the next section. - -## Examples - -The following section provides several JavaScript code snippets illustrating common patterns used in the Form Recognizer client libraries. - -- [Analyze a document with a model ID](#analyze-a-document-with-a-model-id) -- [Use prebuilt document models](#use-prebuilt-document-models) -- [Use the "layout" prebuilt](#use-the-layout-prebuilt) -- [Use the "document" prebuilt](#use-the-document-prebuilt) -- [Use the "read" prebuilt](#use-the-read-prebuilt) -- [Build a model](#build-a-model) -- [Manage models](#manage-models) - -### Analyze a document with a model ID - -The `beginAnalyzeDocument` method can extract fields and table data from documents. Analysis may use either a custom model, trained with your own data, or a prebuilt model provided by the service (see _[Use Prebuilt Models](#use-prebuilt-models)_ below). A custom model is tailored to your own documents, so it should only be used with documents of the same structure as one of the document types in the model (there may be multiple, such as in a composed model). - -```javascript -const { DocumentAnalysisClient, AzureKeyCredential } = require("@azure/ai-form-recognizer"); - -const fs = require("fs"); - -async function main() { - const endpoint = ""; - const apiKey = ""; - const modelId = ""; - const path = ""; - - const readStream = fs.createReadStream(path); - - const client = new DocumentAnalysisClient(endpoint, new AzureKeyCredential(apiKey)); - const poller = await client.beginAnalyzeDocument(modelId, readStream, { - onProgress: ({ status }) => { - console.log(`status: ${status}`); - }, - }); - - // There are more fields than just these three - const { documents, pages, tables } = await poller.pollUntilDone(); - - console.log("Documents:"); - for (const document of documents || []) { - console.log(`Type: ${document.docType}`); - console.log("Fields:"); - for (const [name, field] of Object.entries(document.fields)) { - console.log( - `Field ${name} has value '${field.value}' with a confidence score of ${field.confidence}` - ); - } - } - console.log("Pages:"); - for (const page of pages || []) { - console.log(`Page number: ${page.pageNumber} (${page.width}x${page.height} ${page.unit})`); - } - - console.log("Tables:"); - for (const table of tables || []) { - console.log(`- Table (${table.columnCount}x${table.rowCount})`); - for (const cell of table.cells) { - console.log(` - cell (${cell.rowIndex},${cell.columnIndex}) "${cell.content}"`); - } - } -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - -#### Analyze a document from a URL - -As an alternative to providing a readable stream, a publicly-accessible URL can be provided instead using the `beginAnalyzeDocumentFromUrl` method. "Publicly-accessible" means that URL sources must be accessible from the service's infrastructure (in other words, a private intranet URL, or URLs that use header- or certificate-based secrets, will not work, as the Form Recognizer service must be able to access the URL). However, the URL itself could encode a secret, such as an Azure Storage blob URL that contains a SAS token in the query parameters. - -### Use prebuilt document models - -The `beginAnalyzeDocument` method also supports extracting fields from certain types of common documents such as receipts, invoices, business cards, identity documents, and more using prebuilt models provided by the Form Recognizer service. The prebuilt models may be provided either as model ID strings (the same as custom document models—see the _[other prebuilt models](#other-prebuilt-models)_ section below) or using a `DocumentModel` object. When using a `DocumentModel`, the Form Recognizer SDK for JavaScript provides a much stronger TypeScript type for the resulting extracted documents based on the model's schema, and it will be converted to use JavaScript naming conventions. - - -**Breaking Change Warning** ⚠️: In previous `4.0.0-beta` versions of the Azure Form Recognizer SDK for JavaScript, prebuilt `DocumentModel` objects were exported from the package through an object named `PrebuiltModels`. This object has been removed and replaced with the [`DocumentModel` samples][samples-prebuilt], which you may use as part of your own project. This change will enable us to continue to provide timely updates and ensure stability as the number of supported prebuilt models increases and as their capabilities are enhanced. - -Example `DocumentModel` objects for the current service API version (`2022-08-31`) can be found in [the `prebuilt` samples directory][samples-prebuilt]. In the following example, we'll use the `PrebuiltReceiptModel` from the [`prebuilt-receipt.ts`] file in that directory. - -Since the main benefit of `DocumentModel`-based analysis is stronger TypeScript type constraints, the following sample is written in TypeScript using ECMAScript module syntax: - -```typescript -import { DocumentAnalysisClient, AzureKeyCredential } from "@azure/ai-form-recognizer"; - -// Copy the file from the above-linked sample directory so that it can be imported in this module -import { PrebuiltReceiptModel } from "./prebuilt/prebuilt-receipt"; - -import fs from "fs"; - -async function main() { - const endpoint = ""; - const apiKey = ""; - const path = ""; // pdf/jpeg/png/tiff formats - - const readStream = fs.createReadStream(path); - - const client = new DocumentAnalysisClient(endpoint, new AzureKeyCredential(apiKey)); - - // The PrebuiltReceiptModel `DocumentModel` instance encodes both the model ID and a stronger return type for the operation - const poller = await client.beginAnalyzeDocument(PrebuiltReceiptModel, readStream, { - onProgress: ({ status }) => { - console.log(`status: ${status}`); - }, - }); - - const { - documents: [receiptDocument], - } = await poller.pollUntilDone(); - - // The fields of the document constitute the extracted receipt data. - const receipt = receiptDocument.fields; - - if (receipt === undefined) { - throw new Error("Expected at least one receipt in analysis result."); - } - - console.log(`Receipt data (${receiptDocument.docType})`); - console.log(" Merchant Name:", receipt.merchantName?.value); - - // The items of the receipt are an example of a `DocumentArrayValue` - if (receipt.items !== undefined) { - console.log("Items:"); - for (const { properties: item } of receipt.items.values) { - console.log("- Description:", item.description?.value); - console.log(" Total Price:", item.totalPrice?.value); - } - } - - console.log(" Total:", receipt.total?.value); -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - -Alternatively, as mentioned above, instead of using `PrebuiltReceiptModel`, which produces the stronger return type, the prebuilt receipt's model ID ("prebuilt-receipt") can be used, but the document fields will not be strongly typed in TypeScript, and the field names will generally be in "PascalCase" instead of "camelCase". - -#### **Other prebuilt models** - -You are not limited to receipts! There are a few prebuilt models to choose from, with more on the way. Each prebuilt model has its own set of supported fields: - -- Receipts, using [`PrebuiltReceiptModel`][samples-prebuilt-receipt] (as above) or the prebuilt receipt model ID `"prebuilt-receipt"`. -- Business cards, using [`PrebuiltBusinessCardModel`][samples-prebuilt-businesscard] or its model ID `"prebuilt-businessCard"`. -- Invoices, using [`PrebuiltInvoiceModel`][samples-prebuilt-invoice] or its model ID `"prebuilt-invoice"`. -- Identity Documents (such as driver licenses and passports), using [`PrebuiltIdDocumentModel`][samples-prebuilt-iddocument] or its model ID `"prebuilt-idDocument"`. -- W2 Tax Forms (United States), using [`PrebuiltTaxUsW2Model`][samples-prebuilt-tax.us.w2] or its model ID `"prebuilt-tax.us.w2"`. -- Health Insurance Cards (United States), using [`PrebuiltHealthInsuranceCardUsModel`][samples-prebuilt-healthinsurancecard.us] or its model ID `"prebuilt-healthInsuranceCard.us"`. - -Each of the above prebuilt models produces `documents` (extracted instances of the model's field schema). There are also three prebuilt models that do not have field schemas and therefore do not produce `documents`. They are: - -- The prebuilt Layout model (see _[Use the "layout" prebuilt](#use-the-layout-prebuilt)_ below), which extracts information about basic layout (OCR) elements such as pages and tables. -- The prebuilt General Document model (see _[Use the "document" prebuilt](#use-the-document-prebuilt)_ below), which adds key-value pairs (directed associations between page elements, such as labeled elements) to the information produced by the layout model. -- The prebuilt Read model (see _[Use the "read" prebuilt](#use-the-read-prebuilt)_ below), which extracts only textual elements, such as page words and lines, along with information about the language of the document. - -For information about the fields of all of these models, see [the service's documentation of the available prebuilt models](https://aka.ms/azsdk/formrecognizer/models). - -The fields of all prebuilt models may also be accessed programmatically using the `getDocumentModel` method (by their model IDs) of `DocumentModelAdministrationClient` and inspecting the `docTypes` field in the result. - -### Use the "layout" prebuilt - - -**Breaking Change Warning** ⚠️: In previous `4.0.0-beta` versions of the Azure Form Recognizer SDK for JavaScript, the prebuilt Layout model was provided by a custom method named `beginExtractLayout`. This method was removed and replaced with an example `DocumentModel` instance named [`PrebuiltLayoutModel`][samples-prebuilt-layout] for use with the same `beginAnalyzeDocument` method that is used to perform analysis with other prebuilt models. As previously, the model ID `"prebuilt-layout"` may still be used directly. This change will align the `prebuilt-layout` model with the other prebuilt models and enable us to continue to provide timely updates and ensure stability as the number of supported prebuilt models increases and as their capabilities are enhanced. - -The `"prebuilt-layout"` model extracts only the basic elements of the document, such as pages, (which consist of text words/lines and selection marks), tables, and visual text styles along with their bounding regions and spans within the text content of the input documents. We provide a strongly-typed `DocumentModel` instance named [`PrebuiltLayoutModel`][samples-prebuilt-layout] that invokes this model, or as always its model ID `"prebuilt-layout"` may be used directly. - -Since the main benefit of `DocumentModel`-based analysis is stronger TypeScript type constraints, the following sample is written in TypeScript using ECMAScript module syntax: - -```typescript -import { DocumentAnalysisClient, AzureKeyCredential } from "@azure/ai-form-recognizer"; - -// Copy the above-linked `DocumentModel` file so that it may be imported in this module. -import { PrebuiltLayoutModel } from "./prebuilt/prebuilt-layout"; - -import fs from "fs"; - -async function main() { - const endpoint = ""; - const apiKey = ""; - const path = ""; // pdf/jpeg/png/tiff formats - - const readStream = fs.createReadStream(path); - - const client = new DocumentAnalysisClient(endpoint, new AzureKeyCredential(apiKey)); - const poller = await client.beginAnalyzeDocument(PrebuiltLayoutModel, readStream); - const { pages, tables } = await poller.pollUntilDone(); - - for (const page of pages || []) { - console.log(`- Page ${page.pageNumber}: (${page.width}x${page.height} ${page.unit})`); - } - - for (const table of tables || []) { - console.log(`- Table (${table.columnCount}x${table.rowCount})`); - for (const cell of table.cells) { - console.log(` cell [${cell.rowIndex},${cell.columnIndex}] "${cell.content}"`); - } - } -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - -### Use the "document" prebuilt - - -**Breaking Change Warning** ⚠️: In previous `4.0.0-beta` versions of the Azure Form Recognizer SDK for JavaScript, the prebuilt document model was provided by a custom method named `beginExtractGeneralDocument`. This method was removed and replaced with an example `DocumentModel` instance named [`PrebuiltDocumentModel`][samples-prebuilt-document] for use with the same `beginAnalyzeDocument` method that is used to perform analysis with other prebuilt models. As previously, the model ID `"prebuilt-document"` may still be used directly. This change will align the `prebuilt-document` model with the other prebuilt models and enable us to continue to provide timely updates and ensure stability as the number of supported prebuilt models increases and as their capabilities are enhanced. - -The `"prebuilt-document"` model extracts information about key-value pairs (directed associations between page elements, such as labeled fields) in addition to the properties produced by the layout extraction method. This prebuilt (general) document model provides similar functionality to the custom models trained without label information in previous iterations of the Form Recognizer service, but it is now provided as a prebuilt model that works with a wide variety of documents. We provide a strongly-typed `DocumentModel` instance named [`PrebuiltDocumentModel`][samples-prebuilt-document] that invokes this model, or as always its model ID `"prebuilt-document"` may be used directly. - -Since the main benefit of `DocumentModel`-based analysis is stronger TypeScript type constraints, the following sample is written in TypeScript using ECMAScript module syntax: - -```typescript -import { DocumentAnalysisClient, AzureKeyCredential } from "@azure/ai-form-recognizer"; - -// Copy the above-linked `DocumentModel` file so that it may be imported in this module. -import { PrebuiltDocumentModel } from "./prebuilt/prebuilt-document"; - -import fs from "fs"; - -async function main() { - const endpoint = ""; - const apiKey = ""; - const path = ""; // pdf/jpeg/png/tiff formats - - const readStream = fs.createReadStream(path); - - const client = new DocumentAnalysisClient(endpoint, new AzureKeyCredential(apiKey)); - const poller = await client.beginAnalyzeDocument(PrebuiltDocumentModel, readStream); - - // `pages`, `tables` and `styles` are also available as in the "layout" example above, but for the sake of this - // example we won't show them here. - const { keyValuePairs } = await poller.pollUntilDone(); - - if (!keyValuePairs || keyValuePairs.length <= 0) { - console.log("No key-value pairs were extracted from the document."); - } else { - console.log("Key-Value Pairs:"); - for (const { key, value, confidence } of keyValuePairs) { - console.log("- Key :", `"${key.content}"`); - console.log(" Value:", `"${value?.content ?? ""}" (${confidence})`); - } - } -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - -### Use the "read" prebuilt - - -**Breaking Change Warning** ⚠️: In previous `4.0.0-beta` versions of the Azure Form Recognizer SDK for JavaScript, the prebuilt "read" model was provided by a custom method named `beginReadDocument`. This method was removed and replaced with an example `DocumentModel` instance named [`PrebuiltReadModel`][samples-prebuilt-read] for use with the same `beginAnalyzeDocument` method that is used to perform analysis with other prebuilt models. As previously, the model ID `"prebuilt-read"` may still be used directly. This change will align the `prebuilt-read` model with the other prebuilt models and enable us to continue to provide timely updates and ensure stability as the number of supported prebuilt models increases and as their capabilities are enhanced. - -The `"prebuilt-read"` model extracts textual information in a document such as words and paragraphs and analyzes the language and writing style (e.g. handwritten vs. typeset) of that text. We provide a strongly-typed `DocumentModel` instance named [`PrebuiltReadModel`][samples-prebuilt-document] that invokes this model, or as always its model ID `"prebuilt-read"` may be used directly. - -Since the main benefit of `DocumentModel`-based analysis is stronger TypeScript type constraints, the following sample is written in TypeScript using ECMAScript module syntax: - -```typescript -import { DocumentAnalysisClient, AzureKeyCredential } from "@azure/ai-form-recognizer"; - -// Copy the above-linked `DocumentModel` file so that it may be imported in this module. -import { PrebuiltReadModel } from "./prebuilt/prebuilt-read"; - -// See the samples directory for a definition of this helper function. -import { getTextOfSpans } from "./utils"; - -import fs from "fs"; - -async function main() { - const endpoint = ""; - const apiKey = ""; - const path = ""; // pdf/jpeg/png/tiff formats - - const readStream = fs.createReadStream(path); - - const client = new DocumentAnalysisClient(endpoint, new AzureKeyCredential(apiKey)); - const poller = await client.beginAnalyzeDocument(PrebuiltReadModel, readStream); - - // The "prebuilt-read" model (`beginReadDocument` method) only extracts information about the textual content of the - // document, such as page text elements, text styles, and information about the language of the text. - const { content, pages, languages } = await poller.pollUntilDone(); - - if (!pages || pages.length <= 0) { - console.log("No pages were extracted from the document."); - } else { - console.log("Pages:"); - for (const page of pages) { - console.log("- Page", page.pageNumber, `(unit: ${page.unit})`); - console.log(` ${page.width}x${page.height}, angle: ${page.angle}`); - console.log( - ` ${page.lines && page.lines.length} lines, ${page.words && page.words.length} words` - ); - - if (page.lines && page.lines.length > 0) { - console.log(" Lines:"); - - for (const line of page.lines) { - console.log(` - "${line.content}"`); - } - } - } - } - - if (!languages || languages.length <= 0) { - console.log("No language spans were extracted from the document."); - } else { - console.log("Languages:"); - for (const languageEntry of languages) { - console.log( - `- Found language: ${languageEntry.locale} (confidence: ${languageEntry.confidence})` - ); - - for (const text of getTextOfSpans(content, languageEntry.spans)) { - const escapedText = text.replace(/\r?\n/g, "\\n").replace(/"/g, '\\"'); - console.log(` - "${escapedText}"`); - } - } - } -} - -main().catch((error) => { - console.error("An error occurred:", error); - process.exit(1); -}); -``` - -### Classify a document - -The Form Recognizer service supports custom document classifiers that can classify documents into a set of predefined categories based on a training data set. Documents can be classified with a custom classifier using the `beginClassifyDocument` method of `DocumentAnalysisClient`. Like `beginAnalyzeDocument` above, this method accepts a file or stream containing the document to be classified, and it has a `beginClassifyDocumentFromUrl` counterpart that accepts a publicly-accessible URL to a document instead. - -The following sample shows how to classify a document using a custom classifier: - -```javascript -const { AzureKeyCredential, DocumentAnalysisClient } = require("@azure/ai-form-recognizer"); - -async function main() { - const endpoint = ""; - const credential = new AzureKeyCredential(""); - - const documentUrl = - "https://raw.githubusercontent.com/Azure/azure-sdk-for-js/main/sdk/formrecognizer/ai-form-recognizer/assets/invoice/Invoice_1.pdf"; - - const client = new DocumentAnalysisClient(endpoint, credential); - - const poller = await client.beginClassifyDocumentFromUrl("", documentUrl); - - const result = await poller.pollUntilDone(); - - if (result.documents === undefined || result.documents.length === 0) { - throw new Error("Failed to extract any documents."); - } - - for (const document of result.documents) { - console.log( - `Extracted a document with type '${document.docType}' on page ${document.boundingRegions?.[0].pageNumber} (confidence: ${document.confidence})` - ); - } -} - -main().catch((error) => { - console.error("An error occurred:", error); - process.exit(1); -}); -``` - -For information on training a custom classifier, see the [section on classifier training at the end of the next section](#build-classifier). - -### Build a model - -The SDK also supports creating models using the `DocumentModelAdministrationClient` class. Building a model from labeled training data creates a new model that is trained on your own documents, and the resulting model will be able to recognize values from the structures of those documents. The model building operation accepts a SAS-encoded URL to an Azure Storage Blob container that holds the training documents. The Form Recognizer service's infrastructure will read the files in the container and create a model based on their contents. For more details on how to create and structure a training data container, see the [Form Recognizer service's documentation for building a model][fr-build-model]. - -While we provide these methods for programmatic model creation, the Form Recognizer service team has created an interactive web application, [Form Recognizer Studio (Preview)][fr-studio], that enables creating and managing models on the web. - -For example, the following program builds a custom document model using a SAS-encoded URL to a pre-existing Azure Storage container: - -```javascript -const { - DocumentModelAdministrationClient, - AzureKeyCredential, -} = require("@azure/ai-form-recognizer"); - -async function main() { - const endpoint = ""; - const apiKey = ""; - const containerSasUrl = ""; - - const client = new DocumentModelAdministrationClient(endpoint, new AzureKeyCredential(apiKey)); - - // You must provide the model ID. It can be any text that does not start with "prebuilt-". - // For example, you could provide a randomly generated GUID using the "uuid" package. - // The second parameter is the SAS-encoded URL to an Azure Storage container with the training documents. - // The third parameter is the build mode: one of "template" (the only mode prior to 4.0.0-beta.3) or "neural". - // See https://aka.ms/azsdk/formrecognizer/buildmode for more information about build modes. - const poller = await client.beginBuildDocumentModel("", containerSasUrl, "template", { - // The model description is optional and can be any text. - description: "This is my new model!", - onProgress: ({ status }) => { - console.log(`operation status: ${status}`); - }, - }); - const model = await poller.pollUntilDone(); - - console.log("Model ID:", model.modelId); - console.log("Description:", model.description); - console.log("Created:", model.createdOn); - - // A model may contain several document types, which describe the possible object structures of fields extracted using - // this model - - console.log("Document Types:"); - for (const [docType, { description, fieldSchema: schema }] of Object.entries( - model.docTypes ?? {} - )) { - console.log(`- Name: "${docType}"`); - console.log(` Description: "${description}"`); - - // For simplicity, this example will only show top-level field names - console.log(" Fields:"); - - for (const [fieldName, fieldSchema] of Object.entries(schema)) { - console.log(` - "${fieldName}" (${fieldSchema.type})`); - console.log(` ${fieldSchema.description ?? ""}`); - } - } -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - - -Custom classifiers are built in a similar way using the `beginBuildDocumentClassifier` method rather than `beginBuildDocumentModel`. Please see the [build classifier sample][sample-build-classifier] for more information about building a custom classifier, as the input training data are provided in a slightly different format. For information about building a training data set for a custom classifier, see [the Form Recognizer service documentation](https://aka.ms/azsdk/formrecognizer/buildclassifiermodel). - -### Manage models - -`DocumentModelAdministrationClient` also provides several methods for accessing and listing models. The following example shows how to iterate through the models in a Form Recognizer resource (this will include both custom models in the resource as well as prebuilt models that are common to all resources), get a model by ID, and delete a model. - -```javascript -const { - DocumentModelAdministrationClient, - AzureKeyCredential, -} = require("@azure/ai-form-recognizer"); - -async function main() { - const endpoint = ""; - const apiKey = ""; - const client = new DocumentModelAdministrationClient(endpoint, new AzureKeyCredential(apiKey)); - - // Produces an async iterable that supports paging (`PagedAsyncIterableIterator`). The `listDocumentModels` method will only - // iterate over model summaries, which do not include detailed schema information. Schema information is only returned - // from `getDocumentModel` as part of the full model information. - const models = client.listDocumentModels(); - let i = 1; - for await (const summary of models) { - console.log(`Model ${i++}:`, summary); - } - - // The iterable is paged, and the application can control the flow of paging if needed - i = 1; - for await (const page of client.listDocumentModels().byPage()) { - for (const summary of page) { - console.log(`Model ${i++}`, summary); - } - } - - // We can also get a full ModelInfo by ID. Here we only show the basic information. See the documentation and the - // `getDocumentModel` sample program for information about the `docTypes` field, which contains the model's document type - // schemas. - const model = await client.getDocumentModel(""); - console.log("ID", model.modelId); - console.log("Created:", model.createdOn); - console.log("Description: ", model.description ?? ""); - - // A model can also be deleted by its model ID. Once it is deleted, it CANNOT be recovered. - const modelIdToDelete = ""; - await client.deleteDocumentModel(modelIdToDelete); -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - -Similar methods `listDocumentClassifiers` and `getDocumentClassifier` are available for listing and getting information about custom classifiers in addition to `deleteDocumentClassifier` for deleting custom classifiers. - -## Troubleshooting - -For assistance with troubleshooting, see the [troubleshooting guide][trouble-shooting]. - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples) directory for detailed code samples that show how to use this library including several features and methods that are not shown in the "Examples" section above, such as copying and composing models, listing model management operations, and deleting models. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fformrecognizer%2Fai-form-recognizer%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[fr_or_cs_resource]: /azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/identity/identity -[register_aad_app]: /azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/identity/identity#defaultazurecredential -[fr-build-model]: https://aka.ms/azsdk/formrecognizer/buildmodel -[build_sample]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples/v4-beta/typescript/src/buildModel.ts -[multi_and_single_service]: /azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows -[azure_portal_create_fr_resource]: https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesFormRecognizer -[azure_cli_create_fr_resource]: /azure/cognitive-services/cognitive-services-apis-create-account-cli?tabs=windows -[fr-labeling-tool]: https://aka.ms/azsdk/formrecognizer/labelingtool -[fr-studio]: https://formrecognizer.appliedai.azure.com/studio -[fr-build-training-set]: https://aka.ms/azsdk/formrecognizer/buildtrainingset -[fr-models]: https://aka.ms/azsdk/formrecognizer/models -[sample-build-classifier]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples/v4-beta/typescript/src/buildClassifier.ts -[samples-prebuilt]: https://github.com/azure/azure-sdk-for-js/tree/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/ -[samples-prebuilt-businesscard]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/prebuilt-businessCard.ts -[samples-prebuilt-document]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/prebuilt-document.ts -[samples-prebuilt-healthinsurancecard]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/prebuilt-healthInsuranceCard.ts -[samples-prebuilt-iddocument]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/prebuilt-idDocument.ts -[samples-prebuilt-invoice]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/prebuilt-invoice.ts -[samples-prebuilt-layout]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/prebuilt-layout.ts -[samples-prebuilt-read]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/prebuilt-read.ts -[samples-prebuilt-receipt]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/prebuilt-receipt.ts -[samples-prebuilt-tax.us.w2]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/samples-dev/prebuilt/prebuilt-tax.us.w2.ts -[trouble-shooting]: https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-form-recognizer_4.1.0-beta.1/sdk/formrecognizer/ai-form-recognizer/TROUBLESHOOTING.md - diff --git a/docs-ref-services/preview/ai-language-text-readme.md b/docs-ref-services/preview/ai-language-text-readme.md deleted file mode 100644 index e6fb11dbc435..000000000000 --- a/docs-ref-services/preview/ai-language-text-readme.md +++ /dev/null @@ -1,270 +0,0 @@ ---- -title: Azure Text Analysis client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/ai-language-text, cognitivelanguage -author: minhanh-phan -ms.author: minhanhphan -ms.date: 03/07/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: cognitivelanguage ---- -# Azure Text Analysis client library for JavaScript - version 1.1.0-beta.2 - - -[Azure Cognitive Service for Language](https://azure.microsoft.com/services/cognitive-services/language-service/) is a cloud-based service that provides advanced natural language processing over raw text, and includes the following main features: - -**Note:** This SDK targets Azure Cognitive Service for Language API version 2022-10-01-preview. - -- Language Detection -- Sentiment Analysis -- Key Phrase Extraction -- Named Entity Recognition -- Recognition of Personally Identifiable Information -- Entity Linking -- Healthcare Analysis -- Extractive Summarization -- Abstractive Summarization -- Custom Entity Recognition -- Custom Document Classification -- Dynamic Classification -- Support Multiple Actions Per Document - -Use the client library to: - -- Detect what language input text is written in. -- Determine what customers think of your brand or topic by analyzing raw text for clues about positive or negative sentiment. -- Automatically extract key phrases to quickly identify the main points. -- Identify and categorize entities in your text as people, places, organizations, date/time, quantities, percentages, currencies, healthcare specific, and more. -- Perform multiple of the above tasks at once. - -Key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/) -- [Package (NPM)](https://www.npmjs.com/package/@azure/ai-language-text) -- [API reference documentation](https://aka.ms/ai-language-text-js-api) -- [Product documentation](/azure/cognitive-services/language-service/) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples) - -#### **_Migrating from @azure/ai-text-analytics advisory_ ⚠️** - -Please see the [Migration Guide](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/MIGRATION_ai_text_analytics.md) for detailed instructions on how to update application code from version 5.x of the AI Text Analytics client library to the new AI Language Text client library. - -## What's New -* [Abstractive Summarization](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/Samples.md#abstractive-summarization) -* [Dynamic Classification](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/Samples.md#dynamic-classification) -* [Script Detection](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/Samples.md#language-detection) -* [Automatic Language Detection](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/Samples.md#automatic-language-detection) -* [Entity Resolutions](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/Samples.md#entity-resolutions) -* [Specifying healthcare document type for better FHIR results](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/Samples.md#healthcare-analysis) - - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. -- An existing [Cognitive Services][cognitive_resource] or Language resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli] following the steps in [this document][cli_docs]. - -If you use the Azure CLI, replace `` and `` with your own unique names: - -```PowerShell -az cognitiveservices account create --kind TextAnalytics --resource-group --name --sku --location -``` - -### Install the `@azure/ai-language-text` package - -Install the Azure Text Analysis client library for JavaScript with `npm`: - -```bash -npm install @azure/ai-language-text -``` - -### Create and authenticate a `TextAnalysisClient` - -To create a client object to access the Language API, you will need the `endpoint` of your Language resource and a `credential`. The Text Analysis client can use either Azure Active Directory credentials or an API key credential to authenticate. - -You can find the endpoint for your Language resource either in the [Azure Portal][azure_portal] or by using the [Azure CLI][azure_cli] snippet below: - -```bash -az cognitiveservices account show --name --resource-group --query "properties.endpoint" -``` - -#### Using an API Key - -Use the [Azure Portal][azure_portal] to browse to your Language resource and retrieve an API key, or use the [Azure CLI][azure_cli] snippet below: - -**Note:** Sometimes the API key is referred to as a "subscription key" or "subscription API key." - -```PowerShell -az cognitiveservices account keys list --resource-group --name -``` - -Once you have an API key and endpoint, you can use the `AzureKeyCredential` class to authenticate the client as follows: - -```javascript -const { TextAnalysisClient, AzureKeyCredential } = require("@azure/ai-language-text"); - -const client = new TextAnalysisClient("", 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, -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 Language 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`. - -```javascript -const { TextAnalysisClient } = require("@azure/ai-language-text"); -const { DefaultAzureCredential } = require("@azure/identity"); - -const client = new TextAnalysisClient("", new DefaultAzureCredential()); -``` - -## Key concepts - -### TextAnalysisClient - -`TextAnalysisClient` is the primary interface for developers using the Text Analysis client library. Explore the methods on this client object to understand the different features of the Language service that you can access. - -### Input - -A **document** represents a single unit of input to be analyzed by the predictive models in the Language service. Operations on `TextAnalysisClient` take a collection of inputs to be analyzed as a batch. The operation methods have overloads that allow the inputs to be represented as strings, or as objects with attached metadata. - -For example, each document can be passed as a string in an array, e.g. - -```typescript -const documents = [ - "I hated the movie. It was so slow!", - "The movie made it into my top ten favorites.", - "What a great movie!", -]; -``` - -or, if you wish to pass in a per-item document `id` or `language`/`countryHint`, they can be given as a list of `TextDocumentInput` or `DetectLanguageInput` depending on the operation; - -```javascript -const textDocumentInputs = [ - { id: "1", language: "en", text: "I hated the movie. It was so slow!" }, - { id: "2", language: "en", text: "The movie made it into my top ten favorites." }, - { id: "3", language: "en", text: "What a great movie!" }, -]; -``` - -See [service limitations][data_limits] for the input, including document length limits, maximum batch size, and supported text encodings. - -### Return Value - -The return value corresponding to a single document is either a successful result or an error object. Each `TextAnalysisClient` method returns a heterogeneous array of results and errors that correspond to the inputs by index. A text input and its result will have the same index in the input and result collections. - -An **result**, such as `SentimentAnalysisResult`, is the result of a Language operation, containing a prediction or predictions about a single text input. An operation's result type also may optionally include information about the input document and how it was processed. - -The **error** object, `TextAnalysisErrorResult`, indicates that the service encountered an error while processing the document and contains information about the error. - -### Document Error Handling - -In the collection returned by an operation, errors are distinguished from successful responses by the presence of the `error` property, which contains the inner `TextAnalysisError` object if an error was encountered. For successful result objects, this property is _always_ `undefined`. - -For example, to filter out all errors, you could use the following `filter`: - -```javascript -const results = await client.analyze("SentimentAnalysis", documents); -const onlySuccessful = results.filter((result) => result.error === undefined); -``` - -**Note**: TypeScript users can benefit from better type-checking of result and error objects if `compilerOptions.strictNullChecks` is set to `true` in the `tsconfig.json` configuration. For example: - -```typescript -const [result] = await client.analyze("SentimentAnalysis", ["Hello world!"]); - -if (result.error !== undefined) { - // In this if block, TypeScript will be sure that the type of `result` is - // `TextAnalysisError` if compilerOptions.strictNullChecks is enabled in - // the tsconfig.json - - console.log(result.error); -} -``` - -## Samples - -### Client Usage -* [Actions Batching](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/batching.ts) -* [Choose Model Version](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/modelVersion.ts) -* [Paging](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/paging.ts) -* [Rehydrate Polling](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/rehydratePolling.ts) -* [Get Statistics](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/stats.ts) - -### Prebuilt Tasks -* [Abstractive Summarization](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/abstractiveSummarization.ts) -* [Dynamic Classification](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/dynamicClassification.ts) -* [Language Detection](https://github.com/azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/Samples.md#language-detection) -* [Entity Linking](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/entityLinking.ts) -* [Entity Regconition](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/entityRecognition.ts) -* [Extractive Summarization](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/extractiveSummarization.ts) -* [Healthcare Analysis](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/healthcare.ts) -* [Key Phrase Extraction](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/keyPhraseExtraction.ts) -* [Language Detection](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/languageDetection.ts) -* [Opinion Mining](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/opinionMining.ts) -* [PII Entity Recognition](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/piiEntityRecognition.ts) -* [Sentiment Analysis](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/sentimentAnalysis.ts) - -### Custom Tasks -* [Custom Entity Recognition](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/customEntityRecognition.ts) -* [Custom Single-lable Classfication](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/customSingleLabelClassification.ts) -* [Custom Multi-lable Classfication](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples-dev/customMultiLabelClassification.ts) - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-language-text_1.1.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/ai-language-text_1.1.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcognitivelanguage%2Fai-language-text%2FREADME.png) - -[cli_docs]: https://learn.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account-cli?tabs=windows#prerequisites -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[cognitive_resource]: /azure/cognitive-services/cognitive-services-apis-create-account -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-language-text_1.1.0-beta.2/sdk/identity/identity -[cognitive_auth]: /azure/cognitive-services/authentication -[register_aad_app]: /azure/cognitive-services/authentication#assign-a-role-to-a-service-principal -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-language-text_1.1.0-beta.2/sdk/identity/identity#defaultazurecredential -[data_limits]: /azure/cognitive-services/language-service/concepts/data-limits -[analyze_sentiment_opinion_mining_sample]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/ai-language-text_1.1.0-beta.2/sdk/cognitivelanguage/ai-language-text/samples/v1-beta/javascript/opinionMining.js -[lang_studio]: /azure/cognitive-services/language-service/language-studio - diff --git a/docs-ref-services/preview/arm-analysisservices-readme.md b/docs-ref-services/preview/arm-analysisservices-readme.md deleted file mode 100644 index feb6cd31c4ed..000000000000 --- a/docs-ref-services/preview/arm-analysisservices-readme.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Azure Service client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-analysisservices, analysisservices -author: qiaozha -ms.author: qiaozha -ms.date: 11/30/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure-analysis-services ---- - -# Azure Service client library for JavaScript - version 4.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. - -The Azure Analysis Services Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Analysis Services servers - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-analysisservices_4.0.0-beta.1/sdk/analysisservices/arm-analysisservices) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-analysisservices) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-analysisservices?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-analysisservices` package - -Install the Azure Service client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-analysisservices -``` - -### Create and authenticate a `AzureAnalysisServices` - -To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-analysisservices_4.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { AzureAnalysisServices } = require("@azure/arm-analysisservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AzureAnalysisServices(new DefaultAzureCredential(), subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### AzureAnalysisServices - -`AzureAnalysisServices` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-analysisservices_4.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-analysisservices_4.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fanalysisservices%2Farm-analysisservices%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-analysisservices_4.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-analysisservices_4.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-apimanagement-readme.md b/docs-ref-services/preview/arm-apimanagement-readme.md deleted file mode 100644 index b948ca2871a2..000000000000 --- a/docs-ref-services/preview/arm-apimanagement-readme.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Azure ApiManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-apimanagement, apimanagement -author: maggiepint -ms.author: magpint -ms.date: 11/17/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: api-management ---- - -# Azure ApiManagement client library for JavaScript - version 8.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ApiManagement client. - -ApiManagement Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-apimanagement_8.0.0-beta.2/sdk/apimanagement/arm-apimanagement) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-apimanagement) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-apimanagement?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-apimanagement` package - -Install the Azure ApiManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-apimanagement -``` - -### Create and authenticate a `ApiManagementClient` - -To create a client object to access the Azure ApiManagement API, you will need the `endpoint` of your Azure ApiManagement resource and a `credential`. The Azure ApiManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ApiManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-apimanagement_8.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure ApiManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { ApiManagementClient } = require("@azure/arm-apimanagement"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ApiManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### ApiManagementClient - -`ApiManagementClient` is the primary interface for developers using the Azure ApiManagement client library. Explore the methods on this client object to understand the different features of the Azure ApiManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-apimanagement_8.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-apimanagement_8.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fapimanagement%2Farm-apimanagement%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-apimanagement_8.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-apimanagement_8.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-appconfiguration-readme.md b/docs-ref-services/preview/arm-appconfiguration-readme.md deleted file mode 100644 index 357e48580b9a..000000000000 --- a/docs-ref-services/preview/arm-appconfiguration-readme.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: Azure AppConfigurationManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-appconfiguration, appconfiguration -author: qiaozha -ms.author: qiaozha -ms.date: 04/15/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure-app-configuration ---- -# Azure AppConfigurationManagement client library for JavaScript - version 3.0.0-beta.4 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure AppConfigurationManagement client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appconfiguration_3.0.0-beta.4/sdk/appconfiguration/arm-appconfiguration) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-appconfiguration) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-appconfiguration?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-appconfiguration_3.0.0-beta.4/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-appconfiguration` package - -Install the Azure AppConfigurationManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-appconfiguration -``` - -### Create and authenticate a `AppConfigurationManagementClient` - -To create a client object to access the Azure AppConfigurationManagement API, you will need the `endpoint` of your Azure AppConfigurationManagement resource and a `credential`. The Azure AppConfigurationManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure AppConfigurationManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-appconfiguration_3.0.0-beta.4/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure AppConfigurationManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { AppConfigurationManagementClient } = require("@azure/arm-appconfiguration"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AppConfigurationManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new AppConfigurationManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### AppConfigurationManagementClient - -`AppConfigurationManagementClient` is the primary interface for developers using the Azure AppConfigurationManagement client library. Explore the methods on this client object to understand the different features of the Azure AppConfigurationManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appconfiguration_3.0.0-beta.4/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-appconfiguration_3.0.0-beta.4/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fappconfiguration%2Farm-appconfiguration%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appconfiguration_3.0.0-beta.4/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appconfiguration_3.0.0-beta.4/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-appcontainers-readme.md b/docs-ref-services/preview/arm-appcontainers-readme.md deleted file mode 100644 index 666c75a82058..000000000000 --- a/docs-ref-services/preview/arm-appcontainers-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure ContainerApps API client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-appcontainers, appcontainers -author: xirzec -ms.author: jeffish -ms.date: 05/24/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: appcontainers ---- -# Azure ContainerApps API client library for JavaScript - version 2.0.0-beta.3 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ContainerApps API client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appcontainers_2.0.0-beta.3/sdk/appcontainers/arm-appcontainers) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-appcontainers) | -[API reference documentation](/javascript/api/@azure/arm-appcontainers?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-appcontainers_2.0.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-appcontainers` package - -Install the Azure ContainerApps API client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-appcontainers -``` - -### Create and authenticate a `ContainerAppsAPIClient` - -To create a client object to access the Azure ContainerApps API API, you will need the `endpoint` of your Azure ContainerApps API resource and a `credential`. The Azure ContainerApps API client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ContainerApps API resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-appcontainers_2.0.0-beta.3/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure ContainerApps API** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { ContainerAppsAPIClient } = require("@azure/arm-appcontainers"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ContainerAppsAPIClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new ContainerAppsAPIClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### ContainerAppsAPIClient - -`ContainerAppsAPIClient` is the primary interface for developers using the Azure ContainerApps API client library. Explore the methods on this client object to understand the different features of the Azure ContainerApps API service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appcontainers_2.0.0-beta.3/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-appcontainers_2.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fappcontainers%2Farm-appcontainers%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appcontainers_2.0.0-beta.3/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appcontainers_2.0.0-beta.3/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-appservice-readme.md b/docs-ref-services/preview/arm-appservice-readme.md deleted file mode 100644 index 08ade60eadde..000000000000 --- a/docs-ref-services/preview/arm-appservice-readme.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: Azure WebSiteManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-appservice, appservice -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/15/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: app-service ---- - -# Azure WebSiteManagement client library for JavaScript - version 10.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure WebSiteManagement client. - -You can also follow this [link](https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/appservice/arm-appservice) to see the previous stable versions for this package. Note that they might not implement the guidelines(https://azure.github.io/azure-sdk/typescript_introduction.html) or have the same feature set as the new releases. - -WebSite Management Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appservice_10.0.0-beta.1/sdk/appservice/arm-appservice) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-appservice) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-appservice) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-appservice` package - -Install the Azure WebSiteManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-appservice -``` - -### Create and authenticate a `WebSiteManagementClient` - -To create a client object to access the Azure WebSiteManagement API, you will need the `endpoint` of your Azure WebSiteManagement resource and a `credential`. The Azure WebSiteManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure WebSiteManagement resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure WebSiteManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { WebSiteManagementClient } = require("@azure/arm-appservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new WebSiteManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### WebSiteManagementClient - -`WebSiteManagementClient` is the primary interface for developers using the Azure WebSiteManagement client library. Explore the methods on this client object to understand the different features of the Azure WebSiteManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appservice_10.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-appservice_10.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fappservice%2Farm-appservice%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appservice_10.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-appservice_10.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-batch-readme.md b/docs-ref-services/preview/arm-batch-readme.md deleted file mode 100644 index db73b16ebc01..000000000000 --- a/docs-ref-services/preview/arm-batch-readme.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Azure BatchManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-batch, batch -author: maggiepint -ms.author: magpint -ms.date: 11/22/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: batch ---- - -# Azure BatchManagement client library for JavaScript - version 7.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure BatchManagement client. - -Batch Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-batch_7.0.0-beta.1/sdk/batch/arm-batch) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-batch) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-batch?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-batch` package - -Install the Azure BatchManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-batch -``` - -### Create and authenticate a `BatchManagementClient` - -To create a client object to access the Azure BatchManagement API, you will need the `endpoint` of your Azure BatchManagement resource and a `credential`. The Azure BatchManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure BatchManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-batch_7.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure BatchManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { BatchManagementClient } = require("@azure/arm-batch"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new BatchManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### BatchManagementClient - -`BatchManagementClient` is the primary interface for developers using the Azure BatchManagement client library. Explore the methods on this client object to understand the different features of the Azure BatchManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-batch_7.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-batch_7.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fbatch%2Farm-batch%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-batch_7.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-batch_7.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-botservice-readme.md b/docs-ref-services/preview/arm-botservice-readme.md deleted file mode 100644 index eded36c17db6..000000000000 --- a/docs-ref-services/preview/arm-botservice-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure Bot client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-botservice, botservice -author: qiaozha -ms.author: qiaozha -ms.date: 11/21/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: botservice ---- -# Azure Bot client library for JavaScript - version 4.0.0-beta.5 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Bot client. - -Azure Bot Service is a platform for creating smart conversational agents. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-botservice_4.0.0-beta.5/sdk/botservice/arm-botservice) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-botservice) | -[API reference documentation](/javascript/api/@azure/arm-botservice?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-botservice_4.0.0-beta.5/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-botservice` package - -Install the Azure Bot client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-botservice -``` - -### Create and authenticate a `AzureBotService` - -To create a client object to access the Azure Bot API, you will need the `endpoint` of your Azure Bot resource and a `credential`. The Azure Bot client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Bot resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-botservice_4.0.0-beta.5/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Bot** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { AzureBotService } = require("@azure/arm-botservice"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AzureBotService(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new AzureBotService(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### AzureBotService - -`AzureBotService` is the primary interface for developers using the Azure Bot client library. Explore the methods on this client object to understand the different features of the Azure Bot service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-botservice_4.0.0-beta.5/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-botservice_4.0.0-beta.5/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fbotservice%2Farm-botservice%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-botservice_4.0.0-beta.5/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-botservice_4.0.0-beta.5/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-cdn-readme.md b/docs-ref-services/preview/arm-cdn-readme.md deleted file mode 100644 index f7313e66cafb..000000000000 --- a/docs-ref-services/preview/arm-cdn-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure CdnManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-cdn, cdn -author: maggiepint -ms.author: magpint -ms.date: 11/11/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure-cdn ---- - -# Azure CdnManagement client library for JavaScript - version 6.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure CdnManagement client. - -Cdn Management Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-cdn_6.0.0-beta.1/sdk/cdn/arm-cdn) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-cdn) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-cdn) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-cdn` package - -Install the Azure CdnManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-cdn -``` - -### Create and authenticate a `CdnManagementClient` - -To create a client object to access the Azure CdnManagement API, you will need the `endpoint` of your Azure CdnManagement resource and a `credential`. The Azure CdnManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure CdnManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-cdn_6.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure CdnManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { CdnManagementClient } = require("@azure/arm-cdn"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new CdnManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### CdnManagementClient - -`CdnManagementClient` is the primary interface for developers using the Azure CdnManagement client library. Explore the methods on this client object to understand the different features of the Azure CdnManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-cdn_6.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-cdn_6.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcdn%2Farm-cdn%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-cdn_6.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-cdn_6.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-commerce-profile-2020-09-01-hybrid-readme.md b/docs-ref-services/preview/arm-commerce-profile-2020-09-01-hybrid-readme.md deleted file mode 100644 index 99c28b2c86ad..000000000000 --- a/docs-ref-services/preview/arm-commerce-profile-2020-09-01-hybrid-readme.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: Azure UsageManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-commerce-profile-2020-09-01-hybrid, commerce -author: qiaozha -ms.author: qiaozha -ms.date: 03/10/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- -# Azure UsageManagement client library for JavaScript - version 2.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure UsageManagement client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-commerce-profile-2020-09-01-hybrid_2.0.0-beta.1/sdk/commerce/arm-commerce-profile-2020-09-01-hybrid) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-commerce-profile-2020-09-01-hybrid) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-commerce-profile-2020-09-01-hybrid?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-commerce-profile-2020-09-01-hybrid_2.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-commerce-profile-2020-09-01-hybrid` package - -Install the Azure UsageManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-commerce-profile-2020-09-01-hybrid -``` - -### Create and authenticate a `UsageManagementClient` - -To create a client object to access the Azure UsageManagement API, you will need the `endpoint` of your Azure UsageManagement resource and a `credential`. The Azure UsageManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure UsageManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-commerce-profile-2020-09-01-hybrid_2.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure UsageManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { UsageManagementClient } = require("@azure/arm-commerce-profile-2020-09-01-hybrid"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new UsageManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new UsageManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### UsageManagementClient - -`UsageManagementClient` is the primary interface for developers using the Azure UsageManagement client library. Explore the methods on this client object to understand the different features of the Azure UsageManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-commerce-profile-2020-09-01-hybrid_2.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-commerce-profile-2020-09-01-hybrid_2.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommerce%2Farm-commerce-profile-2020-09-01-hybrid%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-commerce-profile-2020-09-01-hybrid_2.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-commerce-profile-2020-09-01-hybrid_2.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-compute-readme.md b/docs-ref-services/preview/arm-compute-readme.md deleted file mode 100644 index cf48b620f55a..000000000000 --- a/docs-ref-services/preview/arm-compute-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure ComputeManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-compute, compute -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/18/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure ComputeManagement client library for JavaScript - version 17.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ComputeManagement client. - -Compute Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-compute_17.0.0-beta.2/sdk/compute/arm-compute) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-compute) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-compute) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-compute` package - -Install the Azure ComputeManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-compute -``` - -### Create and authenticate a `ComputeManagementClient` - -To create a client object to access the Azure ComputeManagement API, you will need the `endpoint` of your Azure ComputeManagement resource and a `credential`. The Azure ComputeManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ComputeManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-compute_17.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure ComputeManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { ComputeManagementClient } = require("@azure/arm-compute"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ComputeManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### ComputeManagementClient - -`ComputeManagementClient` is the primary interface for developers using the Azure ComputeManagement client library. Explore the methods on this client object to understand the different features of the Azure ComputeManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-compute_17.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-compute_17.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcompute%2Farm-compute%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-compute_17.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-compute_17.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-consumption-readme.md b/docs-ref-services/preview/arm-consumption-readme.md deleted file mode 100644 index d76a4a1c0f26..000000000000 --- a/docs-ref-services/preview/arm-consumption-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure ConsumptionManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-consumption, consumption -author: maggiepint -ms.author: magpint -ms.date: 11/16/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure ConsumptionManagement client library for JavaScript - version 9.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ConsumptionManagement client. - -Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-consumption_9.0.0-beta.1/sdk/consumption/arm-consumption) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-consumption) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-consumption) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-consumption` package - -Install the Azure ConsumptionManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-consumption -``` - -### Create and authenticate a `ConsumptionManagementClient` - -To create a client object to access the Azure ConsumptionManagement API, you will need the `endpoint` of your Azure ConsumptionManagement resource and a `credential`. The Azure ConsumptionManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ConsumptionManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-consumption_9.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure ConsumptionManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { ConsumptionManagementClient } = require("@azure/arm-consumption"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ConsumptionManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### ConsumptionManagementClient - -`ConsumptionManagementClient` is the primary interface for developers using the Azure ConsumptionManagement client library. Explore the methods on this client object to understand the different features of the Azure ConsumptionManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-consumption_9.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-consumption_9.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fconsumption%2Farm-consumption%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-consumption_9.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-consumption_9.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-containerinstance-readme.md b/docs-ref-services/preview/arm-containerinstance-readme.md deleted file mode 100644 index 060f5058ef0d..000000000000 --- a/docs-ref-services/preview/arm-containerinstance-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure ContainerInstanceManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-containerinstance, containerinstance -author: xirzec -ms.author: jeffish -ms.date: 04/21/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: containerinstance ---- -# Azure ContainerInstanceManagement client library for JavaScript - version 9.1.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ContainerInstanceManagement client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-containerinstance_9.1.0-beta.2/sdk/containerinstance/arm-containerinstance) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-containerinstance) | -[API reference documentation](/javascript/api/@azure/arm-containerinstance?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-containerinstance_9.1.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-containerinstance` package - -Install the Azure ContainerInstanceManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-containerinstance -``` - -### Create and authenticate a `ContainerInstanceManagementClient` - -To create a client object to access the Azure ContainerInstanceManagement API, you will need the `endpoint` of your Azure ContainerInstanceManagement resource and a `credential`. The Azure ContainerInstanceManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ContainerInstanceManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-containerinstance_9.1.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure ContainerInstanceManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { ContainerInstanceManagementClient } = require("@azure/arm-containerinstance"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ContainerInstanceManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new ContainerInstanceManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### ContainerInstanceManagementClient - -`ContainerInstanceManagementClient` is the primary interface for developers using the Azure ContainerInstanceManagement client library. Explore the methods on this client object to understand the different features of the Azure ContainerInstanceManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-containerinstance_9.1.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-containerinstance_9.1.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcontainerinstance%2Farm-containerinstance%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-containerinstance_9.1.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-containerinstance_9.1.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-cosmosdbforpostgresql-readme.md b/docs-ref-services/preview/arm-cosmosdbforpostgresql-readme.md deleted file mode 100644 index 6a75669cf4bd..000000000000 --- a/docs-ref-services/preview/arm-cosmosdbforpostgresql-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure CosmosDbForPostgreSQL client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-cosmosdbforpostgresql, cosmosforpostgresql -author: xirzec -ms.author: jeffish -ms.date: 06/21/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: cosmosforpostgresql ---- -# Azure CosmosDbForPostgreSQL client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure CosmosDbForPostgreSQL client. - -Azure Cosmos DB for PostgreSQL database service resource provider REST APIs - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-cosmosdbforpostgresql_1.0.0-beta.1/sdk/cosmosforpostgresql/arm-cosmosdbforpostgresql) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-cosmosdbforpostgresql) | -[API reference documentation](/javascript/api/@azure/arm-cosmosdbforpostgresql) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-cosmosdbforpostgresql_1.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-cosmosdbforpostgresql` package - -Install the Azure CosmosDbForPostgreSQL client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-cosmosdbforpostgresql -``` - -### Create and authenticate a `CosmosDBForPostgreSQL` - -To create a client object to access the Azure CosmosDbForPostgreSQL API, you will need the `endpoint` of your Azure CosmosDbForPostgreSQL resource and a `credential`. The Azure CosmosDbForPostgreSQL client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure CosmosDbForPostgreSQL resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-cosmosdbforpostgresql_1.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure CosmosDbForPostgreSQL** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { CosmosDBForPostgreSQL } = require("@azure/arm-cosmosdbforpostgresql"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new CosmosDBForPostgreSQL(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new CosmosDBForPostgreSQL(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### CosmosDBForPostgreSQL - -`CosmosDBForPostgreSQL` is the primary interface for developers using the Azure CosmosDbForPostgreSQL client library. Explore the methods on this client object to understand the different features of the Azure CosmosDbForPostgreSQL service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-cosmosdbforpostgresql_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-cosmosdbforpostgresql_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcosmosforpostgresql%2Farm-cosmosdbforpostgresql%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-cosmosdbforpostgresql_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-cosmosdbforpostgresql_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-dashboard-readme.md b/docs-ref-services/preview/arm-dashboard-readme.md deleted file mode 100644 index 6cf18c292db7..000000000000 --- a/docs-ref-services/preview/arm-dashboard-readme.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: Azure DashboardManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-dashboard, dashboard -author: xirzec -ms.author: jeffish -ms.date: 04/13/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- -# Azure DashboardManagement client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DashboardManagement client. - -The Microsoft.Dashboard Rest API spec. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dashboard_1.0.0-beta.1/sdk/dashboard/arm-dashboard) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-dashboard) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dashboard?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dashboard_1.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-dashboard` package - -Install the Azure DashboardManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-dashboard -``` - -### Create and authenticate a `DashboardManagementClient` - -To create a client object to access the Azure DashboardManagement API, you will need the `endpoint` of your Azure DashboardManagement resource and a `credential`. The Azure DashboardManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure DashboardManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dashboard_1.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure DashboardManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DashboardManagementClient } = require("@azure/arm-dashboard"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DashboardManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DashboardManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DashboardManagementClient - -`DashboardManagementClient` is the primary interface for developers using the Azure DashboardManagement client library. Explore the methods on this client object to understand the different features of the Azure DashboardManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dashboard_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dashboard_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdashboard%2Farm-dashboard%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dashboard_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dashboard_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-databox-readme.md b/docs-ref-services/preview/arm-databox-readme.md deleted file mode 100644 index a6db21bae5a3..000000000000 --- a/docs-ref-services/preview/arm-databox-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure DataBoxManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-databox, databox -author: qiaozha -ms.author: qiaozha -ms.date: 11/29/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: databox ---- -# Azure DataBoxManagement client library for JavaScript - version 5.0.0-beta.3 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DataBoxManagement client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-databox_5.0.0-beta.3/sdk/databox/arm-databox) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-databox) | -[API reference documentation](/javascript/api/@azure/arm-databox?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-databox_5.0.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-databox` package - -Install the Azure DataBoxManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-databox -``` - -### Create and authenticate a `DataBoxManagementClient` - -To create a client object to access the Azure DataBoxManagement API, you will need the `endpoint` of your Azure DataBoxManagement resource and a `credential`. The Azure DataBoxManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure DataBoxManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-databox_5.0.0-beta.3/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure DataBoxManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DataBoxManagementClient } = require("@azure/arm-databox"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DataBoxManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DataBoxManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DataBoxManagementClient - -`DataBoxManagementClient` is the primary interface for developers using the Azure DataBoxManagement client library. Explore the methods on this client object to understand the different features of the Azure DataBoxManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-databox_5.0.0-beta.3/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-databox_5.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdatabox%2Farm-databox%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-databox_5.0.0-beta.3/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-databox_5.0.0-beta.3/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-datafactory-readme.md b/docs-ref-services/preview/arm-datafactory-readme.md deleted file mode 100644 index a7e619b78630..000000000000 --- a/docs-ref-services/preview/arm-datafactory-readme.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Azure DataFactoryManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-datafactory, datafactory -author: maggiepint -ms.author: magpint -ms.date: 11/24/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: data-factory ---- - -# Azure DataFactoryManagement client library for JavaScript - version 10.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DataFactoryManagement client. - -The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-datafactory_10.0.0-beta.1/sdk/datafactory/arm-datafactory) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-datafactory) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-datafactory?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-datafactory` package - -Install the Azure DataFactoryManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-datafactory -``` - -### Create and authenticate a `DataFactoryManagementClient` - -To create a client object to access the Azure DataFactoryManagement API, you will need the `endpoint` of your Azure DataFactoryManagement resource and a `credential`. The Azure DataFactoryManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure DataFactoryManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-datafactory_10.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure DataFactoryManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DataFactoryManagementClient } = require("@azure/arm-datafactory"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DataFactoryManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DataFactoryManagementClient - -`DataFactoryManagementClient` is the primary interface for developers using the Azure DataFactoryManagement client library. Explore the methods on this client object to understand the different features of the Azure DataFactoryManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-datafactory_10.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-datafactory_10.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdatafactory%2Farm-datafactory%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-datafactory_10.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-datafactory_10.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-dataprotection-readme.md b/docs-ref-services/preview/arm-dataprotection-readme.md deleted file mode 100644 index 95699636d1ba..000000000000 --- a/docs-ref-services/preview/arm-dataprotection-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure Data Protection client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-dataprotection, dataprotection -author: xirzec -ms.author: jeffish -ms.date: 02/20/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: dataprotection ---- -# Azure Data Protection client library for JavaScript - version 1.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Data Protection client. - -Open API 2.0 Specs for Azure Data Protection service - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dataprotection_1.0.0-beta.2/sdk/dataprotection/arm-dataprotection) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-dataprotection) | -[API reference documentation](/javascript/api/@azure/arm-dataprotection) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dataprotection_1.0.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-dataprotection` package - -Install the Azure Data Protection client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-dataprotection -``` - -### Create and authenticate a `DataProtectionClient` - -To create a client object to access the Azure Data Protection API, you will need the `endpoint` of your Azure Data Protection resource and a `credential`. The Azure Data Protection client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Data Protection resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dataprotection_1.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Data Protection** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DataProtectionClient } = require("@azure/arm-dataprotection"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DataProtectionClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DataProtectionClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DataProtectionClient - -`DataProtectionClient` is the primary interface for developers using the Azure Data Protection client library. Explore the methods on this client object to understand the different features of the Azure Data Protection service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dataprotection_1.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dataprotection_1.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdataprotection%2Farm-dataprotection%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dataprotection_1.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dataprotection_1.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-desktopvirtualization-readme.md b/docs-ref-services/preview/arm-desktopvirtualization-readme.md deleted file mode 100644 index 2b43827d1769..000000000000 --- a/docs-ref-services/preview/arm-desktopvirtualization-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure Desktop Virtualization API client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-desktopvirtualization, desktopvirtualization -author: qiaozha -ms.author: qiaozha -ms.date: 11/24/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: desktopvirtualization ---- -# Azure Desktop Virtualization API client library for JavaScript - version 1.0.0-beta.4 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Desktop Virtualization API client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-desktopvirtualization_1.0.0-beta.4/sdk/desktopvirtualization/arm-desktopvirtualization) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-desktopvirtualization) | -[API reference documentation](/javascript/api/@azure/arm-desktopvirtualization?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-desktopvirtualization_1.0.0-beta.4/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-desktopvirtualization` package - -Install the Azure Desktop Virtualization API client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-desktopvirtualization -``` - -### Create and authenticate a `DesktopVirtualizationAPIClient` - -To create a client object to access the Azure Desktop Virtualization API API, you will need the `endpoint` of your Azure Desktop Virtualization API resource and a `credential`. The Azure Desktop Virtualization API client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Desktop Virtualization API resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-desktopvirtualization_1.0.0-beta.4/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Desktop Virtualization API** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DesktopVirtualizationAPIClient } = require("@azure/arm-desktopvirtualization"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DesktopVirtualizationAPIClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DesktopVirtualizationAPIClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DesktopVirtualizationAPIClient - -`DesktopVirtualizationAPIClient` is the primary interface for developers using the Azure Desktop Virtualization API client library. Explore the methods on this client object to understand the different features of the Azure Desktop Virtualization API service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-desktopvirtualization_1.0.0-beta.4/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-desktopvirtualization_1.0.0-beta.4/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdesktopvirtualization%2Farm-desktopvirtualization%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-desktopvirtualization_1.0.0-beta.4/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-desktopvirtualization_1.0.0-beta.4/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-devcenter-readme.md b/docs-ref-services/preview/arm-devcenter-readme.md deleted file mode 100644 index 3b7d29562fb0..000000000000 --- a/docs-ref-services/preview/arm-devcenter-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure DevCenter client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-devcenter, devcenter -author: xirzec -ms.author: jeffish -ms.date: 12/19/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: devcenter ---- -# Azure DevCenter client library for JavaScript - version 1.0.0-beta.4 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DevCenter client. - -DevCenter Management API - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-devcenter_1.0.0-beta.4/sdk/devcenter/arm-devcenter) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-devcenter) | -[API reference documentation](/javascript/api/@azure/arm-devcenter?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-devcenter_1.0.0-beta.4/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-devcenter` package - -Install the Azure DevCenter client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-devcenter -``` - -### Create and authenticate a `DevCenterClient` - -To create a client object to access the Azure DevCenter API, you will need the `endpoint` of your Azure DevCenter resource and a `credential`. The Azure DevCenter client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure DevCenter resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-devcenter_1.0.0-beta.4/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure DevCenter** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DevCenterClient } = require("@azure/arm-devcenter"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DevCenterClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DevCenterClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DevCenterClient - -`DevCenterClient` is the primary interface for developers using the Azure DevCenter client library. Explore the methods on this client object to understand the different features of the Azure DevCenter service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-devcenter_1.0.0-beta.4/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-devcenter_1.0.0-beta.4/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdevcenter%2Farm-devcenter%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-devcenter_1.0.0-beta.4/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-devcenter_1.0.0-beta.4/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-deviceupdate-readme.md b/docs-ref-services/preview/arm-deviceupdate-readme.md deleted file mode 100644 index 79738a951c2a..000000000000 --- a/docs-ref-services/preview/arm-deviceupdate-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure DeviceUpdate client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-deviceupdate, deviceupdate -author: xirzec -ms.author: jeffish -ms.date: 07/14/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: deviceupdate ---- -# Azure DeviceUpdate client library for JavaScript - version 1.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DeviceUpdate client. - -Microsoft Device Update resource provider. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-deviceupdate_1.0.0-beta.2/sdk/deviceupdate/arm-deviceupdate) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-deviceupdate) | -[API reference documentation](/javascript/api/@azure/arm-deviceupdate?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-deviceupdate_1.0.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-deviceupdate` package - -Install the Azure DeviceUpdate client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-deviceupdate -``` - -### Create and authenticate a `DeviceUpdate` - -To create a client object to access the Azure DeviceUpdate API, you will need the `endpoint` of your Azure DeviceUpdate resource and a `credential`. The Azure DeviceUpdate client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure DeviceUpdate resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-deviceupdate_1.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure DeviceUpdate** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DeviceUpdate } = require("@azure/arm-deviceupdate"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DeviceUpdate(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DeviceUpdate(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DeviceUpdate - -`DeviceUpdate` is the primary interface for developers using the Azure DeviceUpdate client library. Explore the methods on this client object to understand the different features of the Azure DeviceUpdate service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-deviceupdate_1.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-deviceupdate_1.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdeviceupdate%2Farm-deviceupdate%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-deviceupdate_1.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-deviceupdate_1.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-devtestlabs-readme.md b/docs-ref-services/preview/arm-devtestlabs-readme.md deleted file mode 100644 index 652dbead70a8..000000000000 --- a/docs-ref-services/preview/arm-devtestlabs-readme.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Azure DevTestLabs client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-devtestlabs, devtestlabs -author: qiaozha -ms.author: qiaozha -ms.date: 12/02/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: devtest-lab ---- - -# Azure DevTestLabs client library for JavaScript - version 4.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DevTestLabs client. - -The DevTest Labs Client. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-devtestlabs_4.0.0-beta.1/sdk/devtestlabs/arm-devtestlabs) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-devtestlabs) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-devtestlabs?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-devtestlabs` package - -Install the Azure DevTestLabs client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-devtestlabs -``` - -### Create and authenticate a `DevTestLabsClient` - -To create a client object to access the Azure DevTestLabs API, you will need the `endpoint` of your Azure DevTestLabs resource and a `credential`. The Azure DevTestLabs client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure DevTestLabs resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-devtestlabs_4.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure DevTestLabs** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DevTestLabsClient } = require("@azure/arm-devtestlabs"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DevTestLabsClient(new DefaultAzureCredential(), subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DevTestLabsClient - -`DevTestLabsClient` is the primary interface for developers using the Azure DevTestLabs client library. Explore the methods on this client object to understand the different features of the Azure DevTestLabs service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-devtestlabs_4.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-devtestlabs_4.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdevtestlabs%2Farm-devtestlabs%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-devtestlabs_4.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-devtestlabs_4.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-digitaltwins-readme.md b/docs-ref-services/preview/arm-digitaltwins-readme.md deleted file mode 100644 index 5d143ae8d87d..000000000000 --- a/docs-ref-services/preview/arm-digitaltwins-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: -keywords: Azure, javascript, SDK, API, @azure/arm-digitaltwins, digitaltwins -author: qiaozha -ms.author: qiaozha -ms.date: 03/08/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: digital-twins ---- -# AzureDigitalTwinsManagement client library for JavaScript - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureDigitalTwinsManagement client. - -Azure Digital Twins Client for managing DigitalTwinsInstance - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-digitaltwins_3.1.0-beta.1/sdk/digitaltwins/arm-digitaltwins) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-digitaltwins) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-digitaltwins?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-digitaltwins_3.1.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-digitaltwins` package - -Install the AzureDigitalTwinsManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-digitaltwins -``` - -### Create and authenticate a `AzureDigitalTwinsManagementClient` - -To create a client object to access the AzureDigitalTwinsManagement API, you will need the `endpoint` of your AzureDigitalTwinsManagement resource and a `credential`. The AzureDigitalTwinsManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your AzureDigitalTwinsManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-digitaltwins_3.1.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to AzureDigitalTwinsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { AzureDigitalTwinsManagementClient } = require("@azure/arm-digitaltwins"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AzureDigitalTwinsManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new AzureDigitalTwinsManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### AzureDigitalTwinsManagementClient - -`AzureDigitalTwinsManagementClient` is the primary interface for developers using the AzureDigitalTwinsManagement client library. Explore the methods on this client object to understand the different features of the AzureDigitalTwinsManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-digitaltwins_3.1.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-digitaltwins_3.1.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdigitaltwins%2Farm-digitaltwins%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-digitaltwins_3.1.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-digitaltwins_3.1.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-dnsresolver-readme.md b/docs-ref-services/preview/arm-dnsresolver-readme.md deleted file mode 100644 index 622715ff8068..000000000000 --- a/docs-ref-services/preview/arm-dnsresolver-readme.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: Azure DnsResolverManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-dnsresolver, dnsresolver -author: qiaozha -ms.author: qiaozha -ms.date: 04/20/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: dns ---- -# Azure DnsResolverManagement client library for JavaScript - version 1.0.0-beta.3 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DnsResolverManagement client. - -The DNS Resolver Management Client. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dnsresolver_1.0.0-beta.3/sdk/dnsresolver/arm-dnsresolver) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-dnsresolver) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-dnsresolver?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dnsresolver_1.0.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-dnsresolver` package - -Install the Azure DnsResolverManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-dnsresolver -``` - -### Create and authenticate a `DnsResolverManagementClient` - -To create a client object to access the Azure DnsResolverManagement API, you will need the `endpoint` of your Azure DnsResolverManagement resource and a `credential`. The Azure DnsResolverManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure DnsResolverManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dnsresolver_1.0.0-beta.3/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure DnsResolverManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DnsResolverManagementClient } = require("@azure/arm-dnsresolver"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DnsResolverManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DnsResolverManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DnsResolverManagementClient - -`DnsResolverManagementClient` is the primary interface for developers using the Azure DnsResolverManagement client library. Explore the methods on this client object to understand the different features of the Azure DnsResolverManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dnsresolver_1.0.0-beta.3/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dnsresolver_1.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdnsresolver%2Farm-dnsresolver%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dnsresolver_1.0.0-beta.3/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dnsresolver_1.0.0-beta.3/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-dynatrace-readme.md b/docs-ref-services/preview/arm-dynatrace-readme.md deleted file mode 100644 index b54e84a614e4..000000000000 --- a/docs-ref-services/preview/arm-dynatrace-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure DynatraceObservability client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-dynatrace, dynatrace -author: xirzec -ms.author: jeffish -ms.date: 07/12/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: dynatrace ---- -# Azure DynatraceObservability client library for JavaScript - version 1.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DynatraceObservability client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dynatrace_1.0.0-beta.2/sdk/dynatrace/arm-dynatrace) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-dynatrace) | -[API reference documentation](/javascript/api/@azure/arm-dynatrace?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dynatrace_1.0.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-dynatrace` package - -Install the Azure DynatraceObservability client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-dynatrace -``` - -### Create and authenticate a `DynatraceObservability` - -To create a client object to access the Azure DynatraceObservability API, you will need the `endpoint` of your Azure DynatraceObservability resource and a `credential`. The Azure DynatraceObservability client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure DynatraceObservability resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dynatrace_1.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure DynatraceObservability** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { DynatraceObservability } = require("@azure/arm-dynatrace"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new DynatraceObservability(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DynatraceObservability(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### DynatraceObservability - -`DynatraceObservability` is the primary interface for developers using the Azure DynatraceObservability client library. Explore the methods on this client object to understand the different features of the Azure DynatraceObservability service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dynatrace_1.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-dynatrace_1.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdynatrace%2Farm-dynatrace%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dynatrace_1.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-dynatrace_1.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-features-readme.md b/docs-ref-services/preview/arm-features-readme.md deleted file mode 100644 index 2a140032779e..000000000000 --- a/docs-ref-services/preview/arm-features-readme.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Azure Feature client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-features, features -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/15/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure Feature client library for JavaScript - version 3.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Feature client. - -Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to control feature exposure to users. Resource providers typically use this mechanism to provide public/private preview for new features prior to making them generally available. Users need to explicitly register for AFEC features to get access to such functionality. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-features_3.0.0-beta.1/sdk/features/arm-features) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-features) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-features) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-features` package - -Install the Azure Feature client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-features -``` - -### Create and authenticate a `FeatureClient` - -To create a client object to access the Azure Feature API, you will need the `endpoint` of your Azure Feature resource and a `credential`. The Azure Feature client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Feature resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure Feature by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -```javascript -const { FeatureClient } = require("@azure/arm-features"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new FeatureClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### FeatureClient - -`FeatureClient` is the primary interface for developers using the Azure Feature client library. Explore the methods on this client object to understand the different features of the Azure Feature service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-features_3.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-features_3.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ffeatures%2Farm-features%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-features_3.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-features_3.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-graphservices-readme.md b/docs-ref-services/preview/arm-graphservices-readme.md deleted file mode 100644 index 9a8d5b368421..000000000000 --- a/docs-ref-services/preview/arm-graphservices-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure GraphServices client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-graphservices, graphservices -author: xirzec -ms.author: jeffish -ms.date: 03/21/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: graphservices ---- -# Azure GraphServices client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure GraphServices client. - -Self service experience for Microsoft Graph metered services - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-graphservices_1.0.0-beta.1/sdk/graphservices/arm-graphservices) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-graphservices) | -[API reference documentation](/javascript/api/@azure/arm-graphservices?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-graphservices_1.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-graphservices` package - -Install the Azure GraphServices client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-graphservices -``` - -### Create and authenticate a `GraphServices` - -To create a client object to access the Azure GraphServices API, you will need the `endpoint` of your Azure GraphServices resource and a `credential`. The Azure GraphServices client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure GraphServices resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-graphservices_1.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure GraphServices** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { GraphServices } = require("@azure/arm-graphservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new GraphServices(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new GraphServices(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### GraphServices - -`GraphServices` is the primary interface for developers using the Azure GraphServices client library. Explore the methods on this client object to understand the different features of the Azure GraphServices service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-graphservices_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-graphservices_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fgraphservices%2Farm-graphservices%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-graphservices_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-graphservices_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-hybridconnectivity-readme.md b/docs-ref-services/preview/arm-hybridconnectivity-readme.md deleted file mode 100644 index f03707e6a13b..000000000000 --- a/docs-ref-services/preview/arm-hybridconnectivity-readme.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: Azure HybridConnectivityManagementApi client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-hybridconnectivity, hybridconnectivity -author: xirzec -ms.author: jeffish -ms.date: 09/07/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: hybridconnectivity ---- -# Azure HybridConnectivityManagementApi client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure HybridConnectivityManagementApi client. - -REST API for Hybrid Connectivity - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-hybridconnectivity_1.0.0-beta.1/sdk/hybridconnectivity/arm-hybridconnectivity) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-hybridconnectivity) | -[API reference documentation](/javascript/api/@azure/arm-hybridconnectivity?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-hybridconnectivity_1.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-hybridconnectivity` package - -Install the Azure HybridConnectivityManagementApi client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-hybridconnectivity -``` - -### Create and authenticate a `HybridConnectivityManagementAPI` - -To create a client object to access the Azure HybridConnectivityManagementApi API, you will need the `endpoint` of your Azure HybridConnectivityManagementApi resource and a `credential`. The Azure HybridConnectivityManagementApi client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure HybridConnectivityManagementApi resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-hybridconnectivity_1.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure HybridConnectivityManagementApi** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const client = new HybridConnectivityManagementAPI(new DefaultAzureCredential()); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new HybridConnectivityManagementAPI(credential); -``` - -### JavaScript Bundle - -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### HybridConnectivityManagementAPI - -`HybridConnectivityManagementAPI` is the primary interface for developers using the Azure HybridConnectivityManagementApi client library. Explore the methods on this client object to understand the different features of the Azure HybridConnectivityManagementApi service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-hybridconnectivity_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-hybridconnectivity_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fhybridconnectivity%2Farm-hybridconnectivity%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-hybridconnectivity_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-hybridconnectivity_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-iothub-readme.md b/docs-ref-services/preview/arm-iothub-readme.md deleted file mode 100644 index 2a94d1605930..000000000000 --- a/docs-ref-services/preview/arm-iothub-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure iotHub client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-iothub, iothub -author: xirzec -ms.author: jeffish -ms.date: 09/14/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: iothub ---- -# Azure iotHub client library for JavaScript - version 6.3.0-beta.3 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure iotHub client. - -Use this API to manage the IoT hubs in your Azure subscription. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-iothub_6.3.0-beta.3/sdk/iothub/arm-iothub) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-iothub) | -[API reference documentation](/javascript/api/@azure/arm-iothub?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-iothub_6.3.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-iothub` package - -Install the Azure iotHub client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-iothub -``` - -### Create and authenticate a `IotHubClient` - -To create a client object to access the Azure iotHub API, you will need the `endpoint` of your Azure iotHub resource and a `credential`. The Azure iotHub client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure iotHub resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-iothub_6.3.0-beta.3/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure iotHub** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { IotHubClient } = require("@azure/arm-iothub"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new IotHubClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new IotHubClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### IotHubClient - -`IotHubClient` is the primary interface for developers using the Azure iotHub client library. Explore the methods on this client object to understand the different features of the Azure iotHub service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-iothub_6.3.0-beta.3/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-iothub_6.3.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fiothub%2Farm-iothub%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-iothub_6.3.0-beta.3/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-iothub_6.3.0-beta.3/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-keyvault-readme.md b/docs-ref-services/preview/arm-keyvault-readme.md deleted file mode 100644 index 8f6aa89730b7..000000000000 --- a/docs-ref-services/preview/arm-keyvault-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure KeyVaultManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-keyvault, keyvault -author: qiaozha -ms.author: qiaozha -ms.date: 12/02/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: keyvault ---- -# Azure KeyVaultManagement client library for JavaScript - version 2.1.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure KeyVaultManagement client. - -The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-keyvault_2.1.0-beta.2/sdk/keyvault/arm-keyvault) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-keyvault) | -[API reference documentation](/javascript/api/@azure/arm-keyvault?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-keyvault_2.1.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-keyvault` package - -Install the Azure KeyVaultManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-keyvault -``` - -### Create and authenticate a `KeyVaultManagementClient` - -To create a client object to access the Azure KeyVaultManagement API, you will need the `endpoint` of your Azure KeyVaultManagement resource and a `credential`. The Azure KeyVaultManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure KeyVaultManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-keyvault_2.1.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure KeyVaultManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { KeyVaultManagementClient } = require("@azure/arm-keyvault"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new KeyVaultManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new KeyVaultManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### KeyVaultManagementClient - -`KeyVaultManagementClient` is the primary interface for developers using the Azure KeyVaultManagement client library. Explore the methods on this client object to understand the different features of the Azure KeyVaultManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-keyvault_2.1.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-keyvault_2.1.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fkeyvault%2Farm-keyvault%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-keyvault_2.1.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-keyvault_2.1.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-kubernetesconfiguration-readme.md b/docs-ref-services/preview/arm-kubernetesconfiguration-readme.md deleted file mode 100644 index 8a2240598e02..000000000000 --- a/docs-ref-services/preview/arm-kubernetesconfiguration-readme.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: Azure SourceControlConfiguration client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-kubernetesconfiguration, kubernetesconfiguration -author: qiaozha -ms.author: qiaozha -ms.date: 01/17/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure-kubernetes-service ---- -# Azure SourceControlConfiguration client library for JavaScript - version 5.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure SourceControlConfiguration client. - -KubernetesConfiguration Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-kubernetesconfiguration_5.0.0-beta.1/sdk/kubernetesconfiguration/arm-kubernetesconfiguration) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-kubernetesconfiguration) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-kubernetesconfiguration?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-kubernetesconfiguration` package - -Install the Azure SourceControlConfiguration client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-kubernetesconfiguration -``` - -### Create and authenticate a `SourceControlConfigurationClient` - -To create a client object to access the Azure SourceControlConfiguration API, you will need the `endpoint` of your Azure SourceControlConfiguration resource and a `credential`. The Azure SourceControlConfiguration client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure SourceControlConfiguration resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-kubernetesconfiguration_5.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure SourceControlConfiguration** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { SourceControlConfigurationClient } = require("@azure/arm-kubernetesconfiguration"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new SourceControlConfigurationClient(new DefaultAzureCredential(), subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### SourceControlConfigurationClient - -`SourceControlConfigurationClient` is the primary interface for developers using the Azure SourceControlConfiguration client library. Explore the methods on this client object to understand the different features of the Azure SourceControlConfiguration service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-kubernetesconfiguration_5.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-kubernetesconfiguration_5.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fkubernetesconfiguration%2Farm-kubernetesconfiguration%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-kubernetesconfiguration_5.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-kubernetesconfiguration_5.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-labservices-readme.md b/docs-ref-services/preview/arm-labservices-readme.md deleted file mode 100644 index dc1841cb9cc6..000000000000 --- a/docs-ref-services/preview/arm-labservices-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure LabServices client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-labservices, labservices -author: qiaozha -ms.author: qiaozha -ms.date: 06/22/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: labservices ---- -# Azure LabServices client library for JavaScript - version 3.0.0-beta.3 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure LabServices client. - -REST API for managing Azure Lab Services images. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-labservices_3.0.0-beta.3/sdk/labservices/arm-labservices) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-labservices) | -[API reference documentation](/javascript/api/@azure/arm-labservices?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-labservices_3.0.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-labservices` package - -Install the Azure LabServices client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-labservices -``` - -### Create and authenticate a `LabServicesClient` - -To create a client object to access the Azure LabServices API, you will need the `endpoint` of your Azure LabServices resource and a `credential`. The Azure LabServices client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure LabServices resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-labservices_3.0.0-beta.3/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure LabServices** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { LabServicesClient } = require("@azure/arm-labservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new LabServicesClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new LabServicesClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### LabServicesClient - -`LabServicesClient` is the primary interface for developers using the Azure LabServices client library. Explore the methods on this client object to understand the different features of the Azure LabServices service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-labservices_3.0.0-beta.3/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-labservices_3.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Flabservices%2Farm-labservices%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-labservices_3.0.0-beta.3/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-labservices_3.0.0-beta.3/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-links-readme.md b/docs-ref-services/preview/arm-links-readme.md deleted file mode 100644 index ed2ab7855e0c..000000000000 --- a/docs-ref-services/preview/arm-links-readme.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Azure ManagementLink client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-links, links -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/15/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure ManagementLink client library for JavaScript - version 2.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ManagementLink client. - -Azure resources can be linked together to form logical relationships. You can establish links between resources belonging to different resource groups. However, all the linked resources must belong to the same subscription. Each resource can be linked to 50 other resources. If any of the linked resources are deleted or moved, the link owner must clean up the remaining link. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-links_2.0.0-beta.1/sdk/links/arm-links) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-links) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-links) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-links` package - -Install the Azure ManagementLink client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-links -``` - -### Create and authenticate a `ManagementLinkClient` - -To create a client object to access the Azure ManagementLink API, you will need the `endpoint` of your Azure ManagementLink resource and a `credential`. The Azure ManagementLink client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ManagementLink resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure ManagementLink by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -```javascript -const { ManagementLinkClient } = require("@azure/arm-links"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ManagementLinkClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### ManagementLinkClient - -`ManagementLinkClient` is the primary interface for developers using the Azure ManagementLink client library. Explore the methods on this client object to understand the different features of the Azure ManagementLink service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-links_2.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-links_2.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Flinks%2Farm-links%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-links_2.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-links_2.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-loadtesting-readme.md b/docs-ref-services/preview/arm-loadtesting-readme.md deleted file mode 100644 index 02f696e1ffe2..000000000000 --- a/docs-ref-services/preview/arm-loadtesting-readme.md +++ /dev/null @@ -1,224 +0,0 @@ ---- -title: Azure Load Testing client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-loadtesting, loadtestservice -author: xirzec -ms.author: jeffish -ms.date: 01/09/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: loadtestservice ---- -# Azure Load Testing client library for JavaScript - version 1.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure LoadTest client. - -LoadTest client provides access to LoadTest Resource and it's status operations. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-loadtesting_1.0.0-beta.2/sdk/loadtestservice/arm-loadtesting) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-loadtesting) | -[API reference documentation](/javascript/api/@azure/arm-loadtesting?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-loadtesting_1.0.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-loadtesting` package - -Install the Azure LoadTest client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-loadtesting -``` - -### Create and authenticate a `LoadTestClient` - -To create a client object to access the Azure LoadTest API, you will need the `endpoint` of your Azure LoadTest resource and a `credential`. The Azure LoadTest client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure LoadTest resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-loadtesting_1.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure LoadTest** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { LoadTestClient } = require("@azure/arm-loadtesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new LoadTestClient(credential, subscriptionId); -``` - -### Create an Azure Load Testing resource - -Create a new Azure Load Testing resource. -```javascript -loadTestResourceCreatePayload = { - location: "westus2" -}; - -const resource = await client.loadTests.beginCreateOrUpdateAndWait( - "sample-rg", - "sample-loadtesting-resource", - loadTestResourceCreatePayload -); - -console.log(resource); -``` - -Create a new Azure Load Testing resource with managed identity and customer managed key encryption. -```javascript -loadTestResourceCreatePayload = { - location: "westus2", - tags: { team: "testing" }, - identity: { - type: 'SystemAssigned, UserAssigned', - userAssignedIdentities: { - '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1': {} - } - }, - encryption: { - identity: { - type: 'UserAssigned', - resourceId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1' - }, - keyUrl: 'https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde' - } -}; - -const resource = await client.loadTests.beginCreateOrUpdateAndWait( - "sample-rg", - "sample-loadtesting-resource", - loadTestResourceCreatePayload -); - -console.log(resource); -``` - -### Get an Azure Load Testing resource - -```javascript -let resourceName = 'sample-loadtesting-resource'; -let resourceGroupName = 'sample-rg'; - -const resource = await client.loadTests.get( - resourceGroupName, - resourceName -); - -console.log(resource); -``` - -### Update an Azure Load Testing resource - -```javascript -loadTestResourcePatchPayload = { - tags: { team: "testing-dev" }, - identity: { - type: 'SystemAssigned, UserAssigned', - userAssignedIdentities: { - // removing a user-assigned managed identity by assigning the value in the payload as null - '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1': null, - '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity2': {} - } - }, - encryption: { - // use system-assigned managed identity for CMK encryption - identity: { - type: 'SystemAssigned', - resourceId: null - }, - keyUrl: 'https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde' - } -}; - -const resource = await client.loadTests.beginUpdateAndWait( - "sample-rg", - "sample-loadtesting-resource", - loadTestResourcePatchPayload -); - -console.log(resource); -``` - -### Delete an Azure Load Testing resource - -```javascript -let resourceName = 'sample-loadtesting-resource'; -let resourceGroupName = 'sample-rg'; - -const result = await client.loadTests.beginDeleteAndWait( - resourceGroupName, - resourceName -); -``` - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### LoadTestClient - -`LoadTestClient` is the primary interface for developers using the Azure LoadTest client library. Explore the methods on this client object to understand the different features of the Azure LoadTest service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-loadtesting_1.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-loadtesting_1.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Floadtestservice%2Farm-loadtesting%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-loadtesting_1.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-loadtesting_1.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-locks-readme.md b/docs-ref-services/preview/arm-locks-readme.md deleted file mode 100644 index 5365f4c6ceac..000000000000 --- a/docs-ref-services/preview/arm-locks-readme.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Azure ManagementLock client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-locks, locks -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/15/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure ManagementLock client library for JavaScript - version 2.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ManagementLock client. - -Azure resources can be locked to prevent other users in your organization from deleting or modifying resources. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-locks_2.0.0-beta.1/sdk/locks/arm-locks) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-locks) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-locks) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-locks` package - -Install the Azure ManagementLock client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-locks -``` - -### Create and authenticate a `ManagementLockClient` - -To create a client object to access the Azure ManagementLock API, you will need the `endpoint` of your Azure ManagementLock resource and a `credential`. The Azure ManagementLock client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ManagementLock resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure ManagementLock by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -```javascript -const { ManagementLockClient } = require("@azure/arm-locks"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ManagementLockClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### ManagementLockClient - -`ManagementLockClient` is the primary interface for developers using the Azure ManagementLock client library. Explore the methods on this client object to understand the different features of the Azure ManagementLock service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-locks_2.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-locks_2.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Flocks%2Farm-locks%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-locks_2.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-locks_2.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-logic-readme.md b/docs-ref-services/preview/arm-logic-readme.md deleted file mode 100644 index b295bf860a9d..000000000000 --- a/docs-ref-services/preview/arm-logic-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure LogicManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-logic, logic -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/25/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure LogicManagement client library for JavaScript - version 8.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure LogicManagement client. - -REST API for Azure Logic Apps. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-logic_8.0.0-beta.1/sdk/logic/arm-logic) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-logic) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-logic) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-logic` package - -Install the Azure LogicManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-logic -``` - -### Create and authenticate a `LogicManagementClient` - -To create a client object to access the Azure LogicManagement API, you will need the `endpoint` of your Azure LogicManagement resource and a `credential`. The Azure LogicManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure LogicManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-logic_8.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure LogicManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { LogicManagementClient } = require("@azure/arm-logic"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new LogicManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### LogicManagementClient - -`LogicManagementClient` is the primary interface for developers using the Azure LogicManagement client library. Explore the methods on this client object to understand the different features of the Azure LogicManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-logic_8.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-logic_8.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Flogic%2Farm-logic%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-logic_8.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-logic_8.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-machinelearning-readme.md b/docs-ref-services/preview/arm-machinelearning-readme.md deleted file mode 100644 index 99055e34b826..000000000000 --- a/docs-ref-services/preview/arm-machinelearning-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure Service client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-machinelearning, machinelearning -author: xirzec -ms.author: jeffish -ms.date: 05/27/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: machinelearning ---- -# Azure Service client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. - -These APIs allow end users to operate on Azure Machine Learning Workspace resources. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-machinelearning_1.0.0-beta.1/sdk/machinelearning/arm-machinelearning) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-machinelearning) | -[API reference documentation](/javascript/api/@azure/arm-machinelearning?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-machinelearning_1.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-machinelearning` package - -Install the Azure Service client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-machinelearning -``` - -### Create and authenticate a `AzureMachineLearningWorkspaces` - -To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-machinelearning_1.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { AzureMachineLearningWorkspaces } = require("@azure/arm-machinelearning"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AzureMachineLearningWorkspaces(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new AzureMachineLearningWorkspaces(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### AzureMachineLearningWorkspaces - -`AzureMachineLearningWorkspaces` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-machinelearning_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-machinelearning_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmachinelearning%2Farm-machinelearning%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-machinelearning_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-machinelearning_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-managedapplications-readme.md b/docs-ref-services/preview/arm-managedapplications-readme.md deleted file mode 100644 index da5852930e9f..000000000000 --- a/docs-ref-services/preview/arm-managedapplications-readme.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Azure Application client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-managedapplications, managedapplications -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/15/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure Application client library for JavaScript - version 2.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Application client. - -ARM applications - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managedapplications_2.0.0-beta.1/sdk/managedapplications/arm-managedapplications) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-managedapplications) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-managedapplications) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-managedapplications` package - -Install the Azure Application client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-managedapplications -``` - -### Create and authenticate a `ApplicationClient` - -To create a client object to access the Azure Application API, you will need the `endpoint` of your Azure Application resource and a `credential`. The Azure Application client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Application resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure Application by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -```javascript -const { ApplicationClient } = require("@azure/arm-managedapplications"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ApplicationClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### ApplicationClient - -`ApplicationClient` is the primary interface for developers using the Azure Application client library. Explore the methods on this client object to understand the different features of the Azure Application service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managedapplications_2.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-managedapplications_2.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmanagedapplications%2Farm-managedapplications%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managedapplications_2.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managedapplications_2.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-managednetworkfabric-readme.md b/docs-ref-services/preview/arm-managednetworkfabric-readme.md deleted file mode 100644 index 3beadb9bb17f..000000000000 --- a/docs-ref-services/preview/arm-managednetworkfabric-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure Network Fabric Management client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-managednetworkfabric, managednetworkfabric -author: xirzec -ms.author: jeffish -ms.date: 06/28/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: managednetworkfabric ---- -# Azure Network Fabric Management client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Network Fabric Management client. - -Self service experience for Azure Network Fabric API. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managednetworkfabric_1.0.0-beta.1/sdk/managednetworkfabric/arm-managednetworkfabric) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-managednetworkfabric) | -[API reference documentation](/javascript/api/@azure/arm-managednetworkfabric?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-managednetworkfabric_1.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-managednetworkfabric` package - -Install the Azure Network Fabric Management client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-managednetworkfabric -``` - -### Create and authenticate a `AzureNetworkFabricManagementServiceAPI` - -To create a client object to access the Azure Network Fabric Management API, you will need the `endpoint` of your Azure Network Fabric Management resource and a `credential`. The Azure Network Fabric Management client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Network Fabric Management resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-managednetworkfabric_1.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Network Fabric Management** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { AzureNetworkFabricManagementServiceAPI } = require("@azure/arm-managednetworkfabric"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AzureNetworkFabricManagementServiceAPI(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new AzureNetworkFabricManagementServiceAPI(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### AzureNetworkFabricManagementServiceAPI - -`AzureNetworkFabricManagementServiceAPI` is the primary interface for developers using the Azure Network Fabric Management client library. Explore the methods on this client object to understand the different features of the Azure Network Fabric Management service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managednetworkfabric_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-managednetworkfabric_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmanagednetworkfabric%2Farm-managednetworkfabric%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managednetworkfabric_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managednetworkfabric_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-managementgroups-readme.md b/docs-ref-services/preview/arm-managementgroups-readme.md deleted file mode 100644 index 23dad6155d21..000000000000 --- a/docs-ref-services/preview/arm-managementgroups-readme.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -title: Azure Service client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-managementgroups, managementgroups -author: maggiepint -ms.author: magpint -ms.date: 11/23/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure Service client library for JavaScript - version 2.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. - -The Azure Management Groups API enables consolidation of multiple -subscriptions/resources into an organizational hierarchy and centrally -manage access control, policies, alerting and reporting for those resources. - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managementgroups_2.0.0-beta.1/sdk/managementgroups/arm-managementgroups) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-managementgroups) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-managementgroups?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-managementgroups` package - -Install the Azure Service client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-managementgroups -``` - -### Create and authenticate a `ManagementGroupsAPI` - -To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-managementgroups_2.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { ManagementGroupsAPI } = require("@azure/arm-managementgroups"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ManagementGroupsAPI(new DefaultAzureCredential(), subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### ManagementGroupsAPI - -`ManagementGroupsAPI` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managementgroups_2.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-managementgroups_2.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmanagementgroups%2Farm-managementgroups%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managementgroups_2.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-managementgroups_2.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-maps-readme.md b/docs-ref-services/preview/arm-maps-readme.md deleted file mode 100644 index b5250b570311..000000000000 --- a/docs-ref-services/preview/arm-maps-readme.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: -keywords: Azure, javascript, SDK, API, @azure/arm-maps, maps -author: qiaozha -ms.author: qiaozha -ms.date: 12/05/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: maps ---- -# AzureMapsManagement client library for JavaScript - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureMapsManagement client. - -Azure Maps - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-maps_3.1.0-beta.2/sdk/maps/arm-maps) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-maps) | -[API reference documentation](/javascript/api/@azure/arm-maps?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-maps_3.1.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-maps` package - -Install the AzureMapsManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-maps -``` - -### Create and authenticate a `AzureMapsManagementClient` - -To create a client object to access the AzureMapsManagement API, you will need the `endpoint` of your AzureMapsManagement resource and a `credential`. The AzureMapsManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your AzureMapsManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-maps_3.1.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to AzureMapsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { AzureMapsManagementClient } = require("@azure/arm-maps"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AzureMapsManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new AzureMapsManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### AzureMapsManagementClient - -`AzureMapsManagementClient` is the primary interface for developers using the AzureMapsManagement client library. Explore the methods on this client object to understand the different features of the AzureMapsManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-maps_3.1.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-maps_3.1.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmaps%2Farm-maps%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-maps_3.1.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-maps_3.1.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-mediaservices-readme.md b/docs-ref-services/preview/arm-mediaservices-readme.md deleted file mode 100644 index 67ce7530279e..000000000000 --- a/docs-ref-services/preview/arm-mediaservices-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure Media client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-mediaservices, mediaservices -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/29/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: media-services ---- - -# Azure Media client library for JavaScript - version 10.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Media client. - -This Swagger was generated by the API Framework. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mediaservices_10.0.0-beta.1/sdk/mediaservices/arm-mediaservices) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-mediaservices) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-mediaservices) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-mediaservices` package - -Install the Azure Media client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-mediaservices -``` - -### Create and authenticate a `AzureMediaServices` - -To create a client object to access the Azure Media API, you will need the `endpoint` of your Azure Media resource and a `credential`. The Azure Media client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Media resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-mediaservices_10.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Media** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { AzureMediaServices } = require("@azure/arm-mediaservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AzureMediaServices(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### AzureMediaServices - -`AzureMediaServices` is the primary interface for developers using the Azure Media client library. Explore the methods on this client object to understand the different features of the Azure Media service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mediaservices_10.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-mediaservices_10.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmediaservices%2Farm-mediaservices%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mediaservices_10.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mediaservices_10.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-mobilenetwork-readme.md b/docs-ref-services/preview/arm-mobilenetwork-readme.md deleted file mode 100644 index 9c198d7a7682..000000000000 --- a/docs-ref-services/preview/arm-mobilenetwork-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure MobileNetworkManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-mobilenetwork, mobilenetwork -author: xirzec -ms.author: jeffish -ms.date: 08/01/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: mobilenetwork ---- -# Azure MobileNetworkManagement client library for JavaScript - version 1.0.0-beta.3 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure MobileNetworkManagement client. - -The resources in this swagger specification will be used to manage attached data network resources in mobile network attached to a particular packet core instance - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mobilenetwork_1.0.0-beta.3/sdk/mobilenetwork/arm-mobilenetwork) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-mobilenetwork) | -[API reference documentation](/javascript/api/@azure/arm-mobilenetwork?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-mobilenetwork_1.0.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-mobilenetwork` package - -Install the Azure MobileNetworkManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-mobilenetwork -``` - -### Create and authenticate a `MobileNetworkManagementClient` - -To create a client object to access the Azure MobileNetworkManagement API, you will need the `endpoint` of your Azure MobileNetworkManagement resource and a `credential`. The Azure MobileNetworkManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure MobileNetworkManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-mobilenetwork_1.0.0-beta.3/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure MobileNetworkManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { MobileNetworkManagementClient } = require("@azure/arm-mobilenetwork"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new MobileNetworkManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new MobileNetworkManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### MobileNetworkManagementClient - -`MobileNetworkManagementClient` is the primary interface for developers using the Azure MobileNetworkManagement client library. Explore the methods on this client object to understand the different features of the Azure MobileNetworkManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mobilenetwork_1.0.0-beta.3/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-mobilenetwork_1.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmobilenetwork%2Farm-mobilenetwork%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mobilenetwork_1.0.0-beta.3/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mobilenetwork_1.0.0-beta.3/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-msi-readme.md b/docs-ref-services/preview/arm-msi-readme.md deleted file mode 100644 index fd69f9c2fa60..000000000000 --- a/docs-ref-services/preview/arm-msi-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure ManagedServiceIdentity client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-msi, msi -author: qiaozha -ms.author: qiaozha -ms.date: 06/28/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: msi ---- -# Azure ManagedServiceIdentity client library for JavaScript - version 2.1.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ManagedServiceIdentity client. - -The Managed Service Identity Client. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-msi_2.1.0-beta.2/sdk/msi/arm-msi) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-msi) | -[API reference documentation](/javascript/api/@azure/arm-msi?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-msi_2.1.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-msi` package - -Install the Azure ManagedServiceIdentity client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-msi -``` - -### Create and authenticate a `ManagedServiceIdentityClient` - -To create a client object to access the Azure ManagedServiceIdentity API, you will need the `endpoint` of your Azure ManagedServiceIdentity resource and a `credential`. The Azure ManagedServiceIdentity client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ManagedServiceIdentity resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-msi_2.1.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure ManagedServiceIdentity** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { ManagedServiceIdentityClient } = require("@azure/arm-msi"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ManagedServiceIdentityClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new ManagedServiceIdentityClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### ManagedServiceIdentityClient - -`ManagedServiceIdentityClient` is the primary interface for developers using the Azure ManagedServiceIdentity client library. Explore the methods on this client object to understand the different features of the Azure ManagedServiceIdentity service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-msi_2.1.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-msi_2.1.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmsi%2Farm-msi%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-msi_2.1.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-msi_2.1.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-mysql-readme.md b/docs-ref-services/preview/arm-mysql-readme.md deleted file mode 100644 index cdc5dc3180d1..000000000000 --- a/docs-ref-services/preview/arm-mysql-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure MySQLManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-mysql, mysql -author: maggiepint -ms.author: magpint -ms.date: 11/09/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: mysql ---- - -# Azure MySQLManagement client library for JavaScript - version 5.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure MySQLManagement client. - -The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mysql_5.0.0-beta.1/sdk/mysql/arm-mysql) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-mysql) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-mysql) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-mysql` package - -Install the Azure MySQLManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-mysql -``` - -### Create and authenticate a `MySQLManagementClient` - -To create a client object to access the Azure MySQLManagement API, you will need the `endpoint` of your Azure MySQLManagement resource and a `credential`. The Azure MySQLManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure MySQLManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-mysql_5.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure MySQLManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { MySQLManagementClient } = require("@azure/arm-mysql"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new MySQLManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### MySQLManagementClient - -`MySQLManagementClient` is the primary interface for developers using the Azure MySQLManagement client library. Explore the methods on this client object to understand the different features of the Azure MySQLManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mysql_5.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-mysql_5.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmysql%2Farm-mysql%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mysql_5.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-mysql_5.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-network-readme.md b/docs-ref-services/preview/arm-network-readme.md deleted file mode 100644 index 374383e29567..000000000000 --- a/docs-ref-services/preview/arm-network-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure NetworkManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-network, virtualnetwork -author: ramya-rao-a -ms.author: ramyar -ms.date: 11/02/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: virtual-network ---- - -# Azure NetworkManagement client library for JavaScript - version 26.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure NetworkManagement client. - -Network Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-network_26.0.0-beta.2/sdk/network/arm-network) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-network) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-network) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-network` package - -Install the Azure NetworkManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-network -``` - -### Create and authenticate a `NetworkManagementClient` - -To create a client object to access the Azure NetworkManagement API, you will need the `endpoint` of your Azure NetworkManagement resource and a `credential`. The Azure NetworkManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure NetworkManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-network_26.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure NetworkManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { NetworkManagementClient } = require("@azure/arm-network"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new NetworkManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### NetworkManagementClient - -`NetworkManagementClient` is the primary interface for developers using the Azure NetworkManagement client library. Explore the methods on this client object to understand the different features of the Azure NetworkManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-network_26.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-network_26.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fnetwork%2Farm-network%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-network_26.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-network_26.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-networkcloud-readme.md b/docs-ref-services/preview/arm-networkcloud-readme.md deleted file mode 100644 index 88561a2fef8d..000000000000 --- a/docs-ref-services/preview/arm-networkcloud-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure NetworkCloud client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-networkcloud, networkcloud -author: xirzec -ms.author: jeffish -ms.date: 07/27/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: networkcloud ---- -# Azure NetworkCloud client library for JavaScript - version 1.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure NetworkCloud client. - -The Network Cloud APIs provide management of the on-premises clusters and their resources, such as, racks, bare metal hosts, virtual machines, workload networks and more. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-networkcloud_1.0.0-beta.2/sdk/networkcloud/arm-networkcloud) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-networkcloud) | -[API reference documentation](/javascript/api/@azure/arm-networkcloud?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-networkcloud_1.0.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-networkcloud` package - -Install the Azure NetworkCloud client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-networkcloud -``` - -### Create and authenticate a `NetworkCloud` - -To create a client object to access the Azure NetworkCloud API, you will need the `endpoint` of your Azure NetworkCloud resource and a `credential`. The Azure NetworkCloud client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure NetworkCloud resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-networkcloud_1.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure NetworkCloud** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { NetworkCloud } = require("@azure/arm-networkcloud"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new NetworkCloud(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new NetworkCloud(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### NetworkCloud - -`NetworkCloud` is the primary interface for developers using the Azure NetworkCloud client library. Explore the methods on this client object to understand the different features of the Azure NetworkCloud service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-networkcloud_1.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-networkcloud_1.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fnetworkcloud%2Farm-networkcloud%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-networkcloud_1.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-networkcloud_1.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-notificationhubs-readme.md b/docs-ref-services/preview/arm-notificationhubs-readme.md deleted file mode 100644 index 57536f88ac80..000000000000 --- a/docs-ref-services/preview/arm-notificationhubs-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure NotificationHubsManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-notificationhubs, notificationhubs -author: ramya-rao-a -ms.author: ramyar -ms.date: 11/01/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: notification-hubs ---- - -# Azure NotificationHubsManagement client library for JavaScript - version 2.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure NotificationHubsManagement client. - -Azure NotificationHub client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-notificationhubs_2.0.0-beta.1/sdk/notificationhubs/arm-notificationhubs) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-notificationhubs) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-notificationhubs) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-notificationhubs` package - -Install the Azure NotificationHubsManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-notificationhubs -``` - -### Create and authenticate a `NotificationHubsManagementClient` - -To create a client object to access the Azure NotificationHubsManagement API, you will need the `endpoint` of your Azure NotificationHubsManagement resource and a `credential`. The Azure NotificationHubsManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure NotificationHubsManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-notificationhubs_2.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure NotificationHubsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { NotificationHubsManagementClient } = require("@azure/arm-notificationhubs"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new NotificationHubsManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### NotificationHubsManagementClient - -`NotificationHubsManagementClient` is the primary interface for developers using the Azure NotificationHubsManagement client library. Explore the methods on this client object to understand the different features of the Azure NotificationHubsManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-notificationhubs_2.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-notificationhubs_2.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fnotificationhubs%2Farm-notificationhubs%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-notificationhubs_2.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-notificationhubs_2.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-operationalinsights-readme.md b/docs-ref-services/preview/arm-operationalinsights-readme.md deleted file mode 100644 index 4161ac2bc1d9..000000000000 --- a/docs-ref-services/preview/arm-operationalinsights-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure OperationalInsightsManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-operationalinsights, operationalinsights -author: qiaozha -ms.author: qiaozha -ms.date: 02/03/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: operationalinsights ---- -# Azure OperationalInsightsManagement client library for JavaScript - version 9.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure OperationalInsightsManagement client. - -Operational Insights Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-operationalinsights_9.0.0-beta.2/sdk/operationalinsights/arm-operationalinsights) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-operationalinsights) | -[API reference documentation](/javascript/api/@azure/arm-operationalinsights?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-operationalinsights_9.0.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-operationalinsights` package - -Install the Azure OperationalInsightsManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-operationalinsights -``` - -### Create and authenticate a `OperationalInsightsManagementClient` - -To create a client object to access the Azure OperationalInsightsManagement API, you will need the `endpoint` of your Azure OperationalInsightsManagement resource and a `credential`. The Azure OperationalInsightsManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure OperationalInsightsManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-operationalinsights_9.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure OperationalInsightsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { OperationalInsightsManagementClient } = require("@azure/arm-operationalinsights"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new OperationalInsightsManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new OperationalInsightsManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### OperationalInsightsManagementClient - -`OperationalInsightsManagementClient` is the primary interface for developers using the Azure OperationalInsightsManagement client library. Explore the methods on this client object to understand the different features of the Azure OperationalInsightsManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-operationalinsights_9.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-operationalinsights_9.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Foperationalinsights%2Farm-operationalinsights%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-operationalinsights_9.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-operationalinsights_9.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-orbital-readme.md b/docs-ref-services/preview/arm-orbital-readme.md deleted file mode 100644 index a85f1ea4dc3b..000000000000 --- a/docs-ref-services/preview/arm-orbital-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure Service client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-orbital, orbital -author: qiaozha -ms.author: qiaozha -ms.date: 04/29/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: orbital ---- -# Azure Service client library for JavaScript - version 1.0.0-beta.3 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. - -Azure Orbital service - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-orbital_1.0.0-beta.3/sdk/orbital/arm-orbital) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-orbital) | -[API reference documentation](/javascript/api/@azure/arm-orbital?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-orbital_1.0.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-orbital` package - -Install the Azure Service client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-orbital -``` - -### Create and authenticate a `AzureOrbital` - -To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-orbital_1.0.0-beta.3/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { AzureOrbital } = require("@azure/arm-orbital"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new AzureOrbital(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new AzureOrbital(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### AzureOrbital - -`AzureOrbital` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-orbital_1.0.0-beta.3/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-orbital_1.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Forbital%2Farm-orbital%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-orbital_1.0.0-beta.3/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-orbital_1.0.0-beta.3/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-paloaltonetworksngfw-readme.md b/docs-ref-services/preview/arm-paloaltonetworksngfw-readme.md deleted file mode 100644 index 0e9ea713363c..000000000000 --- a/docs-ref-services/preview/arm-paloaltonetworksngfw-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure PaloAltoNetworksCloudngfw client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-paloaltonetworksngfw, paloaltonetworksngfw -author: xirzec -ms.author: jeffish -ms.date: 05/04/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: paloaltonetworksngfw ---- -# Azure PaloAltoNetworksCloudngfw client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure PaloAltoNetworksCloudngfw client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-paloaltonetworksngfw_1.0.0-beta.1/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-paloaltonetworksngfw) | -[API reference documentation](/javascript/api/@azure/arm-paloaltonetworksngfw?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-paloaltonetworksngfw_1.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-paloaltonetworksngfw` package - -Install the Azure PaloAltoNetworksCloudngfw client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-paloaltonetworksngfw -``` - -### Create and authenticate a `PaloAltoNetworksCloudngfw` - -To create a client object to access the Azure PaloAltoNetworksCloudngfw API, you will need the `endpoint` of your Azure PaloAltoNetworksCloudngfw resource and a `credential`. The Azure PaloAltoNetworksCloudngfw client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure PaloAltoNetworksCloudngfw resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-paloaltonetworksngfw_1.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure PaloAltoNetworksCloudngfw** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { PaloAltoNetworksCloudngfw } = require("@azure/arm-paloaltonetworksngfw"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new PaloAltoNetworksCloudngfw(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new PaloAltoNetworksCloudngfw(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### PaloAltoNetworksCloudngfw - -`PaloAltoNetworksCloudngfw` is the primary interface for developers using the Azure PaloAltoNetworksCloudngfw client library. Explore the methods on this client object to understand the different features of the Azure PaloAltoNetworksCloudngfw service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-paloaltonetworksngfw_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-paloaltonetworksngfw_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fpaloaltonetworksngfw%2Farm-paloaltonetworksngfw%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-paloaltonetworksngfw_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-paloaltonetworksngfw_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-policy-readme.md b/docs-ref-services/preview/arm-policy-readme.md deleted file mode 100644 index 4a01f486a0de..000000000000 --- a/docs-ref-services/preview/arm-policy-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure Policy client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-policy, policy -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/18/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure-policy ---- - -# Azure Policy client library for JavaScript - version 5.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Policy client. - -To manage and control access to your resources, you can define customized policies and assign them at a scope. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-policy_5.0.0-beta.2/sdk/policy/arm-policy) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-policy) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-policy) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-policy` package - -Install the Azure Policy client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-policy -``` - -### Create and authenticate a `PolicyClient` - -To create a client object to access the Azure Policy API, you will need the `endpoint` of your Azure Policy resource and a `credential`. The Azure Policy client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Policy resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-policy_5.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Policy** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { PolicyClient } = require("@azure/arm-policy"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new PolicyClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### PolicyClient - -`PolicyClient` is the primary interface for developers using the Azure Policy client library. Explore the methods on this client object to understand the different features of the Azure Policy service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-policy_5.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-policy_5.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fpolicy%2Farm-policy%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-policy_5.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-policy_5.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-postgresql-readme.md b/docs-ref-services/preview/arm-postgresql-readme.md deleted file mode 100644 index 653ee3323123..000000000000 --- a/docs-ref-services/preview/arm-postgresql-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure PostgreSQLManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-postgresql, postgresql -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/20/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: postgresql ---- - -# Azure PostgreSQLManagement client library for JavaScript - version 6.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure PostgreSQLManagement client. - -The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-postgresql_6.0.0-beta.1/sdk/postgresql/arm-postgresql) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-postgresql) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-postgresql) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-postgresql` package - -Install the Azure PostgreSQLManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-postgresql -``` - -### Create and authenticate a `PostgreSQLManagementClient` - -To create a client object to access the Azure PostgreSQLManagement API, you will need the `endpoint` of your Azure PostgreSQLManagement resource and a `credential`. The Azure PostgreSQLManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure PostgreSQLManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-postgresql_6.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure PostgreSQLManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { PostgreSQLManagementClient } = require("@azure/arm-postgresql"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new PostgreSQLManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### PostgreSQLManagementClient - -`PostgreSQLManagementClient` is the primary interface for developers using the Azure PostgreSQLManagement client library. Explore the methods on this client object to understand the different features of the Azure PostgreSQLManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-postgresql_6.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-postgresql_6.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fpostgresql%2Farm-postgresql%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-postgresql_6.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-postgresql_6.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-purview-readme.md b/docs-ref-services/preview/arm-purview-readme.md deleted file mode 100644 index f2470fefa90e..000000000000 --- a/docs-ref-services/preview/arm-purview-readme.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: Azure PurviewManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-purview, purview -author: ramya-rao-a -ms.author: ramyar -ms.date: 09/10/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: purview ---- - -# Azure PurviewManagement client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure PurviewManagement client. - -Creates a Microsoft.Purview management client. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-purview_1.0.0-beta.1/sdk/purview/arm-purview) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-purview) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-purview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-purview` package - -Install the Azure PurviewManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-purview -``` - -### Create and authenticate a `PurviewManagementClient` - -To create a client object to access the Azure PurviewManagement API, you will need the `endpoint` of your Azure PurviewManagement resource and a `credential`. The Azure PurviewManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure PurviewManagement resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure PurviewManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). -```javascript -const { PurviewManagementClient } = require("@azure/arm-purview"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new PurviewManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### PurviewManagementClient - -`PurviewManagementClient` is the primary interface for developers using the Azure PurviewManagement client library. Explore the methods on this client object to understand the different features of the Azure PurviewManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-purview_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-purview_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fpurview%2Farm-purview%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-purview_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-purview_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-recoveryservices-readme.md b/docs-ref-services/preview/arm-recoveryservices-readme.md deleted file mode 100644 index d28d71f8a056..000000000000 --- a/docs-ref-services/preview/arm-recoveryservices-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure RecoveryServices client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-recoveryservices, recoveryservices -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/26/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure RecoveryServices client library for JavaScript - version 5.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure RecoveryServices client. - -Recovery Services Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-recoveryservices_5.0.0-beta.1/sdk/recoveryservices/arm-recoveryservices) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-recoveryservices) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-recoveryservices) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-recoveryservices` package - -Install the Azure RecoveryServices client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-recoveryservices -``` - -### Create and authenticate a `RecoveryServicesClient` - -To create a client object to access the Azure RecoveryServices API, you will need the `endpoint` of your Azure RecoveryServices resource and a `credential`. The Azure RecoveryServices client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure RecoveryServices resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-recoveryservices_5.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure RecoveryServices** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { RecoveryServicesClient } = require("@azure/arm-recoveryservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new RecoveryServicesClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### RecoveryServicesClient - -`RecoveryServicesClient` is the primary interface for developers using the Azure RecoveryServices client library. Explore the methods on this client object to understand the different features of the Azure RecoveryServices service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-recoveryservices_5.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-recoveryservices_5.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Frecoveryservices%2Farm-recoveryservices%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-recoveryservices_5.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-recoveryservices_5.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-rediscache-readme.md b/docs-ref-services/preview/arm-rediscache-readme.md deleted file mode 100644 index eab716c7546c..000000000000 --- a/docs-ref-services/preview/arm-rediscache-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure RedisManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-rediscache, rediscache -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/15/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: cache ---- - -# Azure RedisManagement client library for JavaScript - version 6.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure RedisManagement client. - -REST API for Azure Redis Cache Service. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-rediscache_6.0.0-beta.1/sdk/redis/arm-rediscache) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-rediscache) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-rediscache) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-rediscache` package - -Install the Azure RedisManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-rediscache -``` - -### Create and authenticate a `RedisManagementClient` - -To create a client object to access the Azure RedisManagement API, you will need the `endpoint` of your Azure RedisManagement resource and a `credential`. The Azure RedisManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure RedisManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-rediscache_6.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure RedisManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new RedisManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### RedisManagementClient - -`RedisManagementClient` is the primary interface for developers using the Azure RedisManagement client library. Explore the methods on this client object to understand the different features of the Azure RedisManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-rediscache_6.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-rediscache_6.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fredis%2Farm-rediscache%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-rediscache_6.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-rediscache_6.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-resourceconnector-readme.md b/docs-ref-services/preview/arm-resourceconnector-readme.md deleted file mode 100644 index cb5fd96bfafc..000000000000 --- a/docs-ref-services/preview/arm-resourceconnector-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure ResourceConnectorManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-resourceconnector, resourceconnector -author: xirzec -ms.author: jeffish -ms.date: 04/27/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: resourceconnector ---- -# Azure ResourceConnectorManagement client library for JavaScript - version 1.0.0-beta.3 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ResourceConnectorManagement client. - -The appliances Rest API spec. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resourceconnector_1.0.0-beta.3/sdk/resourceconnector/arm-resourceconnector) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourceconnector) | -[API reference documentation](/javascript/api/@azure/arm-resourceconnector) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-resourceconnector_1.0.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-resourceconnector` package - -Install the Azure ResourceConnectorManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-resourceconnector -``` - -### Create and authenticate a `ResourceConnectorManagementClient` - -To create a client object to access the Azure ResourceConnectorManagement API, you will need the `endpoint` of your Azure ResourceConnectorManagement resource and a `credential`. The Azure ResourceConnectorManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ResourceConnectorManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-resourceconnector_1.0.0-beta.3/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure ResourceConnectorManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ResourceConnectorManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new ResourceConnectorManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### ResourceConnectorManagementClient - -`ResourceConnectorManagementClient` is the primary interface for developers using the Azure ResourceConnectorManagement client library. Explore the methods on this client object to understand the different features of the Azure ResourceConnectorManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resourceconnector_1.0.0-beta.3/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-resourceconnector_1.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresourceconnector%2Farm-resourceconnector%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resourceconnector_1.0.0-beta.3/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resourceconnector_1.0.0-beta.3/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-resourcehealth-readme.md b/docs-ref-services/preview/arm-resourcehealth-readme.md deleted file mode 100644 index 8a21c3394f0f..000000000000 --- a/docs-ref-services/preview/arm-resourcehealth-readme.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Azure Service client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-resourcehealth, resourcehealth -author: maggiepint -ms.author: magpint -ms.date: 11/24/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure Service client library for JavaScript - version 3.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Service client. - -The Resource Health Client. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resourcehealth_3.0.0-beta.1/sdk/resourcehealth/arm-resourcehealth) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourcehealth) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourcehealth?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-resourcehealth` package - -Install the Azure Service client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-resourcehealth -``` - -### Create and authenticate a `MicrosoftResourceHealth` - -To create a client object to access the Azure Service API, you will need the `endpoint` of your Azure Service resource and a `credential`. The Azure Service client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Service resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-resourcehealth_3.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Service** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { MicrosoftResourceHealth } = require("@azure/arm-resourcehealth"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new MicrosoftResourceHealth(new DefaultAzureCredential(), subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### MicrosoftResourceHealth - -`MicrosoftResourceHealth` is the primary interface for developers using the Azure Service client library. Explore the methods on this client object to understand the different features of the Azure Service service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resourcehealth_3.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-resourcehealth_3.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresourcehealth%2Farm-resourcehealth%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resourcehealth_3.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resourcehealth_3.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-resources-readme.md b/docs-ref-services/preview/arm-resources-readme.md deleted file mode 100644 index 8ae18b2b1a39..000000000000 --- a/docs-ref-services/preview/arm-resources-readme.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Azure ResourceManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-resources, resources -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/15/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure-resource-manager ---- - -# Azure ResourceManagement client library for JavaScript - version 5.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ResourceManagement client. - -Provides operations for working with resources and resource groups. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resources_5.0.0-beta.1/sdk/resources/arm-resources) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resources) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resources) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-resources` package - -Install the Azure ResourceManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-resources -``` - -### Create and authenticate a `ResourceManagementClient` - -To create a client object to access the Azure ResourceManagement API, you will need the `endpoint` of your Azure ResourceManagement resource and a `credential`. The Azure ResourceManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ResourceManagement resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure ResourceManagement by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -```javascript -const { ResourceManagementClient } = require("@azure/arm-resources"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ResourceManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### ResourceManagementClient - -`ResourceManagementClient` is the primary interface for developers using the Azure ResourceManagement client library. Explore the methods on this client object to understand the different features of the Azure ResourceManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resources_5.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-resources_5.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresources%2Farm-resources%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resources_5.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resources_5.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-resources-subscriptions-readme.md b/docs-ref-services/preview/arm-resources-subscriptions-readme.md deleted file mode 100644 index 6d2db9abbaa1..000000000000 --- a/docs-ref-services/preview/arm-resources-subscriptions-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure Subscription client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-resources-subscriptions, resourcessubscriptions -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/20/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure Subscription client library for JavaScript - version 2.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Subscription client. - -All resource groups and resources exist within subscriptions. These operation enable you get information about your subscriptions and tenants. A tenant is a dedicated instance of Azure Active Directory (Azure AD) for your organization. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resources-subscriptions_2.0.0-beta.1/sdk/resources-subscriptions/arm-resources-subscriptions) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resources-subscriptions) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resources-subscriptions) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-resources-subscriptions` package - -Install the Azure Subscription client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-resources-subscriptions -``` - -### Create and authenticate a `SubscriptionClient` - -To create a client object to access the Azure Subscription API, you will need the `endpoint` of your Azure Subscription resource and a `credential`. The Azure Subscription client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Subscription resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure Subscription** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { SubscriptionClient } = require("@azure/arm-resources-subscriptions"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new SubscriptionClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### SubscriptionClient - -`SubscriptionClient` is the primary interface for developers using the Azure Subscription client library. Explore the methods on this client object to understand the different features of the Azure Subscription service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resources-subscriptions_2.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-resources-subscriptions_2.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresources-subscriptions%2Farm-resources-subscriptions%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resources-subscriptions_2.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-resources-subscriptions_2.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-search-readme.md b/docs-ref-services/preview/arm-search-readme.md deleted file mode 100644 index 9e491b17dc71..000000000000 --- a/docs-ref-services/preview/arm-search-readme.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Azure SearchManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-search, search -author: qiaozha -ms.author: qiaozha -ms.date: 11/29/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: cognitive-search ---- - -# Azure SearchManagement client library for JavaScript - version 3.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure SearchManagement client. - -Client that can be used to manage Azure Cognitive Search services and API keys. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-search_3.0.0-beta.1/sdk/search/arm-search) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-search) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-search?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-search` package - -Install the Azure SearchManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-search -``` - -### Create and authenticate a `SearchManagementClient` - -To create a client object to access the Azure SearchManagement API, you will need the `endpoint` of your Azure SearchManagement resource and a `credential`. The Azure SearchManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure SearchManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-search_3.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure SearchManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { SearchManagementClient } = require("@azure/arm-search"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new SearchManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### SearchManagementClient - -`SearchManagementClient` is the primary interface for developers using the Azure SearchManagement client library. Explore the methods on this client object to understand the different features of the Azure SearchManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-search_3.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-search_3.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fsearch%2Farm-search%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-search_3.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-search_3.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-selfhelp-readme.md b/docs-ref-services/preview/arm-selfhelp-readme.md deleted file mode 100644 index 195f9e41ae31..000000000000 --- a/docs-ref-services/preview/arm-selfhelp-readme.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: Azure HelpRP client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-selfhelp, selfhelp -author: xirzec -ms.author: jeffish -ms.date: 05/23/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: selfhelp ---- -# Azure HelpRP client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure HelpRP client. - -Help RP provider - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-selfhelp_1.0.0-beta.1/sdk/selfhelp/arm-selfhelp) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-selfhelp) | -[API reference documentation](/javascript/api/@azure/arm-selfhelp?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-selfhelp_1.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-selfhelp` package - -Install the Azure HelpRP client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-selfhelp -``` - -### Create and authenticate a `HelpRP` - -To create a client object to access the Azure HelpRP API, you will need the `endpoint` of your Azure HelpRP resource and a `credential`. The Azure HelpRP client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure HelpRP resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-selfhelp_1.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure HelpRP** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { HelpRP } = require("@azure/arm-selfhelp"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const client = new HelpRP(new DefaultAzureCredential()); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new HelpRP(credential); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### HelpRP - -`HelpRP` is the primary interface for developers using the Azure HelpRP client library. Explore the methods on this client object to understand the different features of the Azure HelpRP service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-selfhelp_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-selfhelp_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fselfhelp%2Farm-selfhelp%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-selfhelp_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-selfhelp_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-servicefabric-readme.md b/docs-ref-services/preview/arm-servicefabric-readme.md deleted file mode 100644 index d2ca2295c602..000000000000 --- a/docs-ref-services/preview/arm-servicefabric-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure ServiceFabricManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-servicefabric, servicefabric -author: ramya-rao-a -ms.author: ramyar -ms.date: 11/05/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: service-fabric ---- - -# Azure ServiceFabricManagement client library for JavaScript - version 2.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ServiceFabricManagement client. - -Service Fabric Management Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-servicefabric_2.0.0-beta.1/sdk/servicefabric/arm-servicefabric) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-servicefabric) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-servicefabric) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-servicefabric` package - -Install the Azure ServiceFabricManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-servicefabric -``` - -### Create and authenticate a `ServiceFabricManagementClient` - -To create a client object to access the Azure ServiceFabricManagement API, you will need the `endpoint` of your Azure ServiceFabricManagement resource and a `credential`. The Azure ServiceFabricManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure ServiceFabricManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-servicefabric_2.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure ServiceFabricManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { ServiceFabricManagementClient } = require("@azure/arm-servicefabric"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new ServiceFabricManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### ServiceFabricManagementClient - -`ServiceFabricManagementClient` is the primary interface for developers using the Azure ServiceFabricManagement client library. Explore the methods on this client object to understand the different features of the Azure ServiceFabricManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-servicefabric_2.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-servicefabric_2.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fservicefabric%2Farm-servicefabric%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-servicefabric_2.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-servicefabric_2.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-storage-readme.md b/docs-ref-services/preview/arm-storage-readme.md deleted file mode 100644 index 0abcb01ddad8..000000000000 --- a/docs-ref-services/preview/arm-storage-readme.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Azure StorageManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-storage, storage -author: ramya-rao-a -ms.author: ramyar -ms.date: 10/15/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: storage ---- - -# Azure StorageManagement client library for JavaScript - version 17.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure StorageManagement client. - -The Azure Storage Management API. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-storage_17.0.0-beta.1/sdk/storage/arm-storage) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-storage) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-storage) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-storage` package - -Install the Azure StorageManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-storage -``` - -### Create and authenticate a `StorageManagementClient` - -To create a client object to access the Azure StorageManagement API, you will need the `endpoint` of your Azure StorageManagement resource and a `credential`. The Azure StorageManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure StorageManagement resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure StorageManagement by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -```javascript -const { StorageManagementClient } = require("@azure/arm-storage"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new StorageManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### StorageManagementClient - -`StorageManagementClient` is the primary interface for developers using the Azure StorageManagement client library. Explore the methods on this client object to understand the different features of the Azure StorageManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-storage_17.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-storage_17.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Farm-storage%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-storage_17.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-storage_17.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-storagecache-readme.md b/docs-ref-services/preview/arm-storagecache-readme.md deleted file mode 100644 index e13397c87e6b..000000000000 --- a/docs-ref-services/preview/arm-storagecache-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure StorageCacheManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-storagecache, storagecache -author: xirzec -ms.author: jeffish -ms.date: 03/22/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: storagecache ---- -# Azure StorageCacheManagement client library for JavaScript - version 7.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure StorageCacheManagement client. - -A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-storagecache_7.0.0-beta.1/sdk/storagecache/arm-storagecache) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-storagecache) | -[API reference documentation](/javascript/api/@azure/arm-storagecache?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-storagecache_7.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-storagecache` package - -Install the Azure StorageCacheManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-storagecache -``` - -### Create and authenticate a `StorageCacheManagementClient` - -To create a client object to access the Azure StorageCacheManagement API, you will need the `endpoint` of your Azure StorageCacheManagement resource and a `credential`. The Azure StorageCacheManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure StorageCacheManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-storagecache_7.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure StorageCacheManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { StorageCacheManagementClient } = require("@azure/arm-storagecache"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new StorageCacheManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new StorageCacheManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### StorageCacheManagementClient - -`StorageCacheManagementClient` is the primary interface for developers using the Azure StorageCacheManagement client library. Explore the methods on this client object to understand the different features of the Azure StorageCacheManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-storagecache_7.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-storagecache_7.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstoragecache%2Farm-storagecache%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-storagecache_7.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-storagecache_7.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-streamanalytics-readme.md b/docs-ref-services/preview/arm-streamanalytics-readme.md deleted file mode 100644 index cfb78e599a0d..000000000000 --- a/docs-ref-services/preview/arm-streamanalytics-readme.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Azure Stream Analytics Management client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-streamanalytics, streamanalytics -description: This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Stream Analytics Management client. -ms.date: 11/02/2021 -ms.topic: reference -ms.devlang: javascript -ms.service: stream-analytics ---- - -# Azure Stream Analytics Management client library for JavaScript - version 3.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Stream Analytics Management client. - -Stream Analytics Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-streamanalytics_3.0.0-beta.1/sdk/streamanalytics/arm-streamanalytics) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-streamanalytics) | -[API reference documentation](/javascript/api/@azure/arm-streamanalytics) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-streamanalytics` package - -Install the Azure Stream Analytics Management client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-streamanalytics -``` - -### Create and authenticate a `StreamAnalyticsManagementClient` - -To create a client object to access the Azure Stream Analytics Management API, you will need the `endpoint` of your Azure Stream Analytics Management resource and a `credential`. The Azure Stream Analytics Management client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Stream Analytics Management resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-streamanalytics_3.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Stream Analytics Management** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { StreamAnalyticsManagementClient } = require("@azure/arm-streamanalytics"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new StreamAnalyticsManagementClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### StreamAnalyticsManagementClient - -`StreamAnalyticsManagementClient` is the primary interface for developers using the Azure Stream Analytics Management client library. Explore the methods on this client object to understand the different features of the Azure Stream Analytics Management service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-streamanalytics_3.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-streamanalytics_3.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstreamanalytics%2Farm-streamanalytics%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-streamanalytics_3.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-streamanalytics_3.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-templatespecs-readme.md b/docs-ref-services/preview/arm-templatespecs-readme.md deleted file mode 100644 index 7df1d46c985a..000000000000 --- a/docs-ref-services/preview/arm-templatespecs-readme.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Azure TemplateSpecs client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-templatespecs, templatespecs -author: ramya-rao-a -ms.author: ramyar -ms.date: 08/26/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- - -# Azure TemplateSpecs client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure TemplateSpecs client. - -The APIs listed in this specification can be used to manage Template Spec resources through the Azure Resource Manager. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-templatespecs_1.0.0-beta.1/sdk/templatespecs/arm-templatespecs) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-templatespecs) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-templatespecs) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-templatespecs` package - -Install the Azure TemplateSpecs client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-templatespecs -``` - -### Create and authenticate a `TemplateSpecsClient` - -To create a client object to access the Azure TemplateSpecs API, you will need the `endpoint` of your Azure TemplateSpecs resource and a `credential`. The Azure TemplateSpecs client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure TemplateSpecs resource in the [Azure Portal][azure_portal]. - -#### Using an Azure Active Directory Credential - -You can authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][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 and grant access to Azure TemplateSpecs** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { TemplateSpecsClient } = require("@azure/arm-templatespecs"); -const { DefaultAzureCredential } = require("@azure/identity"); -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new TemplateSpecsClient(new DefaultAzureCredential(), subscriptionId); -``` - -## Key concepts - -### TemplateSpecsClient - -`TemplateSpecsClient` is the primary interface for developers using the Azure TemplateSpecs client library. Explore the methods on this client object to understand the different features of the Azure TemplateSpecs service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-templatespecs_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-templatespecs_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftemplatespecs%2Farm-templatespecs%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-templatespecs_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-templatespecs_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-trafficmanager-readme.md b/docs-ref-services/preview/arm-trafficmanager-readme.md deleted file mode 100644 index fae74b59ebe8..000000000000 --- a/docs-ref-services/preview/arm-trafficmanager-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure TrafficManagerManagement client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-trafficmanager, trafficmanager -author: qiaozha -ms.author: qiaozha -ms.date: 11/21/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: trafficmanager ---- -# Azure TrafficManagerManagement client library for JavaScript - version 6.1.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure TrafficManagerManagement client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-trafficmanager_6.1.0-beta.1/sdk/trafficmanager/arm-trafficmanager) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-trafficmanager) | -[API reference documentation](/javascript/api/@azure/arm-trafficmanager?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-trafficmanager_6.1.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-trafficmanager` package - -Install the Azure TrafficManagerManagement client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-trafficmanager -``` - -### Create and authenticate a `TrafficManagerManagementClient` - -To create a client object to access the Azure TrafficManagerManagement API, you will need the `endpoint` of your Azure TrafficManagerManagement resource and a `credential`. The Azure TrafficManagerManagement client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure TrafficManagerManagement resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-trafficmanager_6.1.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure TrafficManagerManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { TrafficManagerManagementClient } = require("@azure/arm-trafficmanager"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new TrafficManagerManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new TrafficManagerManagementClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### TrafficManagerManagementClient - -`TrafficManagerManagementClient` is the primary interface for developers using the Azure TrafficManagerManagement client library. Explore the methods on this client object to understand the different features of the Azure TrafficManagerManagement service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-trafficmanager_6.1.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-trafficmanager_6.1.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftrafficmanager%2Farm-trafficmanager%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-trafficmanager_6.1.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-trafficmanager_6.1.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-voiceservices-readme.md b/docs-ref-services/preview/arm-voiceservices-readme.md deleted file mode 100644 index 4f18bbb33245..000000000000 --- a/docs-ref-services/preview/arm-voiceservices-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure MicrosoftVoiceServices client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-voiceservices, voiceservices -author: xirzec -ms.author: jeffish -ms.date: 03/08/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: voiceservices ---- -# Azure MicrosoftVoiceServices client library for JavaScript - version 1.0.0-beta.1 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure MicrosoftVoiceServices client. - - - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-voiceservices_1.0.0-beta.1/sdk/voiceservices/arm-voiceservices) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-voiceservices) | -[API reference documentation](/javascript/api/@azure/arm-voiceservices) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-voiceservices_1.0.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-voiceservices` package - -Install the Azure MicrosoftVoiceServices client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-voiceservices -``` - -### Create and authenticate a `MicrosoftVoiceServices` - -To create a client object to access the Azure MicrosoftVoiceServices API, you will need the `endpoint` of your Azure MicrosoftVoiceServices resource and a `credential`. The Azure MicrosoftVoiceServices client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure MicrosoftVoiceServices resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-voiceservices_1.0.0-beta.1/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure MicrosoftVoiceServices** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { MicrosoftVoiceServices } = require("@azure/arm-voiceservices"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new MicrosoftVoiceServices(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new MicrosoftVoiceServices(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### MicrosoftVoiceServices - -`MicrosoftVoiceServices` is the primary interface for developers using the Azure MicrosoftVoiceServices client library. Explore the methods on this client object to understand the different features of the Azure MicrosoftVoiceServices service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-voiceservices_1.0.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-voiceservices_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fvoiceservices%2Farm-voiceservices%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-voiceservices_1.0.0-beta.1/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-voiceservices_1.0.0-beta.1/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/arm-workloads-readme.md b/docs-ref-services/preview/arm-workloads-readme.md deleted file mode 100644 index f26cc7b5e486..000000000000 --- a/docs-ref-services/preview/arm-workloads-readme.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: Azure Workloads client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/arm-workloads, workloads -author: xirzec -ms.author: jeffish -ms.date: 03/03/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: workloads ---- -# Azure Workloads client library for JavaScript - version 1.0.0-beta.3 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Workloads client. - -Workloads client provides access to various workload operations - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-workloads_1.0.0-beta.3/sdk/workloads/arm-workloads) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-workloads) | -[API reference documentation](/javascript/api/@azure/arm-workloads?view=azure-node-preview) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-workloads_1.0.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. - -### Install the `@azure/arm-workloads` package - -Install the Azure Workloads client library for JavaScript with `npm`: - -```bash -npm install @azure/arm-workloads -``` - -### Create and authenticate a `WorkloadsClient` - -To create a client object to access the Azure Workloads API, you will need the `endpoint` of your Azure Workloads resource and a `credential`. The Azure Workloads client can use Azure Active Directory credentials to authenticate. -You can find the endpoint for your Azure Workloads resource in the [Azure Portal][azure_portal]. - -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-workloads_1.0.0-beta.3/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). - -To use the [DefaultAzureCredential][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 and grant access to Azure Workloads** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -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`. - -For more information about how to create an Azure AD Application check out [this guide](/azure/active-directory/develop/howto-create-service-principal-portal). - -```javascript -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - -const subscriptionId = "00000000-0000-0000-0000-000000000000"; -const client = new WorkloadsClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new WorkloadsClient(credential, subscriptionId); -``` - - -### JavaScript Bundle -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### WorkloadsClient - -`WorkloadsClient` is the primary interface for developers using the Azure Workloads client library. Explore the methods on this client object to understand the different features of the Azure Workloads service that you can access. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-workloads_1.0.0-beta.3/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/arm-workloads_1.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fworkloads%2Farm-workloads%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-workloads_1.0.0-beta.3/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/arm-workloads_1.0.0-beta.3/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/communication-email-readme.md b/docs-ref-services/preview/communication-email-readme.md deleted file mode 100644 index be57a49453af..000000000000 --- a/docs-ref-services/preview/communication-email-readme.md +++ /dev/null @@ -1,201 +0,0 @@ ---- -title: Azure Communication Email client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/communication-email, communication -author: xirzec -ms.author: jeffish -ms.date: 03/07/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: communication ---- -# Azure Communication Email client library for JavaScript - version 1.0.0-beta.2 - - -This package contains a JavaScript/TypeScript SDK for Azure Communication Services for Email. - -## Getting started - -### Prerequisites - -You need an [Azure subscription][azure_sub], a [Communication Service Resource][communication_resource_docs], and an [Email Communication Resource][email_resource_docs] with an active [Domain][domain_overview]. - -To create these resource, you can use the [Azure Portal][communication_resource_create_portal], the [Azure PowerShell][communication_resource_create_power_shell], or the [.NET management client library][communication_resource_create_net]. - -### Installing - -```bash -npm install @azure/communication-email -``` - -## Examples - -`EmailClient` provides the functionality to send email messages. - -## Authentication - -Email clients can be authenticated using the connection string acquired from an Azure Communication Resource in the [Azure Portal][azure_portal]. - -```javascript -const { EmailClient } = require("@azure/communication-email"); - -const connectionString = `endpoint=https://.communication.azure.com/;accessKey=`; -const client = new EmailClient(connectionString); -``` - -You can also authenticate with Azure Active Directory using the [Azure Identity library][azure_identity]. To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the [`@azure/identity`][azure_identity] package: - -```bash -npm install @azure/identity -``` - -The [`@azure/identity`][azure_identity] package provides a variety of credential types that your application can use to do this. The README for @azure/identity provides more details and samples to get you started. -AZURE_CLIENT_SECRET, AZURE_CLIENT_ID and AZURE_TENANT_ID environment variables are needed to create a DefaultAzureCredential object. - -```typescript -import { DefaultAzureCredential } from "@azure/identity"; -import { EmailClient } from "@azure/communication-email"; - -const endpoint = "https://.communication.azure.com"; -let credential = new DefaultAzureCredential(); -const client = new EmailClient(endpoint, credential); -``` - -### Send an Email Message - -To send an email message, call the `beginSend` function from the `EmailClient`. This will return a poller. You can use this poller to check on the status of the operation and retrieve the result once it's finished. - -```javascript Snippet:Azure_Communication_Email_Send -const message = { - senderAddress: "sender@contoso.com", - content: { - subject: "This is the subject", - plainText: "This is the body", - }, - recipients: { - to: [ - { - address: "customer@domain.com", - displayName: "Customer Name", - }, - ], - }, -}; - -const poller = await emailClient.beginSend(message); -const response = await poller.pollUntilDone(); -``` - -### Send an Email Message to Multiple Recipients - -To send an email message to multiple recipients, add a object for each recipient type and an object for each recipient. - -```javascript Snippet:Azure_Communication_Email_Send_Multiple_Recipients -const message = { - senderAddress: "sender@contoso.com", - content: { - subject: "This is the subject", - plainText: "This is the body", - }, - recipients: { - to: [ - { - address: "customer1@domain.com", - displayName: "Customer Name 1", - }, - { - address: "customer2@domain.com", - displayName: "Customer Name 2", - }, - ], - cc: [ - { - address: "ccCustomer1@domain.com", - displayName: " CC Customer 1", - }, - { - address: "ccCustomer2@domain.com", - displayName: "CC Customer 2", - }, - ], - bcc: [ - { - address: "bccCustomer1@domain.com", - displayName: " BCC Customer 1", - }, - { - address: "bccCustomer2@domain.com", - displayName: "BCC Customer 2", - }, - ], - }, -}; - -const poller = await emailClient.beginSend(message); -const response = await poller.pollUntilDone(); -``` - -### Send Email with Attachments - -Azure Communication Services support sending email with attachments. - -```javascript Snippet:Azure_Communication_Email_Send_With_Attachments -const filePath = "C://readme.txt"; - -const message = { - senderAddress: "sender@contoso.com", - content: { - subject: "This is the subject", - plainText: "This is the body", - }, - recipients: { - to: [ - { - address: "customer@domain.com", - displayName: "Customer Name", - }, - ], - }, - attachments: [ - { - name: path.basename(filePath), - contentType: "text/plain", - contentInBase64: readFileSync(filePath, "base64"), - }, - ], -}; - -const response = await emailClient.send(message); -``` - -## Next steps - -- [Read more about Email in Azure Communication Services][nextsteps] - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla]. - -This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. - - - -[azure_sub]: https://azure.microsoft.com/free/dotnet/ -[azure_portal]: https://portal.azure.com -[cla]: https://cla.microsoft.com -[coc]: https://opensource.microsoft.com/codeofconduct/ -[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ -[coc_contact]: mailto:opencode@microsoft.com -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/communication-email_1.0.0-beta.2/sdk/identity/identity#defaultazurecredential -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/communication-email_1.0.0-beta.2/sdk/identity/identity -[communication_resource_docs]: /azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[email_resource_docs]: https://aka.ms/acsemail/createemailresource -[communication_resource_create_portal]: /azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp -[communication_resource_create_power_shell]: /powershell/module/az.communication/new-azcommunicationservice -[communication_resource_create_net]: /azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net -[package]: https://www.nuget.org/packages/Azure.Communication.Common/ -[product_docs]: https://aka.ms/acsemail/overview -[nextsteps]: https://aka.ms/acsemail/overview -[nuget]: https://www.nuget.org/ -[source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication -[domain_overview]: https://aka.ms/acsemail/domainsoverview - diff --git a/docs-ref-services/preview/communication-identity-readme.md b/docs-ref-services/preview/communication-identity-readme.md deleted file mode 100644 index accea323c027..000000000000 --- a/docs-ref-services/preview/communication-identity-readme.md +++ /dev/null @@ -1,169 +0,0 @@ ---- -title: Azure Communication Identity client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/communication-identity, communication -author: petrsvihlik -ms.author: petrsvihlik -ms.date: 04/05/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure-communication-services -ms.subservice: identity ---- -# Azure Communication Identity client library for JavaScript - version 1.1.0-beta.2 - - -The identity library is used for managing users and tokens for Azure Communication Services. - -## Getting started - -### Prerequisites - -- An [Azure subscription][azure_sub]. -- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli]. - -### Installing - -```bash -npm install @azure/communication-identity -``` - -### Browser support - -#### JavaScript Bundle - -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -## Key concepts - -### Clients - -The `CommunicationIdentityClient` provides methods to manage users and their tokens. - -## Examples - -## Authentication - -You can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` with any of the following methods: - -### Create `KeyCredential` with `AzureKeyCredential` before initializing the client - -```typescript -import { AzureKeyCredential } from "@azure/core-auth"; -import { CommunicationIdentityClient } from "@azure/communication-identity"; - -const credential = new AzureKeyCredential(KEY); -const client = new CommunicationIdentityClient(ENDPOINT, credential); -``` - -### Using a connection string - -```typescript -import { CommunicationIdentityClient } from "@azure/communication-identity"; - -const connectionString = `endpoint=ENDPOINT;accessKey=KEY`; -const client = new CommunicationIdentityClient(connectionString); -``` - -### Using a `TokenCredential` - -```typescript -import { DefaultAzureCredential } from "@azure/identity"; -import { CommunicationIdentityClient } from "@azure/communication-identity"; - -const credential = new DefaultAzureCredential(); -const client = new CommunicationIdentityClient(ENDPOINT, credential); -``` - -If you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal]. - -## Usage - -### Creating an instance of CommunicationIdentityClient - -```typescript -import { CommunicationIdentityClient } from "@azure/communication-identity"; - -const client = new CommunicationIdentityClient(CONNECTION_STRING); -``` - -### Creating a new user - -Use the `createUser` method to create a new user. - -```typescript -const user = await client.createUser(); -``` - -### Creating and refreshing a user token - -Use the `getToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include: - -- `chat` (Chat) -- `voip` (Voice over IP) - -```typescript -let { token } = await client.getToken(user, ["chat"]); -``` - -To refresh the user token, issue another token with the same user. - -```typescript -let { token } = await client.getToken(user, ["chat"]); -``` - -### Creating a user and a token in a single request - -For convenience, use `createUserAndToken` to create a new user and issue a token with one function call. This translates into a single web request as opposed to creating a user first and then issuing a token. - -```typescript -let { user, token } = await client.createUserAndToken(["chat"]); -``` - -### Revoking tokens for a user - -Use the `revokeTokens` method to revoke all issued tokens for a user. - -```typescript -await client.revokeTokens(user); -``` - -### Deleting a user - -Use the `deleteUser` method to delete a user. - -```typescript -await client.deleteUser(user); -``` - -### Exchanging AAD access token of a Teams User for a Communication access token - -Use `getTokenForTeamsUser` method to exchange an AAD access token of a Teams user for a new `CommunicationAccessToken` with a matching expiration time. - -```typescript -await client.getTokenForTeamsUser(''); -``` - -## Troubleshooting - -## Next steps - -Please take a look at the -[samples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/communication-identity_1.1.0-beta.2/sdk/communication/communication-identity/samples) -directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/communication-identity_1.1.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-identity%2FREADME.png) - diff --git a/docs-ref-services/preview/communication-rooms-readme.md b/docs-ref-services/preview/communication-rooms-readme.md deleted file mode 100644 index d8dc61c55eb3..000000000000 --- a/docs-ref-services/preview/communication-rooms-readme.md +++ /dev/null @@ -1,248 +0,0 @@ ---- -title: Azure RoomsApi client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/communication-rooms, communication -author: xirzec -ms.author: jeffish -ms.date: 05/17/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: communication ---- -# Azure RoomsApi client library for JavaScript - version 1.0.0-beta.2 - - -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure RoomsApi client. - -Communication Rooms Client - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/communication-rooms_1.0.0-beta.2/sdk/communication/communication-rooms) | -[Package (NPM)](https://www.npmjs.com/package/@azure/communication-rooms) | -[Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/communication-rooms_1.0.0-beta.2/sdk/communication/communication-rooms/samples) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge and Firefox. - -### Prerequisites - -- An [Azure subscription][azure_sub]. -- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the [Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli]. - -### JavaScript Bundle - -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -### Installing - -```bash -npm install @azure/communication-rooms -``` - -## Key concepts - -### RoomsApiClient - -`RoomsClient` is the primary interface for developers using the Azure RoomsApi client library. Explore the methods on this client object to understand the different features of the Azure RoomsApi service that you can access. - -## Examples - -## Authentication - -You can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `RoomsClient` with any of the following methods: - -### Create `KeyCredential` with `AzureKeyCredential` before initializing the client - -```typescript -import { AzureKeyCredential } from "@azure/core-auth"; -import { RoomsClient } from "@azure/communication-rooms"; - -const credential = new AzureKeyCredential(KEY); -const client = new RoomsClient(ENDPOINT, credential); -``` - -### Using a connection string - -```typescript -import { RoomsClient } from "@azure/communication-rooms"; - -const connectionString = `endpoint=ENDPOINT;accessKey=KEY`; -const client = new RoomsClient(connectionString); -``` - -### Using a `TokenCredential` - -```typescript -import { DefaultAzureCredential } from "@azure/identity"; -import { RoomsClient } from "@azure/communication-rooms"; - -const credential = new DefaultAzureCredential(); -const client = new RoomsClient(ENDPOINT, credential); -``` - -If you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal]. - -## Usage - -### Create a room - -To create a room, call the `createRoom` method. All settings are optional. - -If `validFrom` is not provided, it is defaulted to the current datetime. If `validUntil` is not provided, the default is `validFrom + 180 days`. - -When defining `participants`, if `role` is not specified, then it will be `attendee` by default. - -```js -// create users with CommunicationIdentityClient -const identityClient = new CommunicationIdentityClient(connectionString); -const user1 = await identityClient.createUserAndToken(["voip"]); - -// create RoomsClient -const roomsClient: RoomsClient = new RoomsClient(CONNECTION_STRING); - -const validFrom = new Date(Date.now()); -let validForDays = 10; -let validUntil = new Date(validFrom.getTime()); -validUntil.setDate(validFrom.getDate() + validForDays); - -// options payload to create a room -const createRoomOptions: CreateRoomOptions = { - validFrom, - validUntil, - participants: [ - { - id: user1.user, - role: "Attendee", - }, - ], -}; - -// create room -const room = await roomsClient.createRoom(createRoomOptions); -``` - -[Find CommunicationIdentityClient here](https://github.com/Azure/azure-sdk-for-js/edit/main/sdk/communication/communication-identity) - -### Update a room - -To update the `validFrom` and `validUntil` settings of a room use the `updateRoom` method. - -```js -validForDays = 60; -validUntil.setDate(validFrom.getDate() + validForDays); -const updateRoomOptions: UpdateRoomOptions = { - validFrom, - validUntil, -}; - -// update the room using the room id from the creation operation -const updatedRoom = await roomsClient.updateRoom(room.id, updateRoomOptions); -``` - -### Get a room - -To get a room use the `getRoom` method. - -```js -const roomId = "ROOM_ID"; -room = await roomsClient.getRoom(roomId); -``` - -### List rooms - -List all rooms using the `listRooms` method. - -```js -const roomsList = await roomsClient.listRooms(); -for await (const currentRoom of roomsList) { - // access room data - console.log(`The room id is ${currentRoom.id}.`); -} -``` - -### Add or update participants - -To add new participants, or update existing participants, use the `addOrUpdateParticipants` method. - -```js -const user2 = await identityClient.createUserAndToken(["voip"]); -const updateParticipantsList: InvitedRoomParticipant[] = [ - { - id: user1.user, - role: "Presenter", - }, - { - id: user2.user, - }, -]; - -// run addOrUpdate operation -await roomsClient.addOrUpdateParticipants(room.id, updateParticipantsList); -``` - -### Remove participants - -To remove participants call the `removeParticipants` method. - -```js -const participantsToRemove = [user1.user, user2.user]; -await roomsClient.removeParticipants(room.id, participantsToRemove); -``` - -### Get participants in a room - -To list all the participants in a room call the `listParticipants` method. - -```js -const participantsList = await roomsClient.listParticipants(room.id); -for await (const participant of participantsList) { - // access participant data - console.log(`The participant's role is ${participant.role}.`); -} -``` - -### Delete a room - -Use the `deleteRoom` method to delete a room. - -```js -await roomsClient.deleteRoom(room.id); -``` - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/communication-rooms_1.0.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/communication-rooms_1.0.0-beta.2/sdk/communication/communication-rooms/samples) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/communication-rooms_1.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-rooms%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/communication-rooms_1.0.0-beta.2/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/communication-rooms_1.0.0-beta.2/sdk/identity/identity#defaultazurecredential -[communication_identity]: https://github.com/Azure/azure-sdk-for-js/edit/main/sdk/communication/communication-identity - diff --git a/docs-ref-services/preview/container-registry-readme.md b/docs-ref-services/preview/container-registry-readme.md deleted file mode 100644 index f276a9a9e4d1..000000000000 --- a/docs-ref-services/preview/container-registry-readme.md +++ /dev/null @@ -1,298 +0,0 @@ ---- -title: Azure Container Registry client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/container-registry, containerregistry -author: jeremymeng -ms.author: yumeng -ms.date: 04/14/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: containerregistry ---- -# Azure Container Registry client library for JavaScript - version 1.1.0-beta.3 - - -Azure Container Registry allows you to store and manage container images and artifacts in a private registry for all types of container deployments. - -Use the client library for Azure Container Registry to: - -- List images or artifacts in a registry -- Obtain metadata for images and artifacts, repositories and tags -- Set read/write/delete properties on registry items -- Delete images and artifacts, repositories and tags - -Key links: - -- [Source code][source] -- [Package (NPM)][package] -- [API reference documentation][api_docs] -- [REST API documentation][rest_docs] -- [Product documentation][product_docs] -- [Samples][samples] - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/container-registry_1.1.0-beta.3/SUPPORT.md) for more details. - -> Note: This package cannot be used in the browser due to service limitations, please refer to [this document][cors] for guidance. - -### Prerequisites - -- An [Azure Subscription](https://azure.microsoft.com) -- A [Container Registry account][container_registry_docs] - -To create a new Container Registry, you can use the [Azure Portal][container_registry_create_portal], -[Azure PowerShell][container_registry_create_ps], or the [Azure CLI][container_registry_create_cli]. -Here's an example using the Azure CLI: - -```Powershell -az acr create --name MyContainerRegistry --resource-group MyResourceGroup --location westus --sku Basic -``` - -### Install the `@azure/container-registry` package - -Install the Container Registry client library for JavaScript with `npm`: - -```bash -npm install @azure/container-registry -``` - -### Authenticate the client - -The [Azure Identity library][identity] provides easy Azure Active Directory support for authentication. - -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT; -// Create a ContainerRegistryClient that will authenticate through Active Directory -const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { - audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, -}); -``` - -Note that these samples assume you have a `CONTAINER_REGISTRY_ENDPOINT` environment variable set, which is the URL including the name of the login server and the `https://` prefix. - -#### National Clouds - -To authenticate with a registry in a [National Cloud](/azure/active-directory/develop/authentication-national-cloud), you will need to make the following additions to your configuration: - -- Set the `authorityHost` in the credential options or via the `AZURE_AUTHORITY_HOST` environment variable -- Set the `audience` in `ContainerRegistryClientOptions` - -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential, AzureAuthorityHosts } = require("@azure/identity"); - -const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT; -// Create a ContainerRegistryClient that will authenticate through AAD in the China national cloud -const client = new ContainerRegistryClient( - endpoint, - new DefaultAzureCredential({ authorityHost: AzureAuthorityHosts.AzureChina }), - { - audience: KnownContainerRegistryAudience.AzureResourceManagerChina, - } -); -``` - -For more information on using AAD with Azure Container Registry, please see the service's [Authentication Overview](/azure/container-registry/container-registry-authentication). - -## Key concepts - -A **registry** stores Docker images and [OCI Artifacts](https://opencontainers.org/). An image or artifact consists of a **manifest** and **layers**. An image's manifest describes the layers that make up the image, and is uniquely identified by its **digest**. An image can also be "tagged" to give it a human-readable alias. An image or artifact can have zero or more **tags** associated with it, and each tag uniquely identifies the image. A collection of images that share the same name but have different tags, is referred to as a **repository**. - -For more information please see [Container Registry Concepts](/azure/container-registry/container-registry-concepts). - -## Examples - -### Listing repositories - -Iterate through the collection of repositories in the registry. - -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function main() { - // endpoint should be in the form of "https://myregistryname.azurecr.io" - // where "myregistryname" is the actual name of your registry - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { - audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, - }); - - console.log("Listing repositories"); - const iterator = client.listRepositoryNames(); - for await (const repository of iterator) { - console.log(` repository: ${repository}`); - } -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - -### List tags with anonymous access - -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); - -async function main() { - // Get the service endpoint from the environment - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - - // Create a new ContainerRegistryClient for anonymous access - const client = new ContainerRegistryClient(endpoint, { - audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, - }); - - // Obtain a RegistryArtifact object to get access to image operations - const image = client.getArtifact("library/hello-world", "latest"); - - // List the set of tags on the hello_world image tagged as "latest" - const tagIterator = image.listTagProperties(); - - // Iterate through the image's tags, listing the tagged alias for the image - console.log(`${image.fullyQualifiedReference} has the following aliases:`); - for await (const tag of tagIterator) { - console.log(` ${tag.registryLoginServer}/${tag.repositoryName}:${tag.name}`); - } -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - -### Set artifact properties - -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function main() { - // Get the service endpoint from the environment - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - - // Create a new ContainerRegistryClient and RegistryArtifact to access image operations - const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { - audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, - }); - const image = client.getArtifact("library/hello-world", "v1"); - - // Set permissions on the image's "latest" tag - await image.updateTagProperties("latest", { canWrite: false, canDelete: false }); -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - -### Delete images - -```javascript -const { - ContainerRegistryClient, - KnownContainerRegistryAudience, -} = require("@azure/container-registry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -async function main() { - // Get the service endpoint from the environment - const endpoint = process.env.CONTAINER_REGISTRY_ENDPOINT || ""; - // Create a new ContainerRegistryClient - const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), { - audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud, - }); - - // Iterate through repositories - const repositoryNames = client.listRepositoryNames(); - for await (const repositoryName of repositoryNames) { - const repository = client.getRepository(repositoryName); - // Obtain the images ordered from newest to oldest by passing the `order` option - const imageManifests = repository.listManifestProperties({ - order: "LastUpdatedOnDescending", - }); - const imagesToKeep = 3; - let imageCount = 0; - // Delete images older than the first three. - for await (const manifest of imageManifests) { - imageCount++; - if (imageCount > imagesToKeep) { - const image = repository.getArtifact(manifest.digest); - console.log(`Deleting image with digest ${manifest.digest}`); - console.log(` Deleting the following tags from the image:`); - for (const tagName of manifest.tags) { - console.log(` ${manifest.repositoryName}:${tagName}`); - image.deleteTag(tagName); - } - await image.delete(); - } - } - } -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); -}); -``` - -## Troubleshooting - -For infomation about troubleshooting, refer to the [troubleshooting guide]. - -## Next steps - -Please take a look at the [samples][samples] directory for detailed examples that demonstrate how to use the client libraries. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/container-registry_1.1.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for Javascript][az_sdk_js] - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcontainerregistry%2Fcontainer-registry%2FREADME.png) - -[azure_sub]: https://azure.microsoft.com/free/ -[acr_resource]: https://ms.portal.azure.com/#create/Microsoft.ContainerRegistry -[source]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/container-registry_1.1.0-beta.3/sdk/containerregistry/container-registry/ -[package]: https://www.npmjs.com/package/@azure/container-registry -[api_docs]: /javascript/api/@azure/container-registry -[rest_docs]: /rest/api/containerregistry/ -[product_docs]: /azure/container-registry/ -[cors]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/container-registry_1.1.0-beta.3/samples/cors/ts/README.md -[samples]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/container-registry_1.1.0-beta.3/sdk/containerregistry/container-registry/samples -[container_registry_docs]: /azure/container-registry/container-registry-intro -[container_registry_create_ps]: /azure/container-registry/container-registry-get-started-powershell -[container_registry_create_cli]: /azure/container-registry/container-registry-get-started-azure-cli -[container_registry_create_portal]: /azure/container-registry/container-registry-get-started-portal -[container_registry_concepts]: /azure/container-registry/container-registry-concepts -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[identity]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/container-registry_1.1.0-beta.3/sdk/identity/identity/README.md -[az_sdk_js]: https://github.com/Azure/azure-sdk-for-js -[troubleshooting guide]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/container-registry_1.1.0-beta.3/sdk/containerregistry/container-registry/TROUBLESHOOTING.md - diff --git a/docs-ref-services/preview/core-client-rest-readme.md b/docs-ref-services/preview/core-client-rest-readme.md deleted file mode 100644 index 1da6c157aaf9..000000000000 --- a/docs-ref-services/preview/core-client-rest-readme.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: Azure Rest Core client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure-rest/core-client, core -author: xirzec -ms.author: jeffish -ms.date: 06/06/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: core ---- -# Azure Rest Core client library for JavaScript - version 1.0.0-beta.10 - - -This library is primarily intended to be used in code generated by [AutoRest](https://github.com/Azure/Autorest) and [`autorest.typescript`](https://github.com/Azure/autorest.typescript). Specifically for rest level clients - -## Getting started - -### Requirements - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure-rest/core-client_1.0.0-beta.10/SUPPORT.md) for more details. - -### Installation - -This package is primarily used in generated code and not meant to be consumed directly by end users. - -## Key concepts - -## Examples - -Examples can be found in the `samples` folder. - -## Next steps - -You can build and run the tests locally by executing `rushx test`. Explore the `test` folder to see advanced usage and behavior of the public classes. - -Learn more about [AutoRest](https://github.com/Azure/autorest) and the [autorest.typescript extension](https://github.com/Azure/autorest.typescript) for generating a compatible client on top of this package. - -## Troubleshooting - -If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new). - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure-rest/core-client_1.0.0-beta.10/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore-rest%2Fcore-client%2FREADME.png) - diff --git a/docs-ref-services/preview/core-lro-readme.md b/docs-ref-services/preview/core-lro-readme.md deleted file mode 100644 index 70bd1348300e..000000000000 --- a/docs-ref-services/preview/core-lro-readme.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: Azure Core LRO client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/core-lro, core -author: xirzec -ms.author: jeffish -ms.date: 05/18/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: core ---- -# Azure Core LRO client library for JavaScript - version 2.3.0-beta.1 - - -`@azure/core-lro` is a JavaScript library that manages long running operations (LROs) against Azure services. Until completion, such operations require consecutive calls to Azure services to update a local representation of the remote operation status. - -**Please note:** This library is included with other Azure SDK libraries that need it. It should not be used as a direct dependency in your projects. - -`@azure/core-lro` is made following our [Long Running Operations guidelines](https://azure.github.io/azure-sdk/typescript_design.html#ts-lro) - -Key links: -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/core-lro_2.3.0-beta.1/sdk/core/core-lro) -- [Package (npm)](https://www.npmjs.com/package/@azure/core-lro) -- [API Reference Documentation](/javascript/api/@azure/core-lro) -- [Samples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/core-lro_2.3.0-beta.1/sdk/core/core-lro/samples) - -## Getting started - -### Install the package - -To install this library for a project under the `azure-sdk-for-js`, make sure you are at the root of that project, then use [Rush](https://rushjs.io/) as follows: - -``` -rush add -p @azure/core-lro -``` - -To install this package outside of the `azure-sdk-for-js`, use `npm install --save @azure/core-lro`. - -### Configure TypeScript - -TypeScript users need to have Node type definitions installed: - -```bash -npm install @types/node -``` - -They will also need to enable `compilerOptions.allowSyntheticDefaultImports` in their -`tsconfig.json`. Note that if you have enabled `compilerOptions.esModuleInterop`, -`allowSyntheticDefaultImports` is enabled by default. -See [TypeScript's compiler options handbook](https://www.typescriptlang.org/docs/handbook/compiler-options.html) -for more information. - -## Key concepts - -@azure/core-lro makes a distinction between the Long Running Operation and its Poller. - -- Whenever we talk about an **operation**, we mean the static representation of a Long Running Operation. - Any operation will have a definition of a **state**, which has an opinionated default set of properties. - The definition of the operation will also have functions that will define how to request new information - about the pending operation, how to request its cancellation, and how to serialize it. -- A **Poller** is an object who's main function is to interact with an operation until the poller is manually stopped, - the operation finishes (either by succeeding or failing) or if a manual request to cancel the operation has succeeded. - Some characteristics of the pollers are: - - Pollers show the status of the polling behavior. - - Pollers support manual as well as automatic polling. - - Pollers are serializable and can resume from a serialized operation. - - Pollers also specify how much of the operation's state is going to be available to the public. -- A **PollerLike** is the public interface of a Poller, which allows for different implementations to be used. - -## Examples - -You will be able to find some working examples of an implementation of an operation and a poller in: - -- [The `@azure/core-lro` samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/core-lro_2.3.0-beta.1/sdk/core/core-lro/samples). -- [The `@azure/core-lro` tests](https://github.com/Azure/azure-sdk-for-js/tree/@azure/core-lro_2.3.0-beta.1/sdk/core/core-lro/test). - -## Troubleshooting - -### Logging - -Logs can be added at the discretion of the library implementing the Long Running Operation poller. -Packages inside of [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) use -[@azure/logger](https://github.com/Azure/azure-sdk-for-js/tree/@azure/core-lro_2.3.0-beta.1/sdk/core/logger). - -## Next steps - -Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/core-lro_2.3.0-beta.1/sdk/core/core-lro/samples) directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/core-lro_2.3.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -### Testing - -To run our tests, first install the dependencies (with `npm install` or `rush install`), -then run the unit tests with: `npm run unit-test`. - -### Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fcore-lro%2FREADME.png) - diff --git a/docs-ref-services/preview/core-tracing-readme.md b/docs-ref-services/preview/core-tracing-readme.md deleted file mode 100644 index 4b822d1e3a41..000000000000 --- a/docs-ref-services/preview/core-tracing-readme.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: -keywords: Azure, javascript, SDK, API, @azure/core-tracing, core -author: xirzec -ms.author: jeffish -ms.date: 02/03/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- -# Azure Core tracing library for JavaScript - -This is the core tracing library that provides low-level interfaces and helper methods for tracing in Azure SDK JavaScript libraries which work in the browser and Node.js. - -## Getting started - -### Installation - -Install this library using npm as follows - -``` -npm install @azure/core-tracing -``` - -## Key Concepts - -The `@azure/core-tracing` package supports enabling tracing for Azure SDK packages, using an [OpenTelemetry](https://opentelemetry.io/) `Tracer`. - -By default, all libraries log with a `NoOpTracer` that takes no action. To enable tracing, you will need to set a global tracer provider following the instructions in the [OpenTelemetry getting started guide](https://opentelemetry.io/docs/js/getting_started/nodejs) or the [Enabling Tracing using OpenTelemetry example](#enabling-tracing-using-opentelemetry) below. - -### Span Propagation - -Core Tracing supports both automatic and manual span propagation. Automatic propagation is handled using OpenTelemetry's API and will work well in most scenarios when run in `Node.js`. - -For customers who require manual propagation, or to provide context propagation in the browser, all client library operations accept an optional options collection where a tracingContext can be passed in and used as the currently active context. Please see the [Manual Span Propagation example](#manual-span-propagation-using-opentelemetry) below for more details. - -### OpenTelemetry Compatibility - -Most Azure SDKs and Microsoft's [Application Insights](https://www.npmjs.com/package/applicationinsights) use [OpenTelemetry](https://opentelemetry.io/) to support tracing. Specifically, we depend on the [@opentelemetry/api](https://www.npmjs.com/package/@opentelemetry/api) npm package. - -As OpenTelemetry iterated on their API towards their 1.0 GA release, our libraries were updated to match. - -Some incompatibility between the libraries is due to mismatches between the OpenTelemetry versions used in either `@azure/core-tracing` or `applicationinsights` when the two are used side-by-side. For folks who are using both an Azure Client Library (and transitively, `@azure/core-tracing`) and Application Insights in the same application, we recommend using the same version of OpenTelemetry for both libraries by upgrading to their latest versions. - -> Please note that we do not foresee any future compatibility concerns now that OpenTelemetry 1.0.0 has been released and the API considered stable. - -#### Compatibility Matrix - -| Core Tracing | Application Insights | @opentelemetry/api | -| ---------------- | -------------------- | ------------------ | -| 1.0.0-preview.10 | | 0.10.2 | -| 1.0.0-preview.11 | 2.1.0-2.1.3 | 1.0.0-rc.0 | -| 1.0.0-preview.12 | ^2.1.4 | ^1.0.0 | -| 1.0.0-preview.13 | ^2.1.4 | ^1.0.0 | - -Please see the [troubleshooting](#troubleshooting) section for additional information about handling compatibility errors. - -## Examples - -### Enabling tracing using OpenTelemetry - -```ts -const opentelemetry = require("@opentelemetry/api"); -const { SimpleSpanProcessor, ConsoleSpanExporter } = require("@opentelemetry/tracing"); - -const provider = new NodeTracerProvider(); -provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter())); -provider.register(); - -// Call some client library methods using automatic span propagation. -``` - -### Manual Span Propagation using OpenTelemetry - -```ts -const opentelemetry = require("@opentelemetry/api"); -// Get a tracer from a registered provider, create a span, and get the current context -const tracer = opentelemetry.trace.getTracer("my-tracer"); -const span = tracer.startSpan("main"); -const ctx = opentelemetry.trace.setSpan(opentelemetry.context.active(), span); - -// Assuming we have an existing BlobClient, let's see if the blob exists. -// The context is passed to the client library as a tracingContext option and will be propagated downstream to any child spans. -const result = await blobClient.exists({ - tracingOptions: { - tracingContext: ctx - } -}); -``` - -## Next steps - -You can build and run the tests locally by executing `rushx test`. Explore the `test` folder to see advanced usage and behavior of the public classes. - -## Troubleshooting - -If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new). - -### OpenTelemetry Compatibility Errors - -Errors such as `span.spanContext is not a function` or `span.context is not a function` are likely due to a mismatch of OpenTelemetry versions between two libraries. - -To resolve this, please ensure that all Azure client libraries are using a compatible version of OpenTelemetry as per the [compatibility matrix](#compatibility-matrix). If you are using `applicationinsights` please ensure that you are using the same version of OpenTelemetry as the Azure client libraries. - -> Ideally you'd want to use OpenTelemetry 1.0.0 or higher. - -- If you are using `npm` you may run `npm ls @opentelemetry/api` to see the version of OpenTelemetry you are using and which client libraries are using it. -- For `yarn` users, `yarn why @opentelemetry/api` will show you the version of OpenTelemetry you are using and which client libraries are using it. - -You may then upgrade client libraries as needed to ensure compatibility. Things should work as expected when the above command returns a version of OpenTelemetry that is >= 1.0.0. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/core-tracing_1.0.0-preview.14/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fcore-tracing%2FREADME.png) - diff --git a/docs-ref-services/preview/digital-twins-core-readme.md b/docs-ref-services/preview/digital-twins-core-readme.md deleted file mode 100644 index 5bd6555edab8..000000000000 --- a/docs-ref-services/preview/digital-twins-core-readme.md +++ /dev/null @@ -1,366 +0,0 @@ ---- -title: Azure Azure Digital Twins Core client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/digital-twins-core, digitaltwins -author: johngallardo -ms.author: jgalla -ms.date: 04/04/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: digital-twins ---- -# Azure Azure Digital Twins Core client library for JavaScript - version 1.1.0-beta.1 - - -This package contains an isomorphic SDK for Azure Digital Twins API to provide access to the Azure Digital Twins service for managing twins, models, relationships, etc. - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/digital-twins-core_1.1.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure Digital Twins instance](https://docs.microsoft.com/azure/digital-twins/how-to-set-up-instance-portal). - -### Install the `@azure/digital-twins-core` package - -Install the Digital Twins Core client library for JavaScript with `npm`: - -```bash -npm install @azure/digital-twins-core -``` - -### Browser support - -#### JavaScript Bundle - -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our -[bundling documentation](https://aka.ms/AzureSDKBundling). - -#### CORS - -Azure Digital Twins doesn't currently support Cross-Origin Resource Sharing (CORS). -As a result, this library cannot be used to make direct calls to the template service from a browser. -Please refer to [this document](https://github.com/Azure/azure-sdk-for-js/blob/@azure/digital-twins-core_1.1.0-beta.1/samples/cors/ts/README.md) for guidance. - -## Key concepts - -### Azure Digital Twins - -Azure Digital Twins is an Azure IoT service that creates comprehensive models of the physical environment. -It can create spatial intelligence graphs to model the relationships and interactions between people, spaces, and devices. -You can learn more about Azure Digital Twins by visiting [Azure Digital Twins Documentation](https://docs.microsoft.com/azure/digital-twins/). - -### `DigitalTwinsClient` - -`DigitalTwinsClient` is the client object that users of this library use to manage their Azure Digital Twins instance. - -## Examples - -### Create the DigitalTwinsClient - -To create a new `DigitalTwinsClient`, you need the endpoint to an Azure Digital Twins instance and credentials. -Here, we use `DefaultAzureCredential` for credentials from the package `@azure/identity`. -It supports different authentication mechanisms and determines the appropriate credential type based of the environment it is executing in. -See the [readme for @azure/identity](https://www.npmjs.com/package/@azure/identity) for more information on the different authentication options you can use. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DigitalTwinsClient } = require("@azure/digital-twins-core"); - -const url = ""; -const credential = new DefaultAzureCredential(); -const serviceClient = new DigitalTwinsClient(url, credential); -``` - -### Create, list, get, decommission, and delete models - -#### Create models - -In order to create models, we pass in a list of models to `createModels`. -Here, we only create one model. - -```javascript -const myComponent = { - "@id": "dtmi:my_component;1", - "@type": "Interface", - "@context": "dtmi:dtdl:context;2", - displayName: "Component1", - contents: [ - { - "@type": "Property", - name: "ComponentProp1", - schema: "string" - } - ] -}; - -const models = await serviceClient.createModels([myComponent]); -``` - -#### List models - -We use `listModels` to list all the models. - -```javascript -const models = await serviceClient.listModels(); -for await (const model of models) { - console.log(`Model ID: ${model.id}`); -} -``` - -#### Get model - -We can get a specific model using `getModel` with the model ID. - -```javascript -const model = await serviceClient.getModel(""); -``` - -#### Decommission model - -We can decommission a model using `decomissionModel` with the model ID. - -```javascript -await serviceClient.decomissionModel(""); -``` - -#### Delete model - -We can delete a model using `deleteModel` with the model ID. - -```javascript -await serviceClient.deleteModel(""); -``` - -### Create, get, query, and delete digital twins - -#### Create digital twin - -To create a twin, you will need to provide an ID for the digital twin and a JSON string containing the digital twin object. - -```javascript -const digitalTwinId = "myTwin"; -const newTwin = ""; -const createdTwin = await serviceClient.upsertDigitalTwin(digitalTwinId, newTwin); -``` - -#### Get digital twin - -We can get a digital twin using `getDigitalTwin` with the digital twin ID. - -```javascript -const digitalTwinId = "myTwin"; -const twin = await serviceClient.getDigitalTwin(digitalTwinId); -console.log(`DigitalTwin's etag: ${twin.eTag}`); -console.log(`DigitalTwin: ${twin.body}`); -``` - -#### Query digital twins - -Query the Azure Digital Twins instance for digital twins using the [Azure Digital Twins query language](https://docs.microsoft.com/azure/digital-twins/how-to-query-graph). -Here's an example of how to query for digital twins and how to iterate over the results. - -```javascript -const query = "SELECT * FROM digitaltwins"; -const queryResult = serviceClient.queryTwins(query); -for await (const item of queryResult) { - console.log(`DigitalTwin: ${item}`); -} -``` - -#### Delete digital twin - -We can delete a digital twin using `deleteDigitalTwin` with the digital twin ID. - -```javascript -const digitalTwinId = "myTwin"; -await serviceClient.deleteDigitalTwin(digitalTwinId); -``` - -### Get and update digital twin components - -#### Get digital twin component - -We can get a digital twin component using `getComponent` with the digital twin ID and the path of the component. - -```javascript -const digitalTwinId = "myTwin"; -const componentPath = "Component1"; -const component = await serviceClient.getComponent(digitalTwinId, componentPath); -console.log(`Component: ${component}`); -``` - -#### Update digital twin component - -To update a digital twin component (i.e., replace, remove, or add a component property or sub-property within a digital twin), you need to provide a digital twin ID, component path, and a list of patch objects with the properties `op` and `path`. -The value of `op` is "replace", "remove", or "add", and the value of `path` is the path to the digital twin component being updated. -For "replace" and "add" operations, the `value` property should be included with your desired value of the component property. - -```javascript -const digitalTwinId = "myTwin"; -const componentPath = "Component1"; -const patch = { - op: "replace", - path: "/ComponentProp1", - value: "value2" -}; -const updateComponentResponse = await serviceClient.updateComponent(digitalTwinId, componentPath, [ - patch -]); -``` - -### Create and list digital twin relationships - -#### Create digital twin relationships - -`upsertRelationship` creates a relationship on a digital twin provided with ID of a digital twin, name of relationship (in this case, "has"), ID of an relationship (in this case "BuildingHasFloor") and the object representing the relationship to be created. -The object must contain property with key "\$targetId" to specify the target of the relationship. - -```javascript -const relationship = { - $relationshipId: "BuildingHasFloor", - $sourceId: "BuildingTwin", - $relationshipName: "has", - $targetId: "FloorTwin", - isAccessRestricted: false -}; - -await serviceClient.upsertRelationship( - relationship["$sourceId"], - relationship["$relationshipId"], - relationship -); -``` - -#### List digital twin relationships - -For a digital twin, `listRelationships` and `listIncomingRelationships` list all the relationships and all incoming relationships, respectively. - -```javascript -const digitalTwinId = "myTwin"; -const relationships = serviceClient.listRelationships(digitalTwinId); -for await (const relationship of relationships) { - console.log(`Relationship: ${relationship}`); -} -``` - -```javascript -const digitalTwinId = "myTwin"; -const incomingRelationships = serviceClient.listIncomingRelationships(digitalTwinId); -for await (const incomingRelationship of incomingRelationships) { - console.log(`Relationship: ${incomingRelationship}`); -} -``` - -### Create, get, list, and delete event routes - -#### Create event route - -To create an event route, provide an ID of an event route (in this case, "myEventRouteId") and event route data containing the endpoint and optional filter like the example shown below. -For more information on filtering events, see [this documentation](https://docs.microsoft.com/azure/digital-twins/how-to-manage-routes-apis-cli#filter-events). - -```javascript -const eventHubEndpointName = "myEventHubEndpointName"; -const eventRouteId = "myEventRouteId"; -const eventFilter = - "$eventType = 'DigitalTwinTelemetryMessages' or $eventType = 'DigitalTwinLifecycleNotification'"; -await serviceClient.upsertEventRoute(eventRouteId, eventHubEndpointName, eventFilter); -``` - -#### Get event route - -We can get an event route using `getEventRoute` with the event route ID. - -```javascript -const eventRouteId = "myEventRouteId"; -const eventRoute = serviceClient.getEventRoute(eventRouteId); -console.log(`EventRoute: ${eventRoute}`); -``` - -#### List event routes - -We can list event routes using `listEventRoutes`. - -```javascript -const eventRoutes = serviceClient.listEventRoutes(); -for await (const eventRoute of eventRoutes) { - console.log(`EventRoute: ${eventRoute}`); -} -``` - -#### Delete event route - -We can delete an event route using `deleteEventRoute` with the event route ID. - -```javascript -const eventRouteId = "myEventRouteId"; -await serviceClient.deleteEventRoute(eventRouteId); -``` - -### Publish telemetry messages for a digital twin - -To publish a telemetry message for a digital twin, you need to provide the digital twin ID, the payload, and a unique ID for the message. - -```javascript -const digitalTwinId = ""; -const telemetryPayload = '{"Telemetry1": 5}'; -const response = await serviceClient.publishTelemetry( - digitalTwinId, - telemetryPayload, - "" -); -``` - -You can also publish a telemetry message for a specific component in a digital twin. -In addition to the digital twin ID, payload, and unique message ID, you need to specify the target component path. - -```javascript -const digitalTwinId = ""; -const componentPath = ""; -const telemetryPayload = '{"Telemetry1": 5}'; -const response = await serviceClient.publishComponentTelemetry( - digitalTwinId, - componentPath, - telemetryPayload, - "" -); -``` - -### Additional Examples - -Additional examples can be found in the -[samples directory](https://github.com/Azure/azure-sdk-for-js/tree/@azure/digital-twins-core_1.1.0-beta.1/sdk/digitaltwins/digital-twins-core/samples). - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/digital-twins-core_1.1.0-beta.1/sdk/core/logger). - -## Next steps - -- Take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/digital-twins-core_1.1.0-beta.1/sdk/digitaltwins/digital-twins-core/samples) directory for detailed examples that demonstrate how to use the client libraries. -- Explore the Azure Digital Twins [documentation](https://docs.microsoft.com/azure/digital-twins/) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/digital-twins-core_1.1.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - diff --git a/docs-ref-services/preview/event-hubs-readme.md b/docs-ref-services/preview/event-hubs-readme.md deleted file mode 100644 index 433915fd34a6..000000000000 --- a/docs-ref-services/preview/event-hubs-readme.md +++ /dev/null @@ -1,527 +0,0 @@ ---- -title: Azure Event Hubs client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/event-hubs, eventhub -author: jeremymeng -ms.author: yumeng -ms.date: 04/06/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: event-hubs ---- -# Azure Event Hubs client library for JavaScript - version 5.8.0-beta.3 - - -Azure Event Hubs is a highly scalable publish-subscribe service that can ingest millions of events per second and stream them to multiple consumers. This lets you process and analyze the massive amounts of data produced by your connected devices and applications. If you would like to know more about Azure Event Hubs, you may wish to review: [What is Event Hubs](https://docs.microsoft.com/azure/event-hubs/event-hubs-about)? - -The Azure Event Hubs client library allows you to send and receive events in your Node.js application. - -Key links: -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/event-hubs_5.8.0-beta.3/sdk/eventhub/event-hubs) -- [Package (npm)](https://www.npmjs.com/package/@azure/event-hubs) -- [API Reference Documentation](https://docs.microsoft.com/javascript/api/@azure/event-hubs) -- [Product documentation](https://azure.microsoft.com/services/event-hubs/) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/event-hubs_5.8.0-beta.3/sdk/eventhub/event-hubs/samples) - -**NOTE**: If you are using version 2.1.0 or lower and want to migrate to the latest version -of this package please look at our [migration guide to move from EventHubs V2 to EventHubs V5](https://github.com/Azure/azure-sdk-for-js/tree/@azure/event-hubs_5.8.0-beta.3/sdk/eventhub/event-hubs/migrationguide.md) - -Samples for v2 and documentation are still available here: - -[Source code for v2.1.0](https://github.com/Azure/azure-sdk-for-js/tree/%40azure/event-hubs_2.1.0/sdk/eventhub/event-hubs) | -[Package for v2.1.0 (npm)](https://www.npmjs.com/package/@azure/event-hubs/v/2.1.0) | -[Samples for v2.1.0](https://github.com/Azure/azure-sdk-for-js/tree/%40azure/event-hubs_2.1.0/sdk/eventhub/event-hubs/samples) - -## Getting started - -### Install the package - -Install the Azure Event Hubs client library using npm - -`npm install @azure/event-hubs` - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/event-hubs_5.8.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- An [Event Hubs Namespace](https://docs.microsoft.com/azure/event-hubs/) - -#### Configure TypeScript - -TypeScript users need to have Node type definitions installed: - -```bash -npm install @types/node -``` - -You also need to enable `compilerOptions.allowSyntheticDefaultImports` in your tsconfig.json. Note that if you have enabled `compilerOptions.esModuleInterop`, `allowSyntheticDefaultImports` is enabled by default. See [TypeScript's compiler options handbook](https://www.typescriptlang.org/docs/handbook/compiler-options.html) for more information. - -### Authenticate the client - -Interaction with Event Hubs starts with either an instance of the -[EventHubConsumerClient](https://docs.microsoft.com/javascript/api/@azure/event-hubs/eventhubconsumerclient) class -or an instance of the [EventHubProducerClient](https://docs.microsoft.com/javascript/api/@azure/event-hubs/eventhubproducerclient) class. -There are constructor overloads to support different ways of instantiating these classes as shown below: - -#### Use connection string for the Event Hubs namespace - -One of the constructor overloads takes a connection string of the form `Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;` and entity name to your Event Hub instance. You can create a consumer group and get the connection string as well as the entity name from the [Azure portal](https://docs.microsoft.com/azure/event-hubs/event-hubs-get-connection-string#get-connection-string-from-the-portal). - -```javascript -const { EventHubProducerClient, EventHubConsumerClient } = require("@azure/event-hubs"); - -const producerClient = new EventHubProducerClient("my-connection-string", "my-event-hub"); -const consumerClient = new EventHubConsumerClient( - "my-consumer-group", - "my-connection-string", - "my-event-hub" -); -``` - -#### Use connection string for policy on the Event Hub - -Another constructor overload takes the connection string corresponding to the shared access policy you have defined directly on the Event Hub instance (and not the Event Hubs namespace). -This connection string will be of the form `Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-event-hub-name`. -The key difference in the connection string format from the previous constructor overload is the `;EntityPath=my-event-hub-name`. - -```javascript -const { EventHubProducerClient, EventHubConsumerClient } = require("@azure/event-hubs"); - -const producerClient = new EventHubProducerClient("my-connection-string-with-entity-path"); -const consumerClient = new EventHubConsumerClient( - "my-consumer-group", - "my-connection-string-with-entity-path" -); -``` - -#### Use the Event Hubs namespace and Azure Identity - -This constructor overload takes the host name and entity name of your Event Hub instance and credential that implements the TokenCredential interface. This allows you to authenticate using an Azure Active Directory principal. There are implementations of the `TokenCredential` interface available in the [@azure/identity](https://www.npmjs.com/package/@azure/identity) package. The host name is of the format `.servicebus.windows.net`. When using Azure Active Directory, your principal must be assigned a role which allows access to Event Hubs, such as the Azure Event Hubs Data Owner role. For more information about using Azure Active Directory authorization with Event Hubs, please refer to [the associated documentation](https://docs.microsoft.com/azure/event-hubs/authorize-access-azure-active-directory). - -```javascript -const { EventHubProducerClient, EventHubConsumerClient } = require("@azure/event-hubs"); - -const { DefaultAzureCredential } = require("@azure/identity"); -const credential = new DefaultAzureCredential(); -const producerClient = new EventHubProducerClient("my-host-name", "my-event-hub", credential); -const consumerClient = new EventHubConsumerClient( - "my-consumer-group", - "my-host-name", - "my-event-hub", - credential -); -``` - -## Key concepts - -- An **Event Hub producer** is a source of telemetry data, diagnostics information, usage logs, or other log data, as part of an embedded device solution, a mobile device application, a game title running on a console or other device, some client or server based business solution, or a web site. - -- An **Event Hub consumer** picks up such information from the Event Hub and processes it. Processing may involve aggregation, complex computation and filtering. Processing may also involve distribution or storage of the information in a raw or transformed fashion. Event Hub consumers are often robust and high-scale platform infrastructure parts with built-in analytics capabilities, like Azure Stream Analytics, Apache Spark, or Apache Storm. - -- A **partition** is an ordered sequence of events that is held in an Event Hub. Partitions are a means of data organization associated with the parallelism required by event consumers. Azure Event Hubs provides message streaming through a partitioned consumer pattern in which each consumer only reads a specific subset, or partition, of the message stream. As newer events arrive, they are added to the end of this sequence. The number of partitions is specified at the time an Event Hub is created and cannot be changed. - -- A **consumer group** is a view of an entire Event Hub. Consumer groups enable multiple consuming applications to each have a separate view of the event stream, and to read the stream independently at their own pace and from their own position. There can be at most 5 concurrent readers on a partition per consumer group; however it is recommended that there is only one active consumer for a given partition and consumer group pairing. Each active reader receives all of the events from its partition; If there are multiple readers on the same partition, then they will receive duplicate events. - -For more concepts and deeper discussion, see: [Event Hubs Features](https://docs.microsoft.com/azure/event-hubs/event-hubs-features) - -### Guidance around retries - -The `EventHubConsumerClient` and `EventHubProducerClient` accept `options` where you can set the `retryOptions` -that allow you to tune how the SDK handles transient errors. -Examples of transient errors include temporary network or service issues. - -#### Retries when consuming events - -If a transient error (e.g. a temporary network issue) is encountered while the SDK is receiving events, -it will retry receiving events based on the retry options passed into the `EventHubConsumerClient`. -If the maximum retry attempts are exhausted, the `processError` function will be invoked. - -You can use the retry settings to control how quickly you are informed about temporary issues such as a -network connection issue. -For example, if you need to know when there is a network issue right away you can lower the -values for `maxRetries` and `retryDelayInMs`. - -After executing the `processError` function, the client continues to receive events from the partition as long -as the error was a retryable one. Otherwise, the client invokes the user-provided `processClose` function. -This function is also invoked when either you stop the subscription or when the client stops reading -events from the current partition due to it being picked up by another instance of your application -as part of load balancing. - -The `processClose` function provides an opportunity to update checkpoints if needed. -After executing `processClose`, the client (or in the case of load balancing, -a client from another instance of you application) will invoke the user-provided -`processInitialize` function to resume reading events from the last updated checkpoint for the same partition. - -If you wish to stop attempting to read events, you must call `close()` on the `subscription` returned -by the `subscribe` method. - -## Examples - -The following sections provide code snippets that cover some of the common tasks using Azure Event Hubs - -- [Inspect an Event Hub](#inspect-an-event-hub) -- [Publish events to an Event Hub](#publish-events-to-an-event-hub) -- [Consume events from an Event Hub](#consume-events-from-an-event-hub) -- [Use EventHubConsumerClient to work with IotHub](#use-eventhubconsumerclient-to-work-with-iothub) - -### Inspect an Event Hub - -Many Event Hub operations take place within the scope of a specific partition. -Because partitions are owned by the Event Hub, their names are assigned at the time of creation. -To understand what partitions are available, you query the Event Hub using either of the two clients available: `EventHubProducerClient` or `EventHubConsumerClient` - -In the below example, we are using an `EventHubProducerClient`. - -```javascript -const { EventHubProducerClient } = require("@azure/event-hubs"); - -async function main() { - const client = new EventHubProducerClient("connectionString", "eventHubName"); - - const partitionIds = await client.getPartitionIds(); - - await client.close(); -} - -main(); -``` - -### Publish events to an Event Hub - -In order to publish events, you'll need to create an `EventHubProducerClient`. While the below example shows one way to create the client, see the -[Authenticate the client](#authenticate-the-client) section to learn other ways to instantiate the client. - -You may publish events to a specific partition, or allow the Event Hubs service to decide which partition events should be published to. It is recommended to use automatic routing when the publishing of events needs to be highly available or when event data should be distributed evenly among the partitions. In the example below, we will take advantage of automatic routing. - -- Create an `EventDataBatch` object using the [createBatch](https://docs.microsoft.com/javascript/api/@azure/event-hubs/eventhubproducerclient#createbatch-createbatchoptions-) -- Add events to the batch using the [tryAdd](https://docs.microsoft.com/javascript/api/@azure/event-hubs/eventdatabatch#tryadd-eventdata--tryaddoptions-) - method. You can do this until the maximum batch size limit is reached or until you are done adding the number of events you liked, whichever comes first. This method would return `false` to indicate that no more events can be added to the batch due to the max batch size being reached. -- Send the batch of events using the [sendBatch](https://docs.microsoft.com/javascript/api/@azure/event-hubs/eventhubproducerclient#sendbatch-eventdatabatch--sendbatchoptions-) method. - -In the below example, we attempt to send 10 events to Azure Event Hubs. - -```javascript -const { EventHubProducerClient } = require("@azure/event-hubs"); - -async function main() { - const producerClient = new EventHubProducerClient("connectionString", "eventHubName"); - - const eventDataBatch = await producerClient.createBatch(); - let numberOfEventsToSend = 10; - - while (numberOfEventsToSend > 0) { - let wasAdded = eventDataBatch.tryAdd({ body: "my-event-body" }); - if (!wasAdded) { - break; - } - numberOfEventsToSend--; - } - - await producerClient.sendBatch(eventDataBatch); - await producerClient.close(); -} - -main(); -``` - -There are options you can pass at different stages to control the process of sending events to Azure Event Hubs. - -- The `EventHubProducerClient` constructor takes an optional parameter of type `EventHubClientOptions` which you can use to specify options like number of retries. -- The `createBatch` method takes an optional parameter of type `CreateBatchOptions` which you can use to speicify the max batch size supported by the batch being created. -- The `sendBatch` method takes an optional parameter of type `SendBatchOptions` which you can use to specify `abortSignal` to cancel current operation. -- In case you want to send to a specific partition, an overload of the `sendBatch` method allows you to pass the id of the partition to send events to. - The [Inspect an Event Hub](#inspect-an-event-hub) example above shows how to fetch the available partitions ids. - -**Note**: When working with Azure Stream Analytics, the body of the event being sent should be a JSON object as well. -For example: `body: { "message": "Hello World" }` - -### Consume events from an Event Hub - -To consume events from an Event Hub instance, you also need to know which consumer group you want to target. -Once you know this, you are ready to create an [EventHubConsumerClient](https://docs.microsoft.com/javascript/api/@azure/event-hubs/eventhubconsumerclient). While the below example shows one way to create the client, see the -[Authenticate the client](#authenticate-the-client) section to learn other ways to instantiate the client. - -The `subscribe` method on the client has overloads which, combined with the constructor, can cater to several -ways to consume events: - -- [Consume events in a single process](#consume-events-in-a-single-process) -- [Consume events with load balanced across multiple processes](#consume-events-with-load-balanced-across-multiple-processes) -- [Consume events from a single partition](#consume-events-from-a-single-partition) - -The `subscribe` method takes an optional parameter of type `SubscriptionOptions` which you can use to specify options like the maxBatchSize (number of events to wait for) and maxWaitTimeInSeconds (amount of time to wait for maxBatchSize events to arrive). - -#### Consume events in a single process - -Begin by creating an instance of the `EventHubConsumerClient`, and then call the `subscribe()` method on it to start -consuming events. - -The `subscribe` method takes callbacks to process events as they are received from Azure Event Hubs. -To stop receiving events, you can call `close()` on the object returned by the `subscribe()` method. - -```javascript -const { EventHubConsumerClient, earliestEventPosition } = require("@azure/event-hubs"); - -async function main() { - const client = new EventHubConsumerClient( - "my-consumer-group", - "connectionString", - "eventHubName" - ); - - // In this sample, we use the position of earliest available event to start from - // Other common options to configure would be `maxBatchSize` and `maxWaitTimeInSeconds` - const subscriptionOptions = { - startPosition: earliestEventPosition - }; - - const subscription = client.subscribe( - { - processEvents: async (events, context) => { - // event processing code goes here - }, - processError: async (err, context) => { - // error reporting/handling code here - } - }, - subscriptionOptions - ); - - // Wait for a few seconds to receive events before closing - setTimeout(async () => { - await subscription.close(); - await client.close(); - console.log(`Exiting sample`); - }, 3 * 1000); -} - -main(); -``` - -#### Consume events with load balanced across multiple processes - -Azure Event Hubs is capable of dealing with millions of events per second. -To scale your processing application, you can run multiple instances of your application and have it balance the load among themselves. - -Begin by creating an instance of the `EventHubConsumerClient` using one of the -constructor overloads that take a `CheckpointStore`, and then call the `subscribe()` -method to start consuming events. The checkpoint store will enable the subscribers -within a consumer group to coordinate the processing between multiple instances -of your application. - -In this example, we will use the `BlobCheckpointStore` from the `@azure/eventhubs-checkpointstore-blob` package -which implements the required read/writes to a durable store by using Azure Blob Storage. - -The `subscribe` method takes callbacks to process events as they are received from Azure Event Hubs. -To stop receiving events, you can call `close()` on the object returned by the `subscribe()` method. - -```javascript -const { EventHubConsumerClient } = require("@azure/event-hubs"); -const { ContainerClient } = require("@azure/storage-blob"); -const { BlobCheckpointStore } = require("@azure/eventhubs-checkpointstore-blob"); - -const storageAccountConnectionString = "storage-account-connection-string"; -const containerName = "container-name"; -const eventHubConnectionString = "eventhub-connection-string"; -const consumerGroup = "my-consumer-group"; -const eventHubName = "eventHubName"; - -async function main() { - const blobContainerClient = new ContainerClient(storageAccountConnectionString, containerName); - - if (!(await blobContainerClient.exists())) { - await blobContainerClient.create(); - } - - const checkpointStore = new BlobCheckpointStore(blobContainerClient); - const consumerClient = new EventHubConsumerClient( - consumerGroup, - eventHubConnectionString, - eventHubName, - checkpointStore - ); - - const subscription = consumerClient.subscribe({ - processEvents: async (events, context) => { - // event processing code goes here - if (events.length === 0) { - // If the wait time expires (configured via options in maxWaitTimeInSeconds) Event Hubs - // will pass you an empty array. - return; - } - - // Checkpointing will allow your service to pick up from - // where it left off when restarting. - // - // You'll want to balance how often you checkpoint with the - // performance of your underlying checkpoint store. - await context.updateCheckpoint(events[events.length - 1]); - }, - processError: async (err, context) => { - // handle any errors that occur during the course of - // this subscription - console.log(`Errors in subscription to partition ${context.partitionId}: ${err}`); - } - }); - - // Wait for a few seconds to receive events before closing - await new Promise((resolve) => setTimeout(resolve, 10 * 1000)); - - await subscription.close(); - await consumerClient.close(); - console.log(`Exiting sample`); -} - -main(); -``` - -Please see [Balance partition load across multiple instances of your application](https://docs.microsoft.com/azure/event-hubs/event-processor-balance-partition-load) -to learn more. - -#### Consume events from a single partition - -Begin by creating an instance of the `EventHubConsumerClient`, and then call the `subscribe()` method on it to start -consuming events. Pass the id of the partition you want to target to the `subscribe()` method to consume only from that partition. - -In the below example, we are using the first partition. - -The `subscribe` method takes callbacks to process events as they are received from Azure Event Hubs. -To stop receiving events, you can call `close()` on the object returned by the `subscribe()` method. - -```javascript -const { EventHubConsumerClient, earliestEventPosition } = require("@azure/event-hubs"); - -async function main() { - const client = new EventHubConsumerClient( - "my-consumer-group", - "connectionString", - "eventHubName" - ); - const partitionIds = await client.getPartitionIds(); - - // In this sample, we use the position of earliest available event to start from - // Other common options to configure would be `maxBatchSize` and `maxWaitTimeInSeconds` - const subscriptionOptions = { - startPosition: earliestEventPosition - }; - - const subscription = client.subscribe( - partitionIds[0], - { - processEvents: async (events, context) => { - // event processing code goes here - }, - processError: async (err, context) => { - // error reporting/handling code here - } - }, - subscriptionOptions - ); - - // Wait for a few seconds to receive events before closing - setTimeout(async () => { - await subscription.close(); - await client.close(); - console.log(`Exiting sample`); - }, 3 * 1000); -} - -main(); -``` - -### Use EventHubConsumerClient to work with IotHub - -You can use `EventHubConsumerClient` to work with IotHub as well. This is useful for receiving telemetry data of IotHub from the linked EventHub. -The associated connection string will not have send claims, -hence sending events is not possible. - -- Please notice that the connection string needs to be for an - [Event Hub-compatible endpoint](https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messages-read-builtin) - (e.g. "Endpoint=sb://my-iothub-namespace-[uid].servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-iot-hub-name") - -```javascript -const { EventHubConsumerClient } = require("@azure/event-hubs"); - -async function main() { - const client = new EventHubConsumerClient( - "my-consumer-group", - "Endpoint=sb://my-iothub-namespace-[uid].servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-iot-hub-name" - ); - await client.getEventHubProperties(); - // retrieve partitionIds from client.getEventHubProperties() or client.getPartitionIds() - const partitionId = "0"; - await client.getPartitionProperties(partitionId); - - await client.close(); -} - -main(); -``` - -## Troubleshooting - -### AMQP Dependencies - -The Event Hubs library depends on the [rhea-promise](https://github.com/amqp/rhea-promise) library for managing connections, sending and receiving events over the [AMQP](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol. - -### Logging - -You can set the `AZURE_LOG_LEVEL` environment variable to enable logging to `stderr`: - -```bash -export AZURE_LOG_LEVEL=verbose -``` - -For more detailed instructions on how to enable logs, you can look at the -[@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/event-hubs_5.8.0-beta.3/sdk/core/logger). - -You can alternatively set the `DEBUG` environment variable to get logs when using this library. -This can be useful if you also want to emit logs from the dependencies `rhea-promise` and `rhea` as well. - -**Note:** AZURE_LOG_LEVEL, if set, takes precedence over DEBUG. -Do not specify any `azure` libraries via DEBUG when also specifying -AZURE_LOG_LEVEL or calling setLogLevel. - -- Getting only info level debug logs from the Event Hubs SDK. - -```bash -export DEBUG=azure:*:info -``` - -- Getting debug logs from the Event Hubs SDK and the protocol level library. - -```bash -export DEBUG=azure*,rhea* -``` - -- If you are **not interested in viewing the raw event data** (which consumes a large amount of console/disk space) then you can set the `DEBUG` environment variable as follows: - -```bash -export DEBUG=azure*,rhea*,-rhea:raw,-rhea:message -``` - -- If you are interested only in **errors** and SDK **warnings**, then you can set the `DEBUG` environment variable as follows: - -```bash -export DEBUG=azure:*:(error|warning),rhea-promise:error,rhea:events,rhea:frames,rhea:io,rhea:flow -``` - -## Next steps - -### More sample code - -Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/event-hubs_5.8.0-beta.3/sdk/eventhub/event-hubs/samples) -directory for detailed examples of how to use this library to send and receive events to/from -[Event Hubs](https://docs.microsoft.com/azure/event-hubs/event-hubs-about). - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/event-hubs_5.8.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Feventhub%2Fevent-hubs%2FREADME.png) - diff --git a/docs-ref-services/preview/eventgrid-readme.md b/docs-ref-services/preview/eventgrid-readme.md deleted file mode 100644 index 104c9c7bef70..000000000000 --- a/docs-ref-services/preview/eventgrid-readme.md +++ /dev/null @@ -1,344 +0,0 @@ ---- -title: Azure Event Grid client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/eventgrid, eventgrid -author: ellismg -ms.author: matell -ms.date: 06/26/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: eventgrid ---- -# Azure Event Grid client library for JavaScript - version 4.13.0-beta.2 - - -[Azure Event Grid](https://azure.microsoft.com/services/event-grid/) is a cloud-based service that provides reliable event delivery at massive scale. - -Use the client library to: - -- Send events to Event Grid using either the Event Grid, Cloud Events 1.0 schemas, or a custom schema -- Decode and process events which were delivered to an Event Grid handler -- Generate Shared Access Signatures for Event Grid topics - -Key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/@azure/eventgrid_4.13.0-beta.2/sdk/eventgrid/eventgrid/) -- [Package (NPM)](https://www.npmjs.com/package/@azure/eventgrid) -- [API reference documentation](/javascript/api/@azure/eventgrid/) -- [Product documentation](/azure/event-grid/) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/eventgrid_4.13.0-beta.2/sdk/eventgrid/eventgrid/samples) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/eventgrid_4.13.0-beta.2/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription][azure_sub]. -- An existing [Event Grid][event_grid] Topic or Domain. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli]. - -If you use the Azure CLI, replace `` and `` with your own unique names: - -#### Create an Event Grid Topic - -```bash -az eventgrid topic create --location --resource-group --name -``` - -#### Create an Event Grid Domain - -```bash -az eventgrid domain create --location --resource-group --name -``` - -### Install the `@azure/eventgrid` package - -Install the Azure Event Grid client library for JavaScript with `npm`: - -```bash -npm install @azure/eventgrid -``` - -### Create and authenticate a `EventGridPublisherClient` - -To create a client object to access the Event Grid API, you will need the `endpoint` of your Event Grid topic and a `credential`. The Event Grid client can use either an Access Key or Shared Access Signature (SAS) created from an access key. - -You can find the endpoint for your Event Grid topic either in the [Azure Portal][azure_portal] or by using the [Azure CLI][azure_cli] snippet below: - -```bash -az eventgrid topic show --name --resource-group --query "endpoint" -``` - -#### Using an Access Key - -Use the [Azure Portal][azure_portal] to browse to your Event Grid resource and retrieve an Access Key, or use the [Azure CLI][azure_cli] snippet below: - -```bash -az eventgrid topic key list --resource-group --name -``` - -Once you have an API key and endpoint, you can use the `AzureKeyCredential` class to authenticate the client as follows: - -```js -const { EventGridPublisherClient, AzureKeyCredential } = require("@azure/eventgrid"); - -const client = new EventGridPublisherClient( - "", - "", - new AzureKeyCredential("") -); -``` - -#### Using a SAS Token - -Like an access key, a SAS token allows access to sending events to an Event Grid topic. Unlike an access key, which can be used until it is regenerated, a SAS token has an experation time, at which point it is no longer valid. To use a SAS token for authentication, use the `AzureSASCredential` as follows: - -```js -const { EventGridPublisherClient, AzureSASCredential } = require("@azure/eventgrid"); - -const client = new EventGridPublisherClient( - "", - "", - new AzureSASCredential("") -); -``` - -You can generate a SAS token by using the `generateSharedAccessSigniture` function. - -```js -const { generateSharedAccessSignature, AzureKeyCredential } = require("@azure/eventgrid"); - -// Create a SAS Token which expires on 2020-01-01 at Midnight. -const token = generateSharedAccessSignature( - "", - new AzureKeyCredential(""), - new Date("2020-01-01T00:00:00") -); -``` - -#### Using Azure Active Directory (AAD) - -Azure EventGrid provides integration with Azure Active Directory (Azure AD) for identity-based authentication of requests. With Azure AD, you can use role-based access control (RBAC) to grant access to your Azure Event Grid resources to users, groups, or applications. - -To send events to a topic or domain with a `TokenCredential`, the authenticated identity should have the "EventGrid Data Sender" role assigned. - -With the `@azure/identity` package, you can seamlessly authorize requests in both development and production environments. To learn more about Azure Active Directory, see the [`@azure/identity` README](https://github.com/Azure/azure-sdk-for-js/blob/@azure/eventgrid_4.13.0-beta.2/sdk/identity/identity/README.md). - -For example, use can use `DefaultAzureCredential` to construct a client which will authenticate using Azure Active Directory: - -```js -const { EventGridPublisherClient } = require("@azure/eventgrid"); -const { DefaultAzureCredential } = require("@azure/identity"); - -const client = new EventGridPublisherClient( - "", - "", - new DefaultAzureCredential() -); -``` - -## Key concepts - -### EventGridPublisherClient - -`EventGridPublisherClient` is used sending events to an Event Grid Topic or an Event Grid Domain. - -### Event Schemas - -Event Grid supports multiple schemas for encoding events. When a Custom Topic or Domain is created, you specify the schema that will be used when publishing events. While you may configure your topic to use a _custom schema_ it is more common to use the already defined _Event Grid schema_ or _CloudEvents 1.0 schema_. [CloudEvents](https://cloudevents.io/) is a Cloud Native Computing Foundation project which produces a specification for describing event data in a common way. When you construct the EventGridPublisherClient you must specify which schema your topic is configured to use: - -If your topic is configured to use the Event Grid Schema, set "EventGrid" as the schema type: - -```js -const client = new EventGridPublisherClient( - "", - "EventGrid", - new AzureKeyCredential("") -); -``` - -If your topic is configured to use the Cloud Event Schema, set "CloudEvent" as the schema type: - -```js -const client = new EventGridPublisherClient( - "", - "CloudEvent", - new AzureKeyCredential("") -); -``` - -If your topic is configured to use a Custom Event Schema, set "Custom" as the schema type: - -```js -const client = new EventGridPublisherClient( - "", - "Custom", - new AzureKeyCredential("") -); -``` - -Constructing the client with a different schema than what the topic is configured to expect will result in an error from the service and your events will not be published. - -You can see what input schema has been configured for an Event Grid topic by using the [Azure CLI][azure_cli] snippet below: - -```bash -az eventgrid topic show --name --resource-group --query "inputSchema" -``` - -### EventGridDeserializer - -Events delivered to consumers by Event Grid are delivered as JSON. Depending on the type of consumer being delivered to, the Event Grid service may deliver one or more events as part of a single payload. While these events may be deserialized using normal JavaScript methods like `JSON.parse`, this library offers a helper type for deserializing events, called `EventGridDeserializer`. - -Compared with using `JSON.parse` directly, `EventGridDeserializer` does some additional conversions while deserializng events: - -1. `EventGridDeserializer` validates that the required properties of an event are present and are the right types. -2. `EventGridDeserializer` converts the event time property into a JavaScript `Date` object. -3. When using Cloud Events, binary data may be used for an event's data property (by using `Uint8Array`). When the event is sent through Event Grid, it is encoded in Base 64. `EventGridDeserializer` will decode this data back into an instance of `Uint8Array`. -4. When deserilizing a _System Event_ (an event generated by another Azure service), `EventGridDeserializer` will do additional conversions so that the `data` object matches the corresponding interface which describes its data. When using TypeScript, these interfaces ensure you have strong typing when access properties of the data object for a system event. - -When creating an instance of `EventGridDeserializer` you may supply custom deserializers that are used to further convert the `data` object. - -### Distributed Tracing and Cloud Events - -This library supports distributed tracing using [`@azure/core-tracing`][azure-core-tracing-github]. When using distributed tracing, this library will create a span during a `send` operation. In addition, when sending events using the Cloud Events 1.0 schema, the SDK will add distributed tracing metadata to the events using the [Distributed Tracing extension][cloud-events-distributed-tracing-spec]. The values for the `traceparent` and `tracestate` extension properties correspond to the `traceparent` and `tracestate` headers from the HTTP request which sends the events. If an event already has a `traceparent` extension property it is not updated. - -### Event Grid on Kubernetes - -This library has been tested and validated on [Kubernetes using Azure Arc][eventgrid-on-kubernetes-using-azure-arc]. - -## Examples - -### Publish a Custom Event to an Event Grid Topic using the Event Grid Schema - -```js -const { EventGridPublisherClient, AzureKeyCredential } = require("@azure/eventgrid"); - -const client = new EventGridPublisherClient( - "", - "EventGrid", - new AzureKeyCredential("") -); - -await client.send([ - { - eventType: "Azure.Sdk.SampleEvent", - subject: "Event Subject", - dataVersion: "1.0", - data: { - hello: "world" - } - } -]); -``` - -### Publish a Custom Event to a Topic in an Event Grid Domain using the Event Grid Schema - -Publishing events to an Event Grid Domain is similar to publish to an Event Grid Topic, except that when using the Event Grid schema for events, you must include the `topic` property. When publishing events in the Cloud Events 1.0 schema, the required `source` property is used as the name of the topic in the domain to publish to: - -```js -const { EventGridPublisherClient, AzureKeyCredential } = require("@azure/eventgrid"); - -const client = new EventGridPublisherClient( - "", - "EventGrid", - new AzureKeyCredential("") -); - -await client.send([ - { - topic: "my-sample-topic", - eventType: "Azure.Sdk.SampleEvent", - subject: "Event Subject", - dataVersion: "1.0", - data: { - hello: "world" - } - } -]); -``` - -### Deserializing an Event - -`EventGridDeserializer` can be used to deserialize events delivered by Event Grid. When deserializing an event, you need to know the schema used to deliver the event. In this example we have events being delivered to an Azure Service Bus Queue in the Cloud Events schema. Using the Service Bus SDK we can receive these events from the Service Bus Queue and then deserialize them using `EventGridDeserializer` and use `isSystemEvent` to detect what type of events they are. - -```js -const { ServiceBusClient } = require("@azure/service-bus"); -const { DefaultAzureCredential } = require("@azure/identity"); -const { EventGridDeserializer, isSystemEvent } = require("@azure/eventgrid"); - -const client = new ServiceBusClient("", new DefaultAzureCredential()); - -const receiver = client.createReceiver("", "peekLock"); - -const consumer = new EventGridDeserializer(); - -async function processMessage(message) { - // When delivering to a Service Bus Queue or Topic, EventGrid delivers a single event per message. - // so we just pluck the first one. - const event = (await consumer.deserializeCloudEvents(message.body))[0]; - - if (isSystemEvent("Microsoft.ContainerRegistry.ImagePushed", event)) { - console.log( - `${event.time}: Container Registry Image Pushed event for image ${event.data.target.repository}:${event.data.target.tag}` - ); - } else if (isSystemEvent("Microsoft.ContainerRegistry.ImageDeleted", event)) { - console.log( - `${event.time}: Container Registry Image Deleted event for repository ${event.data.target.repository}` - ); - } - - await message.complete(); -} - -console.log("starting receiver"); - -receiver.subscribe({ - processError: async (err) => { - console.error(err); - }, - processMessage -}); -``` - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/eventgrid_4.13.0-beta.2/sdk/core/logger). - -## Next steps - -Please take a look at the -[samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/eventgrid_4.13.0-beta.2/sdk/eventgrid/eventgrid/samples) -directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/eventgrid_4.13.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Feventgrid%2Feventgrid%2FREADME.png) - -[azure_cli]: /cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[event_grid]: /azure/event-grid -[azure_portal]: https://portal.azure.com -[azure-core-tracing-github]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/eventgrid_4.13.0-beta.2/sdk/core/core-tracing -[cloud-events-distributed-tracing-spec]: https://github.com/cloudevents/spec/blob/v1.0.1/extensions/distributed-tracing.md -[eventgrid-on-kubernetes-using-azure-arc]: /azure/event-grid/kubernetes/ - diff --git a/docs-ref-services/preview/identity-cache-persistence-readme.md b/docs-ref-services/preview/identity-cache-persistence-readme.md deleted file mode 100644 index e7adc549078f..000000000000 --- a/docs-ref-services/preview/identity-cache-persistence-readme.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -title: -keywords: Azure, javascript, SDK, API, @azure/identity-cache-persistence, identity -author: ramya-rao-a -ms.author: ramyar -ms.date: 09/10/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: identity ---- - -## Azure Identity Plugin for Token Cache Persistence - -This package provides a plugin to the Azure Identity library for JavaScript ([`@azure/identity`](https://npmjs.com/package/@azure/identity)) that enables persistent token caching. Token cache persistence allows the built-in token cache to persist across sessions using a secure storage system provided by the local operating system. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/identity-cache-persistence_1.0.0-beta.2/sdk/identity/identity-cache-persistence) | [Samples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity-cache-persistence_1.0.0-beta.2/sdk/identity/identity-cache-persistence/samples-dev) - -## Getting started - -```javascript -import { useIdentityPlugin } from "@azure/identity"; -import { cachePersistencePlugin } from "@azure/identity-cache-persistence"; - -useIdentityPlugin(cachePersistencePlugin); -``` - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/). - -### Install the package - -This package is designed to be used with Azure Identity for JavaScript. Install both `@azure/identity` and this package using `npm`: - -```sh -$ npm install --save @azure/identity -$ npm install --save @azure/identity-cache-persistence -``` - -#### Supported Environments - -Azure Identity plugins for JavaScript support stable (even numbered) versions of Node.js starting from v12. While the plugins may run in other Node versions, no support is guaranteed. `@azure/identity-cache-persistence` **does not** support browser environments. - -## Key concepts - -If this is your first time using `@azure/identity` or the Microsoft identity platform (Azure Active Directory), we recommend that you read [Using `@azure/identity` with Microsoft Identity Platform](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity-cache-persistence_1.0.0-beta.2/documentation/using-azure-identity.md) first. This document will give you a deeper understanding of the platform and how to configure your Azure account correctly. - -### Azure Identity Plugins - -As of `@azure/identity` version 2.0.0, the Identity client library for JavaScript includes a plugin API. This package (`@azure/identity-cache-persistence`) exports a plugin object that you must pass as an argument to the top-level `useIdentityPlugin` function from the `@azure/identity` package. Enable token cache persistence in your program as follows: - -```javascript -import { useIdentityPlugin } from "@azure/identity"; -import { cachePersistencePlugin } from "@azure/identity-cache-persistence"; - -useIdentityPlugin(cachePersistencePlugin); -``` - -After calling `useIdentityPlugin`, the persistent token cache plugin is registered to the `@azure/identity` package and will be available on all credentials that support persistent token caching (those that have `tokenCachePersistenceOptions` in their constructor options). - -## Examples - -Once the plugin is registered, you can enable token cache persistence by passing `tokenCachePersistenceOptions` with an `enabled` property set to `true` to a credential constructor. In the following example, we use the `DeviceCodeCredential`, since persistent caching of its tokens allows you to skip the interactive device-code authentication flow if a cached token is available. - -```javascript -import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity"; -import { cachePersistencePlugin } from "@azure/identity-cache-persistence"; - -useIdentityPlugin(cachePersistencePlugin); - -async function main() { - const credential = new DeviceCodeCredential({ - tokenCachePersistenceOptions: { - enabled: true - } - }); - - // We'll use the Microsoft Graph scope as an example - const scope = "https://graph.microsoft.com/.default"; - - // Print out part of the access token - console.log((await credential.getToken(scope)).token.substr(0, 10), "..."); -} - -main().catch((error) => { - console.error("An error occurred:", error); - process.exit(1); -}); -``` - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -## Next steps - -### Provide Feedback - -If you encounter bugs or have suggestions, please [open an issue](https://github.com/Azure/azure-sdk-for-js/issues). - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity-cache-persistence_1.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fidentity%2Fidentity%2FREADME.png) - diff --git a/docs-ref-services/preview/identity-readme.md b/docs-ref-services/preview/identity-readme.md deleted file mode 100644 index ad1b78e773df..000000000000 --- a/docs-ref-services/preview/identity-readme.md +++ /dev/null @@ -1,406 +0,0 @@ ---- -title: Azure Identity client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/identity, identity -author: KarishmaGhiya -ms.author: kaghiya -ms.date: 04/14/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: identity ---- -# Azure Identity client library for JavaScript - version 3.2.0-beta.2 - - -The Azure Identity library provides [Azure Active Directory (Azure AD)](https://learn.microsoft.com/azure/active-directory/fundamentals/active-directory-whatis) token authentication through a set of convenient [TokenCredential](https://learn.microsoft.com/javascript/api/@azure/core-auth/tokencredential) implementations. - -For examples of various credentials, see the [Azure Identity examples page](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md). - -Key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/identity_3.2.0-beta.2/sdk/identity/identity) -- [Package (npm)](https://www.npmjs.com/package/@azure/identity) -- [API Reference Documentation](https://learn.microsoft.com/javascript/api/@azure/identity) -- [Azure AD documentation](https://azure.microsoft.com/services/active-directory/) -- [Samples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/v2) - -## Getting started - -### Migrate from v1 to v2 of @azure/identity - -If you're using v1 of `@azure/identity`, see the [migration guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/migration-v1-v2.md) to update to v2. - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) - - **Note:** If your application runs on Node.js v8 or lower and you cannot upgrade your Node.js version to latest stable version, then pin your `@azure/identity` dependency to version 1.1.0. -- Latest versions of Safari, Chrome, Edge, and Firefox. - - **Note**: Among the different credentials exported in this library, `InteractiveBrowserCredential` is the only one that is supported in the browser. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/SUPPORT.md) for more details. - -### Install the package - -Install Azure Identity with `npm`: - -```sh -npm install --save @azure/identity -``` - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/). -- Optional: The [Azure CLI][azure_cli] and/or [Azure PowerShell][azure_powershell] can also be useful for authenticating in a development environment and managing account roles. - -### When to use @azure/identity - -The credential classes exposed by `@azure/identity` are focused on providing the most straightforward way to authenticate the Azure SDK clients locally, in your development environments, and in production. We aim for simplicity and reasonable support of the authentication protocols to cover most of the authentication scenarios possible on Azure. We're actively expanding to cover more scenarios. For a full list of the credentials offered, see the [Credential Classes](#credential-classes) section. - -All credential types provided by `@azure/identity` are supported in Node.js. For browsers, `InteractiveBrowserCredential` is the credential type to be used for basic authentication scenarios. - -Most of the credential types offered by `@azure/identity` use the [Microsoft Authentication Library for JavaScript (MSAL.js)](https://github.com/AzureAD/microsoft-authentication-library-for-js). Specifically, we use the v2 MSAL.js libraries, which use [OAuth 2.0 Authorization Code Flow with PKCE](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow) and are [OpenID-compliant](https://learn.microsoft.com/azure/active-directory/develop/v2-protocols-oidc). While `@azure/identity` focuses on simplicity, the MSAL.js libraries, such as [@azure/msal-common](https://www.npmjs.com/package/@azure/msal-common), [@azure/msal-node](https://www.npmjs.com/package/@azure/msal-node), and [@azure/msal-browser](https://www.npmjs.com/package/@azure/msal-browser), are designed to provide robust support for the authentication protocols that Azure supports. - -#### When to use something else - -The `@azure/identity` credential types are implementations of [@azure/core-auth](https://www.npmjs.com/package/@azure/core-auth)'s `TokenCredential` class. In principle, any object with a `getToken` method that satisfies `getToken(scopes: string | string[], options?: GetTokenOptions): Promise` will work as a `TokenCredential`. This means developers can write their own credential types to support authentication cases not covered by `@azure/identity`. To learn more, see [Custom Credentials](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#custom-credentials). - -Though our credential types support many advanced cases, developers may want full control of the authentication protocol. For that use case, we recommend using [Microsoft Authentication Library for JavaScript (MSAL.js)](https://github.com/AzureAD/microsoft-authentication-library-for-js) directly. You can read more through the following links: - -- We portray some advanced use cases of `@azure/identity` on the [Azure Identity Examples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md) page. - - There, we specifically have an [Advanced Examples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#advanced-examples) section. - - We also have a section that shows how to [Authenticate with MSAL directly](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-msal-directly). - -For advanced authentication workflows in the browser, we have a section where we showcase how to use the [@azure/msal-browser](https://www.npmjs.com/package/@azure/msal-browser) library directly to authenticate Azure SDK clients. - -### Authenticate the client in development environment - -While we recommend using managed identity or service principal authentication in your production application, it is typical for a developer to use their own account for authenticating calls to Azure services when debugging and executing code locally. There are several developer tools which can be used to perform this authentication in your development environment. - -#### Authenticate via the Azure Developer CLI - -Developers coding outside of an IDE can also use the [Azure Developer CLI][azure_developer_cli] to authenticate. Applications using the `DefaultAzureCredential` or the `AzureDeveloperCliCredential` can then use this account to authenticate calls in their application when running locally. - -To authenticate with the [Azure Developer CLI][azure_developer_cli], users can run the command `azd login`. For users running on a system with a default web browser, the Azure Developer CLI will launch the browser to authenticate the user. - -For systems without a default web browser, the `azd login --use-device-code` command will use the device code authentication flow. - -#### Authenticate via the Azure CLI - -Applications using the `AzureCliCredential`, whether directly or via the `DefaultAzureCredential`, can use the Azure CLI account to authenticate calls in the application when running locally. - -To authenticate with the [Azure CLI][azure_cli] users can run the command `az login`. For users running on a system with a default web browser the Azure cli will launch the browser to authenticate the user. - -![Azure CLI Account Sign In][azureclilogin_image] - -For systems without a default web browser, the `az login` command will use the device code authentication flow. The user can also force the Azure CLI to use the device code flow rather than launching a browser by specifying the `--use-device-code` argument. - -![Azure CLI Account Device Code Sign In][azureclilogindevicecode_image] - -#### Authenticate via Azure PowerShell - -Applications using the `AzurePowerShellCredential`, whether directly or via the `DefaultAzureCredential`, can use the account connected to Azure PowerShell to authenticate calls in the application when running locally. - -To authenticate with [Azure PowerShell][azure_powershell] users can run the `Connect-AzAccount` cmdlet. By default, ike the Azure CLI, `Connect-AzAccount` will launch the default web browser to authenticate a user account. - -![Azure PowerShell Account Sign In][azurepowershelllogin_image] - -If interactive authentication cannot be supported in the session, then the `-UseDeviceAuthentication` argument will force the cmdlet to use a device code authentication flow instead, similar to the corresponding option in the Azure CLI credential. - -#### Authenticate via Visual Studio Code - -Developers using Visual Studio Code can use the [Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) to authenticate via the editor. Apps using `VisualStudioCodeCredential` can then use this account to authenticate calls in their app when running locally. - -To authenticate in Visual Studio Code, ensure the Azure Account extension is installed. Once installed, open the **Command Palette** and run the **Azure: Sign In** command. - -Additionally, use the [`@azure/identity-vscode`](https://github.com/Azure/azure-sdk-for-js/tree/@azure/identity_3.2.0-beta.2/sdk/identity/identity-vscode) plugin package. This package provides the dependencies of `VisualStudioCodeCredential` and enables it. See [Plugins](##plugins). - -It's a [known issue](https://github.com/Azure/azure-sdk-for-js/issues/20500) that `VisualStudioCodeCredential` doesn't work with [Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) versions newer than **0.9.11**. A long-term fix to this problem is in progress. In the meantime, consider [authenticating via the Azure CLI](#authenticating-via-the-azure-cli). - -### Authenticate the client in browsers - -To authenticate Azure SDK clients within web browsers, we offer the `InteractiveBrowserCredential`, which can be set to use redirection or popups to complete the authentication flow. It's necessary to [create an Azure App Registration](https://learn.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) in the Azure portal for your web application first. - -## Key concepts - -If this is your first time using `@azure/identity` or the Microsoft Identity platform (Azure AD), read [Using `@azure/identity` with Microsoft Identity Platform](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/documentation/using-azure-identity.md) first. This document provides a deeper understanding of the platform and how to configure your Azure account correctly. - -### Credentials - -A credential is a class which contains or can obtain the data needed for a service client to authenticate requests. Service clients across the Azure SDK accept credentials when they're constructed. Service clients use those credentials to authenticate requests to the service. - -The Azure Identity library focuses on OAuth authentication with Azure AD, and it offers a variety of credential classes capable of acquiring an Azure AD token to authenticate service requests. All of the credential classes in this library are implementations of the [TokenCredential](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/core/core-auth/src/tokenCredential.ts) abstract class, and any of them can be used by to construct service clients capable of authenticating with a TokenCredential. - -See [Credential Classes](#credential-classes). - -### DefaultAzureCredential - -The `DefaultAzureCredential` is appropriate for most scenarios where the application is intended to ultimately be run in Azure. This is because the `DefaultAzureCredential` combines credentials commonly used to authenticate when deployed with credentials used to authenticate in a development environment. - -> Note: `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types. - -If used from Node.js, the `DefaultAzureCredential` will attempt to authenticate via the following mechanisms in order: - -![DefaultAzureCredential authentication flow][defaultauthflow_image] - -1. **Environment** - The `DefaultAzureCredential` will read account information specified via [environment variables](#environment-variables) and use it to authenticate. -1. **Workload Identity** - If the application is deployed to Azure Kubernetes Service with Managed Identity enabled, `DefaultAzureCredential` will authenticate with it. -1. **Managed Identity** - If the application is deployed to an Azure host with Managed Identity enabled, the `DefaultAzureCredential` will authenticate with that account. -1. **Azure Developer CLI** - If the developer has authenticated an account via the Azure Developer CLI `azd login` command, the `DefaultAzureCredential` will authenticate with that account. -1. **Azure CLI** - If the developer has authenticated an account via the Azure CLI `az login` command, the `DefaultAzureCredential` will authenticate with that account. -1. **Azure PowerShell** - If the developer has authenticated using the Azure PowerShell module `Connect-AzAccount` command, the `DefaultAzureCredential` will authenticate with that account. - -#### Note about `VisualStudioCodeCredential` - -Due to a [known issue](https://github.com/Azure/azure-sdk-for-js/issues/20500), `VisualStudioCodeCredential` has been removed from the `DefaultAzureCredential` token chain. When the issue is resolved in a future release, this change will be reverted. - -## Plugins - -Azure Identity for JavaScript provides a plugin API that allows us to provide certain functionality through separate _plugin packages_. The `@azure/identity` package exports a top-level function (`useIdentityPlugin`) that can be used to enable a plugin. We provide two plugin packages: - -- [`@azure/identity-cache-persistence`](https://github.com/Azure/azure-sdk-for-js/tree/@azure/identity_3.2.0-beta.2/sdk/identity/identity-cache-persistence), which provides persistent token caching in Node.js using a native secure storage system provided by your operating system. This plugin allows cached `access_token` values to persist across sessions, meaning that an interactive login flow does not need to be repeated as long as a cached token is available. -- [`@azure/identity-vscode`](https://github.com/Azure/azure-sdk-for-js/tree/@azure/identity_3.2.0-beta.2/sdk/identity/identity-vscode), which provides the dependencies of `VisualStudioCodeCredential` and enables it. Without this plugin, the `VisualStudioCodeCredential` in this package will throw a `CredentialUnavailableError`. The plugin provides the underlying implementation of this credential, enabling it for use both on its own and as part of the `DefaultAzureCredential` described above. - -## Examples - -You can find more examples of using various credentials in [Azure Identity Examples Page](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md) - -### Authenticate with the `DefaultAzureCredential` - -This example demonstrates authenticating the `KeyClient` from the [@azure/keyvault-keys](https://www.npmjs.com/package/@azure/keyvault-keys) client library using the `DefaultAzureCredential`. - -```javascript -// The default credential first checks environment variables for configuration as described above. -// If environment configuration is incomplete, it will try managed identity. - -// Azure Key Vault service to use -const { KeyClient } = require("@azure/keyvault-keys"); - -// Azure authentication library to access Azure Key Vault -const { DefaultAzureCredential } = require("@azure/identity"); - -// Azure SDK clients accept the credential as a parameter -const credential = new DefaultAzureCredential(); - -// Create authenticated client -const client = new KeyClient(vaultUrl, credential); -``` - -### Specify a user-assigned managed identity with the `DefaultAzureCredential` - -A relatively common scenario involves authenticating using a user-assigned managed identity for an Azure resource. Explore the [example on Authenticating a user-assigned managed identity with DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-assigned-managed-identity-with-defaultazurecredential) to see how this is made a relatively straightforward task that can be configured using environment variables or in code. - -### Define a custom authentication flow with the `ChainedTokenCredential` - -While the `DefaultAzureCredential` is generally the quickest way to get started developing applications for Azure, more advanced users may want to customize the credentials considered when authenticating. The `ChainedTokenCredential` enables users to combine multiple credential instances to define a customized chain of credentials. This example demonstrates creating a `ChainedTokenCredential` which will attempt to authenticate using two differently configured instances of `ClientSecretCredential`, to then authenticate the `KeyClient` from the [@azure/keyvault-keys](https://www.npmjs.com/package/@azure/keyvault-keys): - -```javascript -const { ClientSecretCredential, ChainedTokenCredential } = require("@azure/identity"); - -// When an access token is requested, the chain will try each -// credential in order, stopping when one provides a token -const firstCredential = new ClientSecretCredential(tenantId, clientId, clientSecret); -const secondCredential = new ClientSecretCredential(tenantId, anotherClientId, anotherSecret); -const credentialChain = new ChainedTokenCredential(firstCredential, secondCredential); - -// The chain can be used anywhere a credential is required -const { KeyClient } = require("@azure/keyvault-keys"); -const client = new KeyClient(vaultUrl, credentialChain); -``` - -## Managed identity support - -The [Managed identity authentication](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview) is supported via either the `DefaultAzureCredential` or the `ManagedIdentityCredential` credential classes directly for the following Azure services: - -- [Azure App Service and Azure Functions](https://learn.microsoft.com/azure/app-service/overview-managed-identity) -- [Azure Arc](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication) -- [Azure Cloud Shell](https://learn.microsoft.com/azure/cloud-shell/msi-authorization) -- [Azure Kubernetes Service](https://learn.microsoft.com/azure/aks/use-managed-identity) -- [Azure Service Fabric](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity) -- [Azure Virtual Machines](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token) -- [Azure Virtual Machines Scale Sets](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-powershell-windows-vmss) - -For examples of how to use managed identity for authentication, see [the examples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-in-azure-with-managed-identity). - -## Cloud configuration - -Credentials default to authenticating to the Azure AD endpoint for Azure Public Cloud. To access resources in other clouds, such as Azure Government or a private cloud, configure credentials with the `authorityHost` argument in the constructor. The `AzureAuthorityHosts` interface defines authorities for well-known clouds. For the US Government cloud, you could instantiate a credential this way: - -```ts -import { AzureAuthorityHosts, ClientSecretCredential } from "@azure/identity"; -const credential = new ClientSecretCredential( - "", - "", - "", - { - authorityHost: AzureAuthorityHosts.AzureGovernment, - } -); -``` - -Not all credentials require this configuration. Credentials that authenticate through a development tool, such as `AzureCliCredential`, use that tool's configuration. Similarly, `VisualStudioCodeCredential` accepts an `authorityHost` argument but defaults to the `authorityHost` matching Visual Studio Code's **Azure: Cloud** setting. - -## Credential classes - -### Authenticate Azure-hosted applications - -| Credential | Usage | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [`DefaultAzureCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/defaultazurecredential?view=azure-node-latest) | Provides a simplified authentication experience to quickly start developing applications run in Azure. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-defaultazurecredential) | -| [`ChainedTokenCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/chainedtokencredential?view=azure-node-latest) | Allows users to define custom authentication flows composing multiple credentials. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#chaining-credentials) | -| [`EnvironmentCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/environmentcredential?view=azure-node-latest) | Authenticates a service principal or user via credential information specified in environment variables. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-service-principal-with-environment-credentials) | -| [`ManagedIdentityCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/managedidentitycredential?view=azure-node-latest) | Authenticates the managed identity of an Azure resource. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-in-azure-with-managed-identity) | -|`WorkloadIdentityCredential`| Supports [Azure AD workload identity](https://learn.microsoft.com/azure/aks/workload-identity-overview) on Kubernetes. | | - -### Authenticate service principals - -| Credential | Usage | Example | Reference | -| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| [`ClientAssertionCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/clientassertioncredential?view=azure-node-latest) | Authenticates a service principal using a signed client assertion. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-service-principal-with-a-client-assertion) | [Service principal authentication](https://learn.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals) | -| [`ClientCertificateCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/clientcertificatecredential?view=azure-node-latest) | Authenticates a service principal using a certificate. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-service-principal-with-a-client-certificate) | [Service principal authentication](https://learn.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals) | -| [`ClientSecretCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/clientsecretcredential?view=azure-node-latest) | Authenticates a service principal using a secret. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-service-principal-with-a-client-secret) | [Service principal authentication](https://learn.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals) | - -### Authenticate users - -| Credential | Usage | Example | Reference | -| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| [`AuthorizationCodeCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/authorizationcodecredential?view=azure-node-latest) | Authenticates a user with a previously obtained authorization code. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-auth-code-flow) | [OAuth2 authentication code](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow) | -| [`DeviceCodeCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/devicecodecredential?view=azure-node-latest) | Interactively authenticates a user on devices with limited UI. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-device-code-flow) | [Device code authentication](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-device-code) | -| [`InteractiveBrowserCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/interactivebrowsercredential?view=azure-node-latest) | Interactively authenticates a user with the default system browser. Read more about how this happens [here](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/interactive-browser-credential.md). | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-interactively-in-the-browser) | [OAuth2 authentication code](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow) | -| [`OnBehalfOfCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/onbehalfofcredential?view=azure-node-latest) | Propagates the delegated user identity and permissions through the request chain | | [On-behalf-of authentication](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow) -| [`UsernamePasswordCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/usernamepasswordcredential?view=azure-node-latest) | Authenticates a user with a username and password. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-username-and-password) | [Username + password authentication](https://learn.microsoft.com/azure/active-directory/develop/v2-oauth-ropc) | - -### Authenticate via development tools - -| Credential | Usage | Example | Reference | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `AzureDeveloperCliCredential` | Authenticate in a development environment with the enabled user or service principal in Azure Developer CLI. | | [Azure Developer CLI Reference](https://learn.microsoft.com/azure/developer/azure-developer-cli/reference) | -| [`AzureCliCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/azureclicredential?view=azure-node-latest) | Authenticate in a development environment with the Azure CLI. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-azure-cli) | [Azure CLI authentication](https://learn.microsoft.com/cli/azure/authenticate-azure-cli) | -| [`AzurePowerShellCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/azurepowershellcredential?view=azure-node-latest) | Authenticate in a development environment using Azure PowerShell. | [example](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-a-user-account-with-azure-powershell) | [Azure PowerShell authentication](https://learn.microsoft.com/powershell/azure/authenticate-azureps) | -| [`VisualStudioCodeCredential`](https://learn.microsoft.com/javascript/api/@azure/identity/visualstudiocodecredential?view=azure-node-latest) | Authenticates as the user signed in to the Visual Studio Code Azure Account extension.| | [VS Code Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) - -## Environment variables - -`DefaultAzureCredential` and `EnvironmentCredential` can be configured with environment variables. Each type of authentication requires values for specific variables. - -#### Service principal with secret - -| Variable name | Value | -| --------------------- | --------------------------------------- | -| `AZURE_CLIENT_ID` | ID of an Azure AD application | -| `AZURE_TENANT_ID` | ID of the application's Azure AD tenant | -| `AZURE_CLIENT_SECRET` | one of the application's client secrets | - -#### Service principal with certificate - -| Variable name | Value | -| ----------------------------------- | ------------------------------------------------------------ | -| `AZURE_CLIENT_ID` | ID of an Azure AD application | -| `AZURE_TENANT_ID` | ID of the application's Azure AD tenant | -| `AZURE_CLIENT_CERTIFICATE_PATH` | path to a PEM-encoded certificate file including private key | -| `AZURE_CLIENT_CERTIFICATE_PASSWORD` | password of the certificate file, if any | - -#### Username and password - -| Variable name | Value | -| ----------------- | --------------------------------------- | -| `AZURE_CLIENT_ID` | ID of an Azure AD application | -| `AZURE_TENANT_ID` | ID of the application's Azure AD tenant | -| `AZURE_USERNAME` | a username (usually an email address) | -| `AZURE_PASSWORD` | that user's password | - -Configuration is attempted in the above order. For example, if values for a client secret and certificate are both present, the client secret will be used. - -## Troubleshooting - -### Error handling - -Credentials raise `AuthenticationError` when they fail to authenticate. This class has a `message` field which describes why authentication failed. An `AggregateAuthenticationError` will be raised by `ChainedTokenCredential` with an `errors` field containing an array of errors from each credential in the chain. - -### Logging - -Enabling logging may help uncover useful information about failures. - -To see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. -You can read this environment variable from the _.env_ file by explicitly specifying a file path: - -```javascript -require("dotenv").config({ path: ".env" }); -``` - -Alternatively, logging can be enabled at runtime by calling `setLogLevel` from the `@azure/logger` package: - -```javascript -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -In cases where the authenticate code might be running in an environment with more than one credential available, -the `@azure/identity` package offers a unique form of logging. On the optional parameters for every credential, -developers can set `allowLoggingAccountIdentifiers` to true in the -`loggingOptions` to log information specific to the authenticated account after -each successful authentication, including the Client ID, the Tenant ID, the -Object ID of the authenticated user, and if possible the User Principal Name. - -For example, using the `DefaultAzureCredential`: - -```js -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); - -const credential = new DefaultAzureCredential({ - loggingOptions: { allowLoggingAccountIdentifiers: true }, -}); -``` - -Once that credential authenticates, the following message will appear in the logs (with the real information instead of `HIDDEN`): - -``` -azure:identity:info [Authenticated account] Client ID: HIDDEN. Tenant ID: HIDDEN. User Principal Name: HIDDEN. Object ID (user): HIDDEN -``` - -For assistance with troubleshooting, see the [troubleshooting guide](https://aka.ms/azsdk/js/identity/troubleshoot). - -## Next steps - -### Read the documentation - -API documentation for this library can be found on our [documentation site](https://learn.microsoft.com/javascript/api/@azure/identity). - -### Client library support - -Client and management libraries listed on the [Azure SDK releases page](https://azure.github.io/azure-sdk/releases/latest/js.html) that support Azure AD authentication accept credentials from this library. Learn more about using these libraries in their documentation, which is linked from the releases page. - -### Known issues - -#### Azure AD B2C support - -This library doesn't support the [Azure AD B2C](https://learn.microsoft.com/azure/active-directory-b2c/overview) service. - -For other open issues, see the library's [GitHub repository](https://github.com/Azure/azure-sdk-for-js/issues?q=is%3Aopen+is%3Aissue+label%3AAzure.Identity). - -### Provide feedback - -If you encounter bugs or have suggestions, please [open an issue](https://github.com/Azure/azure-sdk-for-js/issues). - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_3.2.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -[1]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/1.0.0/classes/defaultazurecredential.html -[2]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/1.0.0/classes/managedidentitycredential.html -[3]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/1.0.0/classes/environmentcredential.html -[4]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/1.0.0/classes/clientsecretcredential.html -[5]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/1.0.0/classes/clientcertificatecredential.html -[6]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/1.0.0/classes/devicecodecredential.html -[7]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/1.0.0/classes/authorizationcodecredential.html -[8]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/1.0.0/classes/interactivebrowsercredential.html -[9]: https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity/1.0.0/classes/usernamepasswordcredential.html -[azure_cli]: https://learn.microsoft.com/cli/azure -[azure_powershell]: https://learn.microsoft.com/powershell/azure/ -[azureclilogin_image]: https://raw.githubusercontent.com/Azure/azure-sdk-for-js/main/sdk/identity/identity/images/AzureCliLogin.png -[azureclilogindevicecode_image]: https://raw.githubusercontent.com/Azure/azure-sdk-for-js/main/sdk/identity/identity/images/AzureCliLoginDeviceCode.png -[azurepowershelllogin_image]: https://raw.githubusercontent.com/Azure/azure-sdk-for-js/main/sdk/identity/identity/images/AzurePowerShellLogin.png -[defaultauthflow_image]: https://raw.githubusercontent.com/Azure/azure-sdk-for-js/main/sdk/identity/identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fidentity%2Fidentity%2FREADME.png) - diff --git a/docs-ref-services/preview/identity-vscode-readme.md b/docs-ref-services/preview/identity-vscode-readme.md deleted file mode 100644 index ed74db59e279..000000000000 --- a/docs-ref-services/preview/identity-vscode-readme.md +++ /dev/null @@ -1,145 +0,0 @@ ---- -title: -keywords: Azure, javascript, SDK, API, @azure/identity-vscode, identity -author: ramya-rao-a -ms.author: ramyar -ms.date: 09/10/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: identity ---- - -## Azure Identity Plugin for Visual Studio Code Authentication - -This package provides a plugin to the Azure Identity library for JavaScript ([`@azure/identity`](https://npmjs.com/package/@azure/identity)) that enables authentication through the "Azure Account" extension for Visual Studio Code. This plugin provides the dependencies of the `VisualStudioCodeCredential` in `@azure/identity` and enables it for use on its own or as part of `DefaultAzureCredential`. - -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/identity-vscode_1.0.0-beta.2/sdk/identity/identity-vscode) | [Samples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity-vscode_1.0.0-beta.2/sdk/identity/identity-vscode/samples-dev) - -## Getting started - -```javascript -import { useIdentityPlugin } from "@azure/identity"; -import { vsCodePlugin } from "@azure/identity-vscode"; - -useIdentityPlugin(vsCodePlugin); -``` - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/). -- Install [Visual Studio Code](https://aka.ms/vscode) and the ["Azure Account" extension][azaccountext] - -### Install the package - -This package is designed to be used with Azure Identity for JavaScript. Install both `@azure/identity` and this package using `npm`: - -```sh -$ npm install --save @azure/identity -$ npm install --save-dev @azure/identity-vscode -``` - -#### Supported Environments - -Azure Identity plugins for JavaScript support stable (even numbered) versions of Node.js starting from v12. While the plugins may run in other Node versions, no support is guaranteed. `@azure/identity-vscode` **does not** support browser environments. - -## Key concepts - -If this is your first time using `@azure/identity` or the Microsoft identity platform (Azure Active Directory), we recommend that you read [Using `@azure/identity` with Microsoft Identity Platform](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity-vscode_1.0.0-beta.2/documentation/using-azure-identity.md) first. This document will give you a deeper understanding of the platform and how to configure your Azure account correctly. - -### Azure Identity Plugins - -As of `@azure/identity` version 2.0.0, the Identity client library for JavaScript includes a plugin API. This package (`@azure/identity-vscode`) exports a plugin object that you must pass as an argument to the top-level `useIdentityPlugin` function from the `@azure/identity` package. Enable authentication through the "Azure Account" extension for Visual Studio Code as follows: - -```javascript -import { useIdentityPlugin } from "@azure/identity"; -import { vsCodePlugin } from "@azure/identity-vscode"; - -useIdentityPlugin(vsCodePlugin); -``` - -After calling `useIdentityPlugin`, the `VisualStudioCodeCredential` from the `@azure/identity` package will be enabled. If this plugin is not used, then `VisualStudioCodeCredential` will throw a `CredentialUnavailableError`, and it will not be available as part of `DefaultAzureCredential`. - -### Visual Studio Code Authentication - -`VisualStudioCodeCredential` uses the authentication session from the ["Azure Account" extension][azaccountext]. To use this credential, you must sign in to your Azure account using the extension. To do so, open Visual Studio Code, ensure that the extension is installed, and sign in from **Command Palette** using the "Azure: Sign In" option to open a browser window and sign in to Azure. Alternatively, you can select "Azure: Sign In with Device Code" to use the device code flow. - -After signing in, you may need to select a subscription (for example, if you have multiple Azure subscriptions), and you can change the active subscription by using the menu to select the "Azure: Select Subscriptions" entry. - -## Examples - -Once the plugin is registered, you can use `VisualStudioCodeCredential` in a similar fashion to the other credential classes in `@azure/identity`: - -```javascript -import { useIdentityPlugin, VisualStudioCodeCredential } from "@azure/identity"; -import { vsCodePlugin } from "@azure/identity-vscode"; - -useIdentityPlugin(vsCodePlugin); - -async function main() { - const credential = new VisualStudioCodeCredential(); - - // The graph.microsoft.com scope is used as an example - const scope = "https://graph.microsoft.com/.default"; - - // Print out part of the access token - console.log((await credential.getToken(scope)).token.substr(0, 10), "..."); -} - -main().catch((error) => { - console.error("An error occurred:", error); - process.exit(1); -}); -``` - -You can also use `DefaultAzureCredential`, which will attempt to authenticate using the "Azure Account" extension for Visual Studio Code if it's available: - -```javascript -import { useIdentityPlugin, DefaultAzureCredential } from "@azure/identity"; -import { vsCodePlugin } from "@azure/identity-vscode"; - -useIdentityPlugin(vsCodePlugin); - -async function main() { - // With the plugin enabled above, `DefaultAzureCredential` will use - // Visual Studio Code's "Azure Account" extension to authenticate if - // it is available. - const credential = new DefaultAzureCredential(); - - // This will print a JWT access_token and its expiration timestamp - // The graph.microsoft.com scope is used as an example - console.log("Token:", await credential.getToken("https://graph.microsoft.com/.default")); -} - -main().catch((error) => { - console.error("An error occurred:", error); - process.exit(1); -}); -``` - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -## Next steps - -### Provide Feedback - -If you encounter bugs or have suggestions, please [open an issue](https://github.com/Azure/azure-sdk-for-js/issues). - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity-vscode_1.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -[azaccountext]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fidentity%2Fidentity%2FREADME.png) - diff --git a/docs-ref-services/preview/iot-device-update-rest-readme.md b/docs-ref-services/preview/iot-device-update-rest-readme.md deleted file mode 100644 index c5a3c8b69f8f..000000000000 --- a/docs-ref-services/preview/iot-device-update-rest-readme.md +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: Azure Device Update for IoT Hub Rest Client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure-rest/iot-device-update, deviceupdate -author: xirzec -ms.author: jeffish -ms.date: 07/08/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: deviceupdate ---- -# Azure Device Update for IoT Hub Rest Client library for JavaScript - version 1.0.0-beta.2 - - -The library provides access to the Device Update for IoT Hub service that enables customers to publish updates for their IoT devices to the cloud, and then deploy these updates to their devices (approve updates to groups of devices managed and provisioned in IoT Hub). - -**Please rely heavily on the [service's documentation][device_update_product_documentation] and our [REST client docs][rest_client] to use this library** - -Key links: -- [Source code][source_code] -- [Package (NPM)][npm] -- [API reference documentation][ref_docs] -- [Product documentation][device_update_product_documentation] - -## Getting started - -### Currently supported environments - -- Node.js version 14.x.x or higher - -### Prerequisites - -- Microsoft Azure Subscription: To call Microsoft Azure services, you need to create an [Azure subscription][azure_subscription] -- Device Update for IoT Hub instance -- Azure IoT Hub instance - -### Install the `@azure-rest/iot-device-update` package - -Install the Azure Iot Device Update client library for JavaScript with `npm`: - -```bash -npm install @azure-rest/iot-device-update -``` - -### Create and authenticate a `DeviceUpdate` - -To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], -provide an instance of the desired credential type obtained from the -[@azure/identity][azure_identity_credentials] library. - -To authenticate with AAD, you must first `npm` install [`@azure/identity`][azure_identity_npm]. - -After installation, you can choose which type of [credential][azure_identity_credentials] from `@azure/identity` to use. -As an example, [DefaultAzureCredential][default_azure_credential] -can be used to authenticate the client: - -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 - -Use the returned token credential to authenticate the client: - -```typescript -import DeviceUpdate from "@azure-rest/iot-device-update"; -import { DefaultAzureCredential } from "@azure/identity"; -const client = DeviceUpdate( - "https://.api.adu.microsoft.com", - new DefaultAzureCredential() -); -``` - -## Key concepts - -### REST Client - -This client is one of our REST clients. We highly recommend you read how to use a REST client [here][rest_client]. - -## Examples - -The following section shows you how to initialize and authenticate your client, then get all devices. - -- [Get All Devices](#get-all-devices "Get All Devices") - -```typescript -import DeviceUpdate from "@azure-rest/iot-device-update"; -import { DefaultAzureCredential } from "@azure/identity"; - -async function main() { - console.log("== List devices =="); - const client = DeviceUpdate(endpoint, new DefaultAzureCredential()); - - const result = await client - .path("/deviceupdate/{instanceId}/management/devices", instanceId) - .get(); - - console.log(result); -} - -main().catch(console.error); -``` - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/iot-device-update_1.0.0-beta.2/sdk/core/logger). - -## Next steps - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure-rest/iot-device-update_1.0.0-beta.2/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdeviceupdate%2Fiot-device-update%2FREADME.png) - -[device_update_product_documentation]: /azure/iot-hub-device-update/ -[rest_client]: https://github.com/Azure/azure-sdk-for-js/blob/@azure-rest/iot-device-update_1.0.0-beta.2/documentation/rest-clients.md -[source_code]: https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/iot-device-update_1.0.0-beta.2/sdk/deviceupdate/iot-device-update-rest -[npm]: https://www.npmjs.com/org/azure-rest -[ref_docs]: https://azure.github.io/azure-sdk-for-js -[azure_subscription]: https://azure.microsoft.com/free/ -[authenticate_with_token]: /azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token -[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/iot-device-update_1.0.0-beta.2/sdk/identity/identity#credentials -[azure_identity_npm]: https://www.npmjs.com/package/@azure/identity -[default_azure_credential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/iot-device-update_1.0.0-beta.2/sdk/identity/identity#defaultazurecredential - diff --git a/docs-ref-services/preview/keyvault-admin-readme.md b/docs-ref-services/preview/keyvault-admin-readme.md deleted file mode 100644 index 4c43e34e6a6d..000000000000 --- a/docs-ref-services/preview/keyvault-admin-readme.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: Azure Key Vault Administration client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/keyvault-admin, keyvault -author: timovv -ms.author: timov -ms.date: 11/10/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: keyvault ---- -# Azure Key Vault Administration client library for JavaScript - version 4.4.0-beta.1 - - -Azure Key Vault Managed HSM is a fully-managed, highly-available, single-tenant, standards-compliant cloud service that enables you to safeguard cryptographic keys for your cloud applications using FIPS 140-2 Level 3 validated HSMs. If you would like to know more about Azure Key Vault Managed HSM, you may want to review: [What is Azure Key Vault Managed HSM?][managedhsm] - -The package `@azure/keyvault-admin` provides support for administrative Key Vault tasks such as full backup / restore and key-level role-based access control (RBAC). - -> Note: The Administration library only works with [Azure Key Vault Managed HSM][managedhsm] - functions targeting a Key Vault will fail. -> -> Note: This package cannot be used in the browser due to Azure Key Vault service limitations, please refer to [this document](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-admin_4.4.0-beta.1/samples/cors/ts/README.md) for guidance. - -Key links: - -- [Source code][package-gh] -- [Package (npm)][package-npm] -- [API Reference Documentation][docs] -- [Product documentation][docs-service] -- [Samples][samples] - -## Getting started - -### Install the package - -Install the Azure Key Vault administration client library for JavaScript and TypeScript with [NPM][npm]: - -```PowerShell -npm install @azure/keyvault-admin -``` - -### Configure TypeScript - -TypeScript users need to have Node type definitions installed: - -```bash -npm install @types/node -``` - -You also need to enable `compilerOptions.allowSyntheticDefaultImports` in your tsconfig.json. Note that if you have enabled `compilerOptions.esModuleInterop`, `allowSyntheticDefaultImports` is enabled by default. See [TypeScript's compiler options handbook][compiler-options] for more information. - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- An existing [Key Vault Managed HSM][azure_keyvault_mhsm]. If you need to create a Managed HSM, you can do so using the Azure CLI by following the steps in [this document][azure_keyvault_mhsm_cli]. - -## Authenticate the client - -In order to interact with the Azure Key Vault service, you will need to create an instance of either the [`KeyVaultAccessControlClient`](#create-keyvaultaccesscontrolclient) class or the [`KeyVaultBackupClient`](#create-keyvaultbackupclient) class, as well as a **vault url** (which you may see as "DNS Name" in the Azure Portal) and a credential object. The examples shown in this document use a credential object named [`DefaultAzureCredential`][default_azure_credential], which is appropriate for most scenarios, including local development and production environments. Additionally, we recommend using a [managed identity][managed_identity] for authentication in production environments. - -You can find more information on different ways of authenticating and their corresponding credential types in the [Azure Identity documentation][azure_identity]. - -### Create KeyVaultAccessControlClient - -Once you've authenticated with [the authentication method that suits you best][default_azure_credential], you can create a `KeyVaultAccessControlClient` as follows, substituting in your Managed HSM URL in the constructor: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyVaultAccessControlClient } = require("@azure/keyvault-admin"); - -const credentials = new DefaultAzureCredential(); - -const client = new KeyVaultAccessControlClient(``, credentials); -``` - -### Create KeyVaultBackupClient - -Once you've authenticated with [the authentication method that suits you best][default_azure_credential], you can create a `KeyVaultBackupClient` as follows, substituting in your Managed HSM URL in the constructor: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyVaultBackupClient } = require("@azure/keyvault-admin"); - -const credentials = new DefaultAzureCredential(); - -const client = new KeyVaultBackupClient(``, credentials); -``` - -## Key concepts - -### KeyVaultRoleDefinition - -A Role Definition is a collection of permissions. A role definition defines the operations that can be performed, such as read, write, and delete. It can also define the operations that are excluded from allowed operations. - -Role definitions can be listed and specified as part of a `KeyVaultRoleAssignment`. - -### KeyVaultRoleAssignment - -A Role Assignment is the association of a Role Definition to a service principal. They can be created, listed, fetched individually, and deleted. - -### KeyVaultAccessControlClient - -A `KeyVaultAccessControlClient` provides operations allowing for management of Role Definitions (instances of `KeyVaultRoleDefinition`) and Role Assignments (instances of `KeyVaultRoleAssignment`). - -### KeyVaultBackupClient - -A `KeyVaultBackupClient` provides operations for performing full key backups, full key restores, and selective key restores. - -### Long running operations - -The operations done by the `KeyVaultBackupClient` may take as much time as needed by the Azure resources, requiring a client layer to keep track, serialize, and resume the operations through the lifecycle of the programs that wait for them to finish. This is done via a common abstraction through the package [@azure/core-lro][core-lro]. - -The `KeyVaultBackupClient` offers three methods that execute long running operations: - -- `beginBackup`, starts generating a backup of an Azure Key Vault on the specified Storage Blob account. -- `beginRestore`, starts restoring all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder. -- `beginSelectiveRestore`, starts restoring all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob storage backup folder. - -The methods that begin long running operations return a poller that allows you to wait indefinitely until the operation is complete. More information is available in the examples below. - -## Examples - -We have samples both in JavaScript and TypeScript that show the access control and backup/restore features in this package. Please follow the corresponding readmes for detailed steps to run the samples. - -- [Readme for JavaScript samples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-admin_4.4.0-beta.1/sdk/keyvault/keyvault-admin/samples/v4/javascript/README.md) -- [Readme for TypeScript samples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-admin_4.4.0-beta.1/sdk/keyvault/keyvault-admin/samples/v4/typescript/README.md) - -## Troubleshooting - -See our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-admin_4.4.0-beta.1/sdk/keyvault/keyvault-admin/TROUBLESHOOTING.md) for details on how to diagnose various failure scenarios. - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -## Next steps - -You can find more code samples through the following links: - -- [Key Vault Administration Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-admin_4.4.0-beta.1/sdk/keyvault/keyvault-admin/samples/v4/javascript) -- [Key Vault Administration Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-admin_4.4.0-beta.1/sdk/keyvault/keyvault-admin/samples/v4/typescript) -- [Key Vault Administration Test Cases](https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-admin_4.4.0-beta.1/sdk/keyvault/keyvault-admin/test/) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-admin_4.4.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fkeyvault%2Fkeyvault-admin%2FREADME.png) - - - -[compiler-options]: https://www.typescriptlang.org/docs/handbook/compiler-options.html -[core-lro]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-admin_4.4.0-beta.1/sdk/core/core-lro -[docs-service]: https://azure.microsoft.com/services/key-vault/ -[docs]: /javascript/api/@azure/keyvault-admin -[managedhsm]: /azure/key-vault/managed-hsm/overview -[npm]: https://www.npmjs.com/ -[package-gh]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-admin_4.4.0-beta.1/sdk/keyvault/keyvault-admin -[package-npm]: https://www.npmjs.com/package/@azure/keyvault-admin -[samples]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-admin_4.4.0-beta.1/sdk/keyvault/keyvault-admin/samples -[azure_keyvault_mhsm]: /azure/key-vault/managed-hsm/overview -[azure_keyvault_mhsm_cli]: /azure/key-vault/managed-hsm/quick-create-cli -[default_azure_credential]: /java/api/overview/azure/identity-readme?view=azure-java-stable#defaultazurecredential -[managed_identity]: /azure/active-directory/managed-identities-azure-resources/overview -[azure_identity]: /java/api/overview/azure/identity-readme?view=azure-java-stable - diff --git a/docs-ref-services/preview/keyvault-certificates-readme.md b/docs-ref-services/preview/keyvault-certificates-readme.md deleted file mode 100644 index 9a64fd694fdf..000000000000 --- a/docs-ref-services/preview/keyvault-certificates-readme.md +++ /dev/null @@ -1,714 +0,0 @@ ---- -title: Azure Key Vault Certificates client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/keyvault-certificates, keyvault -author: timovv -ms.author: timov -ms.date: 07/08/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: keyvault ---- -# Azure Key Vault Certificates client library for JavaScript - version 4.5.0-beta.1 - - -Azure Key Vault is a cloud service that provides secure storage and automated management of certificates used throughout a cloud application. Multiple certificates, and multiple versions of the same certificate, can be kept in the Azure Key Vault. Each certificate in the vault has a policy associated with it which controls the issuance and lifetime of the certificate, along with actions to be taken as certificates near expiry. - -If you would like to know more about Azure Key Vault, you may want to review: [What is Azure Key Vault?](/azure/key-vault/key-vault-overview) - -Use the client library for Azure Key Vault Certificates in your Node.js application to: - -- Get, set and delete a certificate. -- Update a certificate, its attributes, issuer, policy, operation and contacts. -- Backup and restore a certificate. -- Get, purge or recover a deleted certificate. -- Get all the versions of a certificate. -- Get all certificates. -- Get all deleted certificates. - -> Note: This package cannot be used in the browser due to Azure Key Vault service limitations, please refer to [this document](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-certificates_4.5.0-beta.1/samples/cors/ts/README.md) for guidance. - -Key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-certificates_4.5.0-beta.1/sdk/keyvault/keyvault-certificates) -- [Package (npm)](https://www.npmjs.com/package/@azure/keyvault-certificates) -- [API Reference Documentation](/javascript/api/@azure/keyvault-certificates) -- [Product documentation](https://azure.microsoft.com/services/key-vault/) -- [Samples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-certificates_4.5.0-beta.1/sdk/keyvault/keyvault-certificates/samples) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- A [Key Vault resource](/azure/key-vault/quick-create-portal) - -### Install the package - -Install the Azure Key Vault Certificates client library using npm - -`npm install @azure/keyvault-certificates` - -### Install the identity library - -Key Vault clients authenticate using the Azure Identity Library. Install it as well using npm - -`npm install @azure/identity` - -### Configure TypeScript - -TypeScript users need to have Node type definitions installed: - -```bash -npm install @types/node -``` - -You also need to enable `compilerOptions.allowSyntheticDefaultImports` in your tsconfig.json. Note that if you have enabled `compilerOptions.esModuleInterop`, `allowSyntheticDefaultImports` is enabled by default. See [TypeScript's compiler options handbook](https://www.typescriptlang.org/docs/handbook/compiler-options.html) for more information. - -### Configuring your Key Vault - -Use the [Azure Cloud Shell](https://shell.azure.com/bash) snippet below to create/get client secret credentials. - -- Create a service principal and configure its access to Azure resources: - ```Bash - az ad sp create-for-rbac -n --skip-assignment - ``` - Output: - ```json - { - "appId": "generated-app-ID", - "displayName": "dummy-app-name", - "name": "http://dummy-app-name", - "password": "random-password", - "tenant": "tenant-ID" - } - ``` -- Use the above returned credentials information to set **AZURE_CLIENT_ID**(appId), **AZURE_CLIENT_SECRET**(password) and **AZURE_TENANT_ID**(tenant) environment variables. The following example shows a way to do this in Bash: - - ```Bash - export AZURE_CLIENT_ID="generated-app-ID" - export AZURE_CLIENT_SECRET="random-password" - export AZURE_TENANT_ID="tenant-ID" - ``` - -- Grant the above mentioned application authorization to perform certificate operations on the keyvault: - - ```Bash - az keyvault set-policy --name --spn $AZURE_CLIENT_ID --certificate-permissions backup create delete deleteissuers get getissuers import list listissuers managecontacts manageissuers purge recover restore setissuers update - ``` - - > --certificate-permissions: - > Accepted values: backup, create, delete, deleteissuers, get, getissuers, import, list, listissuers, managecontacts, manageissuers, purge, recover, restore, setissuers, update - - If you have enabled role-based access control (RBAC) for Key Vault instead, you can find roles like "Key Vault Certificates Officer" in our [RBAC guide](/azure/key-vault/general/rbac-guide). - -- Use the above mentioned Key Vault name to retrieve details of your Vault which also contains your Key Vault URL: - ```Bash - az keyvault show --name - ``` - -## Authenticating with Azure Active Directory - -The Key Vault service relies on Azure Active Directory to authenticate requests to its APIs. The [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) package provides a variety of credential types that your application can use to do this. The [README for `@azure/identity`](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-certificates_4.5.0-beta.1/sdk/identity/identity/README.md) provides more details and samples to get you started. - -Here's a quick example. First, import `DefaultAzureCredential` and `CertificateClient`: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); -``` - -Once these are imported, we can next connect to the key vault service. To do this, we'll need to copy some settings from the key vault we are connecting to into our environment variables. Once they are in our environment, we can access them with the following code: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -// DefaultAzureCredential expects the following three environment variables: -// * AZURE_TENANT_ID: The tenant ID in Azure Active Directory -// * AZURE_CLIENT_ID: The application (client) ID registered in the AAD tenant -// * AZURE_CLIENT_SECRET: The client secret for the registered application -const credential = new DefaultAzureCredential(); - -// Build the URL to reach your key vault -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -// Lastly, create our certificates client and connect to the service -const client = new CertificateClient(url, credential); -``` - -## Key concepts - -- The **Certificates client** is the primary interface to interact with the API methods - related to certificates in the Azure Key Vault API from a JavaScript application. - Once initialized, it provides a basic set of methods that can be used to - create, read, update and delete certificates. -- A **Certificate version** is a version of a certificate in the Key Vault. - Each time a user assigns a value to a unique certificate name, a new **version** - of that certificate is created. Retrieving a certificate by a name will always return - the latest value assigned, unless a specific version is provided to the - query. -- **Soft delete** allows Key Vaults to support deletion and purging as two - separate steps, so deleted certificates are not immediately lost. This only happens if the Key Vault - has [soft-delete](/azure/key-vault/key-vault-ovw-soft-delete) - enabled. -- A **Certificate backup** can be generated from any created certificate. These backups come as - binary data, and can only be used to regenerate a previously deleted certificate. - -## Specifying the Azure Key Vault service API version - -By default, this package uses the latest Azure Key Vault service version which is `7.1`. The only other version that is supported is `7.0`. You can change the service version being used by setting the option `serviceVersion` in the client constructor as shown below: - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -// Change the Azure Key Vault service API version being used via the `serviceVersion` option -const client = new CertificateClient(url, credential, { - serviceVersion: "7.0", -}); -``` - -## Examples - -The following sections provide code snippets that cover some of the common -tasks using Azure Key Vault Certificates. The scenarios that are covered here consist of: - -- [Creating and setting a certificate](#creating-and-setting-a-certificate). -- [Getting a Key Vault certificate](#getting-a-key-vault-certificate). -- [Getting the full information of a certificate](#getting-the-full-information-of-a-certificate). -- [Certificates in PEM format](#certificates-in-pem-format). -- [List all certificates](#list-all-certificates). -- [Updating a certificate](#updating-a-certificate). -- [Deleting a certificate](#deleting-a-certificate). -- [Iterating lists of certificates](#iterating-lists-of-certificates). - -### Creating and setting a certificate - -`beginCreateCertificate` creates a certificate to be stored in the Azure Key Vault. If -a certificate with the same name already exists, a new version of the -certificate is created. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; - -async function main() { - // Note: Sending `Self` as the `issuerName` of the certificate's policy will create a self-signed certificate. - await client.beginCreateCertificate(certificateName, { - issuerName: "Self", - subject: "cn=MyCert", - }); -} - -main(); -``` - -Besides the name of the certificate and the policy, you can also pass the following properties in a third argument with optional values: - -- `enabled`: A boolean value that determines whether the certificate can be used or not. -- `tags`: Any set of key-values that can be used to search and filter certificates. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; - -// Note: Sending `Self` as the `issuerName` of the certificate's policy will create a self-signed certificate. -const certificatePolicy = { - issuerName: "Self", - subject: "cn=MyCert", -}; -const enabled = true; -const tags = { - myCustomTag: "myCustomTagsValue", -}; - -async function main() { - await client.beginCreateCertificate(certificateName, certificatePolicy, { - enabled, - tags, - }); -} - -main(); -``` - -Calling to `beginCreateCertificate` with the same name will create a new version of -the same certificate, which will have the latest provided attributes. - -Since Certificates take some time to get fully created, `beginCreateCertificate` -returns a poller object that keeps track of the underlying Long Running -Operation according to our guidelines: -https://azure.github.io/azure-sdk/typescript_design.html#ts-lro - -The received poller will allow you to get the created certificate by calling to `poller.getResult()`. -You can also wait until the deletion finishes, either by running individual service -calls until the certificate is created, or by waiting until the process is done: - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; -const certificatePolicy = { - issuerName: "Self", - subject: "cn=MyCert", -}; - -async function main() { - const poller = await client.beginCreateCertificate(certificateName, certificatePolicy); - - // You can use the pending certificate immediately: - const pendingCertificate = poller.getResult(); - - // Or you can wait until the certificate finishes being signed: - const keyVaultCertificate = await poller.pollUntilDone(); - console.log(keyVaultCertificate); -} - -main(); -``` - -Another way to wait until the certificate is signed is to do individual calls, as follows: - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); -const { delay } = require("@azure/core-http"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; -const certificatePolicy = { - issuerName: "Self", - subject: "cn=MyCert", -}; - -async function main() { - const poller = await client.beginCreateCertificate(certificateName, certificatePolicy); - - while (!poller.isDone()) { - await poller.poll(); - await delay(5000); - } - - console.log(`The certificate ${certificateName} is fully created`); -} - -main(); -``` - -### Getting a Key Vault certificate - -The simplest way to read certificates back from the vault is to get a -certificate by name. `getCertificate` will retrieve the most recent -version of the certificate, along with the certificate's policy. You can -optionally get a different version of the certificate by calling -`getCertificateVersion` if you specify the version. `getCertificateVersion` does not return -the certificate's policy. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; - -async function main() { - const latestCertificate = await client.getCertificate(certificateName); - console.log(`Latest version of the certificate ${certificateName}: `, latestCertificate); - const specificCertificate = await client.getCertificateVersion( - certificateName, - latestCertificate.properties.version - ); - console.log( - `The certificate ${certificateName} at the version ${latestCertificate.properties.version}: `, - specificCertificate - ); -} - -main(); -``` - -### Getting the full information of a certificate - -Azure's KeyVault's design makes sharp distinctions between Keys, -Secrets and Certificates. The Key Vault service's Certificates -features were designed making use of it's Keys and Secrets capabilities. -Let's evaluate the composition of a Key Vault Certificate: - -> When a Key Vault certificate is created, an addressable key -> and secret are also created with the same name. The Key Vault -> key allows key operations and the Key Vault secret allows retrieval -> of the certificate value as a secret. A Key Vault certificate -> also contains public x509 certificate metadata. -> _Source: [Composition of a Certificate][composition-of-a-certificate]._ - -Knowing that the private key is stored in a Key Vault Secret, -with the public certificate included, we can retrieve it -by using the [KeyVault Secrets client][keyvault-secrets-client]. - -```ts -// Using the same credential object we used before, -// and the same keyVaultUrl, -// let's create a SecretClient -import { SecretClient } from "@azure/keyvault-secrets"; - -const secretClient = new SecretClient(keyVaultUrl, credential); - -// Assuming you've already created a Key Vault certificate, -// and that certificateName contains the name of your certificate -const certificateSecret = await secretClient.getSecret(certificateName); - -// Here we can find both the private key and the public certificate, in PKCS 12 format: -const PKCS12Certificate = certificateSecret.value!; - -// You can write this into a file: -fs.writeFileSync("myCertificate.p12", PKCS12Certificate); -``` - -Note that, by default, the content type of the certificates -is [PKCS 12][pkcs_12]. By specifying the content type -of your certificate, you'll be able to retrieve it in PEM format. -Before showing how to create PEM certificates, -let's first explore how to retrieve a PEM secret key -from a PKCS 12 certificate first. - -Using `openssl`, you can retrieve the public certificate in -PEM format by using the following command: - -``` -openssl pkcs12 -in myCertificate.p12 -out myCertificate.crt.pem -clcerts -nokeys -``` - -You can also use `openssl` to retrieve the private key, as follows: - -``` -openssl pkcs12 -in myCertificate.p12 -out myCertificate.key.pem -nocerts -nodes -``` - -Note that in both cases, openssl will ask you for the -password used to create the certificate. The sample code we've used -so far hasn't specified a password, so you can append `-passin 'pass:'` -to the end of each command. - -### Certificates in PEM format - -If you want to work with certificates in PEM format, -you can tell Azure's Key Vault service to create and manage your -certificates in PEM format by providing the `contentType` property -at the moment of creating the certificates. - -The following example shows how to create and retrieve -the public and the private parts of a PEM formatted certificate -using the Key Vault clients for Certificates and Secrets: - -```ts -// Creating the certificate -const certificateName = "MyCertificate"; -const createPoller = await client.beginCreateCertificate(certificateName, { - issuerName: "Self", - subject: "cn=MyCert", - contentType: "application/x-pem-file", // Here you specify you want to work with PEM certificates. -}); -const keyVaultCertificate = await createPoller.pollUntilDone(); - -// Getting the PEM formatted private key and public certificate: -const certificateSecret = await secretClient.getSecret(certificateName); -const PEMPair = certificateSecret.value!; - -console.log(PEMPair); -``` - -Keep in mind that your public certificate will -be in the same blob of content as your private key. -You can use the PEM headers to extract them accordingly. - -### List all certificates - -`listPropertiesOfCertificates` will list all certificates in the Key Vault. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -async function main() { - for await (let certificateProperties of client.listPropertiesOfCertificates()) { - console.log("Certificate properties: ", certificateProperties); - } -} - -main(); -``` - -### Updating a certificate - -The certificate attributes can be updated to an existing certificate version with -`updateCertificate`, as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; - -async function main() { - const result = await client.getCertificate(certificateName); - await client.updateCertificateProperties(certificateName, result.properties.version, { - enabled: false, - tags: { - myCustomTag: "myCustomTagsValue", - }, - }); -} - -main(); -``` - -The certificate's policy can also be updated individually with `updateCertificatePolicy`, as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; - -async function main() { - const result = client.getCertificate(certificateName); - // Note: Sending `Self` as the `issuerName` of the certificate's policy will create a self-signed certificate. - await client.updateCertificatePolicy(certificateName, { - issuerName: "Self", - subject: "cn=MyCert", - }); -} - -main(); -``` - -### Deleting a certificate - -The `beginDeleteCertificate` method sets a certificate up for deletion. This process will -happen in the background as soon as the necessary resources are available. - -If [soft-delete](/azure/key-vault/key-vault-ovw-soft-delete) -is enabled for the Key Vault, this operation will only label the certificate as a -_deleted_ certificate. A deleted certificate can't be updated. They can only be either -read, recovered or purged. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; - -async function main() { - const poller = await client.beginDeleteCertificate(certificateName); - - // You can use the deleted certificate immediately: - const deletedCertificate = poller.getResult(); - - // The certificate is being deleted. Only wait for it if you want to restore it or purge it. - await poller.pollUntilDone(); - - // You can also get the deleted certificate this way: - await client.getDeletedCertificate(certificateName); - - // Deleted certificates can also be recovered or purged. - - // recoverDeletedCertificate returns a poller, just like beginDeleteCertificate. - // const recoverPoller = await client.beginRecoverDeletedCertificate(certificateName); - // await recoverPoller.pollUntilDone(); - - // If a certificate is done and the Key Vault has soft-delete enabled, the certificate can be purged with: - await client.purgeDeletedCertificate(certificateName); -} - -main(); -``` - -Since the deletion of a certificate won't happen instantly, some time is needed -after the `beginDeleteCertificate` method is called before the deleted certificate is -available to be read, recovered or purged. - -### Iterating lists of certificates - -Using the CertificateClient, you can retrieve and iterate through all of the -certificates in a Certificate Vault, as well as through all of the deleted certificates and the -versions of a specific certificate. The following API methods are available: - -- `listPropertiesOfCertificates` will list all of your non-deleted certificates by their names, only - at their latest versions. -- `listDeletedCertificates` will list all of your deleted certificates by their names, - only at their latest versions. -- `listPropertiesOfCertificateVersions` will list all the versions of a certificate based on a certificate - name. - -Which can be used as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; - -async function main() { - for await (let certificateProperties of client.listPropertiesOfCertificates()) { - console.log("Certificate properties: ", certificateProperties); - } - for await (let deletedCertificate of client.listDeletedCertificates()) { - console.log("Deleted certificate: ", deletedCertificate); - } - for await (let certificateProperties of client.listPropertiesOfCertificateVersions( - certificateName - )) { - console.log("Certificate properties: ", certificateProperties); - } -} - -main(); -``` - -All of these methods will return **all of the available results** at once. To -retrieve them by pages, add `.byPage()` right after invoking the API method you -want to use, as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { CertificateClient } = require("@azure/keyvault-certificates"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new CertificateClient(url, credential); - -const certificateName = "MyCertificateName"; - -async function main() { - for await (let page of client.listPropertiesOfCertificates().byPage()) { - for (let certificateProperties of page) { - console.log("Certificate properties: ", certificateProperties); - } - } - for await (let page of client.listDeletedCertificates().byPage()) { - for (let deletedCertificate of page) { - console.log("Deleted certificate: ", deletedCertificate); - } - } - for await (let page of client.listPropertiesOfCertificateVersions(certificateName).byPage()) { - for (let certificateProperties of page) { - console.log("Properties of certificate: ", certificateProperties); - } - } -} - -main(); -``` - -## Troubleshooting - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -See our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-certificates_4.5.0-beta.1/sdk/keyvault/keyvault-certificates/TROUBLESHOOTING.md) for details on how to diagnose various failure scenarios. - -## Next steps - -You can find more code samples through the following links: - -- [KeyVault Certificates Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-certificates_4.5.0-beta.1/sdk/keyvault/keyvault-certificates/samples/v4/javascript) -- [KeyVault Certificates Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-certificates_4.5.0-beta.1/sdk/keyvault/keyvault-certificates/samples/v4/typescript) -- [KeyVault Certificates Test Cases](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-certificates_4.5.0-beta.1/sdk/keyvault/keyvault-certificates/test/) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-certificates_4.5.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fkeyvault%2Fkeyvault-certificates%2FREADME.png) - diff --git a/docs-ref-services/preview/keyvault-common-readme.md b/docs-ref-services/preview/keyvault-common-readme.md deleted file mode 100644 index c1588f5658e5..000000000000 --- a/docs-ref-services/preview/keyvault-common-readme.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: Azure Key Vault Common client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/keyvault-common, keyvault -author: timovv -ms.author: timov -ms.date: 11/09/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: keyvault ---- -# Azure Key Vault Common client library for JavaScript - version 1.0.0-beta.1 - - -An internal support library for the various Azure Key Vault client libraries. - -This package contains common code that needs to be shared among the other Azure Key Vault libraries. **It is not meant for usage by any other consumers**. - -## Key Vault client libraries - -The following client libraries use this package: - -- [@azure/keyvault-admin](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-common_1.0.0-beta.1/sdk/keyvault/keyvault-admin/README.md) -- [@azure/keyvault-certificates](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-common_1.0.0-beta.1/sdk/keyvault/keyvault-certificates/README.md) -- [@azure/keyvault-keys](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-common_1.0.0-beta.1/sdk/keyvault/keyvault-keys/README.md) -- [@azure/keyvault-secrets](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-common_1.0.0-beta.1/sdk/keyvault/keyvault-secrets/README.md) - -## Getting started - -For information on getting started, please see our [Key Vault client libraries](#key-vault-client-libraries). - -## Key concepts - -For information on key concepts, please see our [Key Vault client libraries](#key-vault-client-libraries). - -## Examples - -For examples, please see our [Key Vault client libraries](#key-vault-client-libraries). - -## Next steps - -For information on next steps, please see our [Key Vault client libraries](#key-vault-client-libraries). - -## Troubleshooting - -If you run into issues while using this library, directly or indirectly, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new). - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-common_1.0.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fkeyvault%2Fkeyvault-common%2FREADME.png) - diff --git a/docs-ref-services/preview/keyvault-keys-readme.md b/docs-ref-services/preview/keyvault-keys-readme.md deleted file mode 100644 index 4782cd28fe0a..000000000000 --- a/docs-ref-services/preview/keyvault-keys-readme.md +++ /dev/null @@ -1,864 +0,0 @@ ---- -title: Azure Key Vault Key client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/keyvault-keys, keyvault -author: timovv -ms.author: timov -ms.date: 11/10/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: keyvault ---- -# Azure Key Vault Key client library for JavaScript - version 4.7.0-beta.1 - - -Azure Key Vault is a service that allows you to encrypt authentication keys, storage account keys, data encryption keys, .pfx files, and passwords by using secured keys. -If you would like to know more about Azure Key Vault, you may want to review: [What is Azure Key Vault?][keyvault] - -Azure Key Vault Managed HSM is a fully-managed, highly-available, single-tenant, standards-compliant cloud service that enables you to safeguard cryptographic keys for your cloud applications using FIPS 140-2 Level 3 validated HSMs. If you would like to know more about Azure Key Vault Managed HSM, you may want to review: [What is Azure Key Vault Managed HSM?][managedhsm] - -The Azure Key Vault key library client supports RSA keys, Elliptic Curve (EC) keys, as well as Symmetric (oct) keys when running against a managed HSM, each with corresponding support in hardware security modules (HSM). It offers operations to create, retrieve, update, delete, purge, backup, restore, and list the keys and its versions. - -Use the client library for Azure Key Vault Keys in your Node.js application to: - -- Create keys using elliptic curve or RSA encryption, optionally backed by Hardware Security Modules (HSM). -- Import, Delete, and Update keys. -- Get one or more keys and deleted keys, with their attributes. -- Recover a deleted key and restore a backed up key. -- Get the versions of a key. - -Using the cryptography client available in this library you also have access to: - -- Encrypting -- Decrypting -- Signing -- Verifying -- Wrapping keys -- Unwrapping keys - -> Note: This package cannot be used in the browser due to Azure Key Vault service limitations, please refer to [this document][cors] for guidance. - -Key links: - -- [Source code][package-gh] -- [Package (npm)][package-npm] -- [API Reference Documentation][docs] -- [Product documentation][docs-service] -- [Samples][samples] - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- An existing [Azure Key Vault][azure_keyvault]. If you need to create a key vault, you can do so in the Azure Portal by following the steps in [this document][azure_keyvault_portal]. Alternatively, use the Azure CLI by following [these steps][azure_keyvault_cli]. -- If using Managed HSM, an existing [Azure Key Vault Managed HSM][azure_keyvault_mhsm]. If you need to create a Managed HSM, you can do so using the Azure CLI by following the steps in [this document][azure_keyvault_mhsm_cli]. - -### Install the package - -Install the Azure Key Vault Key client library using npm - -`npm install @azure/keyvault-keys` - -### Install the identity library - -Azure Key Vault clients authenticate using the Azure identity library. Install it as well using npm - -`npm install @azure/identity` - -### Configure TypeScript - -TypeScript users need to have Node type definitions installed: - -```bash -npm install @types/node -``` - -You also need to enable `compilerOptions.allowSyntheticDefaultImports` in your tsconfig.json. Note that if you have enabled `compilerOptions.esModuleInterop`, `allowSyntheticDefaultImports` is enabled by default. See [TypeScript's compiler options handbook][tscompileroptions] for more information. - -## Key concepts - -- The **Key client** is the primary interface to interact with the API methods - related to keys in the Azure Key Vault API from a JavaScript application. - Once initialized, it provides a basic set of methods that can be used to - create, read, update and delete keys. -- A **Key version** is a version of a key in the Key Vault. - Each time a user assigns a value to a unique key name, a new **version** - of that key is created. Retrieving a key by a name will always return - the latest value assigned, unless a specific version is provided to the - query. -- **Soft delete** allows Key Vaults to support deletion and purging as two - separate steps, so deleted keys are not immediately lost. This only happens if the Key Vault - has [soft-delete][softdelete] - enabled. -- A **Key backup** can be generated from any created key. These backups come as - binary data, and can only be used to regenerate a previously deleted key. -- The **Cryptography client** is a separate interface that interacts with the - keys API methods in the Key Vault API. This client focuses only in the - cryptography operations that can be executed using a key that has been - already created in the Key Vault. More about this client in the - [Cryptography](#cryptography) section. - -## Authenticating with Azure Active Directory - -The Key Vault service relies on Azure Active Directory to authenticate requests to its APIs. The [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) package provides a variety of credential types that your application can use to do this. The [README for `@azure/identity`](https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-keys_4.7.0-beta.1/sdk/identity/identity/README.md) provides more details and samples to get you started. - -In order to interact with the Azure Key Vault service, you will need to create an instance of the `KeyClient` class, a **vault url** and a credential object. The examples shown in this document use a credential object named [`DefaultAzureCredential`][default_azure_credential], which is appropriate for most scenarios, including local development and production environments. Additionally, we recommend using a [managed identity][managed_identity] for authentication in production environments. - -You can find more information on different ways of authenticating and their corresponding credential types in the [Azure Identity documentation][azure_identity]. - -Here's a quick example. First, import `DefaultAzureCredential` and `KeyClient`: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); -``` - -Once these are imported, we can next connect to the Key Vault service: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -// Build the URL to reach your key vault -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; // or `https://${vaultName}.managedhsm.azure.net` for managed HSM. - -// Lastly, create our keys client and connect to the service -const client = new KeyClient(url, credential); -``` - -## Specifying the Azure Key Vault service API version - -By default, this package uses the latest Azure Key Vault service version which is `7.2`. You can change the service version being used by setting the option `serviceVersion` in the client constructor as shown below: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -// Change the Azure Key Vault service API version being used via the `serviceVersion` option -const client = new KeyClient(url, credential, { - serviceVersion: "7.0", // Or 7.1 -}); -``` - -## Examples - -The following sections provide code snippets that cover some of the common -tasks using Azure Key Vault Keys. The scenarios that are covered here consist of: - -- [Creating a key](#creating-a-key). -- [Getting a key](#getting-a-key). -- [Creating and updating keys with attributes](#creating-and-updating-keys-with-attributes). -- [Deleting a key](#deleting-a-key). -- [Iterating lists of keys](#iterating-lists-of-keys). - -### Creating a key - -`createKey` creates a Key to be stored in the Azure Key Vault. If a key with the same name already exists, then a new version of the key is created. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - const result = await client.createKey(keyName, "RSA"); - console.log("result: ", result); -} - -main(); -``` - -The second parameter sent to `createKey` is the type of the key. The type of keys that are supported will depend on the SKU and whether you are using an Azure Key Vault or an Azure Managed HSM. For an up-to-date list of supported key types please refer to [About keys][aboutkeys] - -### Getting a key - -The simplest way to read keys back from the vault is to get a key by name. This -will retrieve the most recent version of the key. You can optionally get a -different version of the key if you specify it as part of the optional -parameters. - -`getKey` retrieves a key previous stores in the Key Vault. - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - const latestKey = await client.getKey(keyName); - console.log(`Latest version of the key ${keyName}: `, latestKey); - const specificKey = await client.getKey(keyName, { version: latestKey.properties.version! }); - console.log(`The key ${keyName} at the version ${latestKey.properties.version!}: `, specificKey); -} - -main(); -``` - -### Creating and updating keys with attributes - -The following attributes can also be assigned to any key in a Key Vault: - -- `tags`: Any set of key-values that can be used to search and filter keys. -- `keyOps`: An array of the operations that this key will be able to perform (`encrypt`, `decrypt`, `sign`, `verify`, `wrapKey`, `unwrapKey`). -- `enabled`: A boolean value that determines whether the key value can be read or not. -- `notBefore`: A given date after which the key value can be retrieved. -- `expires`: A given date after which the key value cannot be retrieved. - -An object with these attributes can be sent as the third parameter of -`createKey`, right after the key's name and value, as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - const result = await client.createKey(keyName, "RSA", { - enabled: false, - }); - console.log("result: ", result); -} - -main(); -``` - -This will create a new version of the same key, which will have the latest -provided attributes. - -Attributes can also be updated to an existing key version with -`updateKeyProperties`, as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - const result = await client.createKey(keyName, "RSA"); - await client.updateKeyProperties(keyName, result.properties.version, { - enabled: false, - }); -} - -main(); -``` - -### Deleting a key - -The `beginDeleteKey` method starts the deletion of a key. -This process will happen in the background as soon as the necessary resources -are available. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - const poller = await client.beginDeleteKey(keyName); - await poller.pollUntilDone(); -} - -main(); -``` - -If [soft-delete][softdelete] -is enabled for the Key Vault, this operation will only label the key as a -_deleted_ key. A deleted key can't be updated. They can only be -read, recovered or purged. - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - const poller = await client.beginDeleteKey(keyName); - - // You can use the deleted key immediately: - const deletedKey = poller.getResult(); - - // The key is being deleted. Only wait for it if you want to restore it or purge it. - await poller.pollUntilDone(); - - // You can also get the deleted key this way: - await client.getDeletedKey(keyName); - - // Deleted keys can also be recovered or purged: - - // recoverDeletedKey also returns a poller, just like beginDeleteKey. - const recoverPoller = await client.beginRecoverDeletedKey(keyName); - await recoverPoller.pollUntilDone(); - - // And here is how to purge a deleted key - await client.purgeDeletedKey(keyName); -} - -main(); -``` - -Since Keys take some time to get fully deleted, `beginDeleteKey` -returns a Poller object that keeps track of the underlying Long Running -Operation according to our guidelines: -https://azure.github.io/azure-sdk/typescript_design.html#ts-lro - -The received poller will allow you to get the deleted key by calling to `poller.getResult()`. -You can also wait until the deletion finishes either by running individual service -calls until the key is deleted, or by waiting until the process is done: - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - const poller = await client.beginDeleteKey(keyName); - - // You can use the deleted key immediately: - let deletedKey = poller.getResult(); - - // Or you can wait until the key finishes being deleted: - deletedKey = await poller.pollUntilDone(); - console.log(deletedKey); -} - -main(); -``` - -Another way to wait until the key is fully deleted is to do individual calls, as follows: - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); -const { delay } = require("@azure/core-http"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - const poller = await client.beginDeleteKey(keyName); - - while (!poller.isDone()) { - await poller.poll(); - await delay(5000); - } - - console.log(`The key ${keyName} is fully deleted`); -} - -main(); -``` - -### Configuring Automatic Key Rotation - -Using the KeyClient, you can configure automatic key rotation for a key by specifying the rotation policy. -In addition, KeyClient provides a method to rotate a key on-demand by creating a new version of the given key. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const vaultUrl = `https://.vault.azure.net`; -const client = new KeyClient(url, new DefaultAzureCredential()); - -async function main() { - const keyName = "MyKeyName"; - - // Set the key's automated rotation policy to rotate the key 30 days before expiry. - const policy = await client.updateKeyRotationPolicy(key.name, { - lifetimeActions: [ - { - action: "Rotate", - timeBeforeExpiry: "P30D", - }, - ], - // You may also specify the duration after which any newly rotated key will expire. - // In this case, any new key versions will expire after 90 days. - expiresIn: "P90D", - }); - - // You can get the current key rotation policy of a given key by calling the getKeyRotationPolicy method. - const currentPolicy = await client.getKeyRotationPolicy(key.name); - - // Finally, you can rotate a key on-demand by creating a new version of the given key. - const rotatedKey = await client.rotateKey(key.name); -} - -main(); -``` - -### Iterating lists of keys - -Using the KeyClient, you can retrieve and iterate through all of the -keys in an Azure Key Vault, as well as through all of the deleted keys and the -versions of a specific key. The following API methods are available: - -- `listPropertiesOfKeys` will list all of your non-deleted keys by their names, only - at their latest versions. -- `listDeletedKeys` will list all of your deleted keys by their names, - only at their latest versions. -- `listPropertiesOfKeyVersions` will list all the versions of a key based on a key - name. - -Which can be used as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - for await (let keyProperties of client.listPropertiesOfKeys()) { - console.log("Key properties: ", keyProperties); - } - for await (let deletedKey of client.listDeletedKeys()) { - console.log("Deleted: ", deletedKey); - } - for await (let versionProperties of client.listPropertiesOfKeyVersions(keyName)) { - console.log("Version properties: ", versionProperties); - } -} - -main(); -``` - -All of these methods will return **all of the available results** at once. To -retrieve them by pages, add `.byPage()` right after invoking the API method you -want to use, as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { KeyClient } = require("@azure/keyvault-keys"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new KeyClient(url, credential); - -const keyName = "MyKeyName"; - -async function main() { - for await (let page of client.listPropertiesOfKeys().byPage()) { - for (let keyProperties of page) { - console.log("Key properties: ", keyProperties); - } - } - for await (let page of client.listDeletedKeys().byPage()) { - for (let deletedKey of page) { - console.log("Deleted key: ", deletedKey); - } - } - for await (let page of client.listPropertiesOfKeyVersions(keyName).byPage()) { - for (let versionProperties of page) { - console.log("Version: ", versionProperties); - } - } -} -``` - -## Cryptography - -This library also offers a set of cryptographic utilities available through -`CryptographyClient`. Similar to the `KeyClient`, `CryptographyClient` will -connect to Azure Key Vault with the provided set of credentials. Once -connected, `CryptographyClient` can encrypt, decrypt, sign, verify, wrap keys, -and unwrap keys. - -We can next connect to the key vault service just as we do with the `KeyClient`. -We'll need to copy some settings from the key vault we are -connecting to into our environment variables. Once they are in our environment, -we can access them with the following code: - -```typescript -import { DefaultAzureCredential } from "@azure/identity"; -import { KeyClient, CryptographyClient } from "@azure/keyvault-keys"; - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const keysClient = new KeyClient(url, credential); - -async function main() { - // Create or retrieve a key from the keyvault - let myKey = await keysClient.createKey("MyKey", "RSA"); - - // Lastly, create our cryptography client and connect to the service - const cryptographyClient = new CryptographyClient(myKey, credential); -} -``` - -### Encrypt - -`encrypt` will encrypt a message. - -```javascript -import { DefaultAzureCredential } from "@azure/identity"; -import { KeyClient, CryptographyClient } from "@azure/keyvault-keys"; - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const keysClient = new KeyClient(url, credential); - -async function main() { - let myKey = await keysClient.createKey("MyKey", "RSA"); - const cryptographyClient = new CryptographyClient(myKey.id, credential); - - const encryptResult = await cryptographyClient.encrypt({ - algorithm: "RSA1_5", - plaintext: Buffer.from("My Message"), - }); - console.log("encrypt result: ", encryptResult.result); -} - -main(); -``` - -### Decrypt - -`decrypt` will decrypt an encrypted message. - -```javascript -import { DefaultAzureCredential } from "@azure/identity"; -import { KeyClient, CryptographyClient } from "@azure/keyvault-keys"; - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const keysClient = new KeyClient(url, credential); - -async function main() { - let myKey = await keysClient.createKey("MyKey", "RSA"); - const cryptographyClient = new CryptographyClient(myKey.id, credential); - - const encryptResult = await cryptographyClient.encrypt({ - algorithm: "RSA1_5", - plaintext: Buffer.from("My Message"), - }); - console.log("encrypt result: ", encryptResult.result); - - const decryptResult = await cryptographyClient.decrypt({ - algorithm: "RSA1_5", - ciphertext: encryptResult.result, - }); - console.log("decrypt result: ", decryptResult.result.toString()); -} - -main(); -``` - -### Sign - -`sign` will cryptographically sign the digest (hash) of a message with a signature. - -```javascript -import { DefaultAzureCredential } from "@azure/identity"; -import { KeyClient, CryptographyClient } from "@azure/keyvault-keys"; -import { createHash } from "crypto"; - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const keysClient = new KeyClient(url, credential); - -async function main() { - let myKey = await keysClient.createKey("MyKey", "RSA"); - const cryptographyClient = new CryptographyClient(myKey, credential); - - const signatureValue = "MySignature"; - let hash = createHash("sha256"); - - let digest = hash.update(signatureValue).digest(); - console.log("digest: ", digest); - - const signResult = await cryptographyClient.sign("RS256", digest); - console.log("sign result: ", signResult.result); -} - -main(); -``` - -### Sign Data - -`signData` will cryptographically sign a message with a signature. - -```javascript -import { DefaultAzureCredential } from "@azure/identity"; -import { KeyClient, CryptographyClient } from "@azure/keyvault-keys"; - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const keysClient = new KeyClient(url, credential); - -async function main() { - let myKey = await keysClient.createKey("MyKey", "RSA"); - const cryptographyClient = new CryptographyClient(myKey, credential); - - const signResult = await cryptographyClient.signData("RS256", Buffer.from("My Message")); - console.log("sign result: ", signResult.result); -} - -main(); -``` - -### Verify - -`verify` will cryptographically verify that the signed digest was signed with the given signature. - -```javascript -import { DefaultAzureCredential } from "@azure/identity"; -import { KeyClient, CryptographyClient } from "@azure/keyvault-keys"; -import { createHash } from "crypto"; - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const keysClient = new KeyClient(url, credential); - -async function main() { - let myKey = await keysClient.createKey("MyKey", "RSA"); - const cryptographyClient = new CryptographyClient(myKey, credential); - - const hash = createHash("sha256"); - hash.update("My Message"); - const digest = hash.digest(); - - const signResult = await cryptographyClient.sign("RS256", digest); - console.log("sign result: ", signResult.result); - - const verifyResult = await cryptographyClient.verify("RS256", digest, signResult.result); - console.log("verify result: ", verifyResult.result); -} - -main(); -``` - -### Verify Data - -`verifyData` will cryptographically verify that the signed message was signed with the given signature. - -```javascript -import { DefaultAzureCredential } from "@azure/identity"; -import { KeyClient, CryptographyClient } from "@azure/keyvault-keys"; - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const keysClient = new KeyClient(url, credential); - -async function main() { - let myKey = await keysClient.createKey("MyKey", "RSA"); - const cryptographyClient = new CryptographyClient(myKey, credential); - - const buffer = Buffer.from("My Message"); - - const signResult = await cryptographyClient.signData("RS256", buffer); - console.log("sign result: ", signResult.result); - - const verifyResult = await cryptographyClient.verifyData("RS256", buffer, signResult.result); - console.log("verify result: ", verifyResult.result); -} - -main(); -``` - -### Wrap Key - -`wrapKey` will wrap a key with an encryption layer. - -```javascript -import { DefaultAzureCredential } from "@azure/identity"; -import { KeyClient, CryptographyClient } from "@azure/keyvault-keys"; - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const keysClient = new KeyClient(url, credential); - -async function main() { - let myKey = await keysClient.createKey("MyKey", "RSA"); - const cryptographyClient = new CryptographyClient(myKey, credential); - - const wrapResult = await cryptographyClient.wrapKey("RSA-OAEP", Buffer.from("My Key")); - console.log("wrap result:", wrapResult.result); -} - -main(); -``` - -### Unwrap Key - -`unwrapKey` will unwrap a wrapped key. - -```javascript -import { DefaultAzureCredential } from "@azure/identity"; -import { KeyClient, CryptographyClient } from "@azure/keyvault-keys"; - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const keysClient = new KeyClient(url, credential); - -async function main() { - let myKey = await keysClient.createKey("MyKey", "RSA"); - const cryptographyClient = new CryptographyClient(myKey, credential); - - const wrapResult = await cryptographyClient.wrapKey("RSA-OAEP", Buffer.from("My Key")); - console.log("wrap result:", wrapResult.result); - - const unwrapResult = await cryptographyClient.unwrapKey("RSA-OAEP", wrapResult.result); - console.log("unwrap result: ", unwrapResult.result); -} - -main(); -``` - -## Troubleshooting - -See our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-keys_4.7.0-beta.1/sdk/keyvault/keyvault-keys/TROUBLESHOOTING.md) for details on how to diagnose various failure scenarios. - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -## Next steps - -You can find more code samples through the following links: - -- [Key Vault Keys Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-keys_4.7.0-beta.1/sdk/keyvault/keyvault-keys/samples/v4/javascript) -- [Key Vault Keys Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-keys_4.7.0-beta.1/sdk/keyvault/keyvault-keys/samples/v4/typescript) -- [Key Vault Keys Test Cases](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-keys_4.7.0-beta.1/sdk/keyvault/keyvault-keys/test/) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-keys_4.7.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -[aboutkeys]: /azure/key-vault/keys/about-keys -[keyvault]: /azure/key-vault/key-vault-overview -[managedhsm]: /azure/key-vault/managed-hsm/overview -[cors]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-keys_4.7.0-beta.1/samples/cors/ts/README.md -[package-gh]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-keys_4.7.0-beta.1/sdk/keyvault/keyvault-keys -[package-npm]: https://www.npmjs.com/package/@azure/keyvault-keys -[docs]: /javascript/api/@azure/keyvault-keys -[docs-service]: https://azure.microsoft.com/services/key-vault/ -[samples]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-keys_4.7.0-beta.1/sdk/keyvault/keyvault-keys/samples -[tscompileroptions]: https://www.typescriptlang.org/docs/handbook/compiler-options.html -[softdelete]: /azure/key-vault/key-vault-ovw-soft-delete -[azure_keyvault]: /azure/key-vault/general/overview -[azure_keyvault_cli]: /azure/key-vault/general/quick-create-cli -[azure_keyvault_portal]: /azure/key-vault/general/quick-create-portal -[azure_keyvault_mhsm]: /azure/key-vault/managed-hsm/overview -[azure_keyvault_mhsm_cli]: /azure/key-vault/managed-hsm/quick-create-cli -[default_azure_credential]: /java/api/overview/azure/identity-readme?view=azure-java-stable#defaultazurecredential -[managed_identity]: /azure/active-directory/managed-identities-azure-resources/overview -[azure_identity]: /java/api/overview/azure/identity-readme?view=azure-java-stable - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fkeyvault%2Fkeyvault-keys%2FREADME.png) - diff --git a/docs-ref-services/preview/keyvault-secrets-readme.md b/docs-ref-services/preview/keyvault-secrets-readme.md deleted file mode 100644 index 77eb5dd3e421..000000000000 --- a/docs-ref-services/preview/keyvault-secrets-readme.md +++ /dev/null @@ -1,555 +0,0 @@ ---- -title: Azure Key Vault Secret client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/keyvault-secrets, keyvault -author: timovv -ms.author: timov -ms.date: 07/08/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: keyvault ---- -# Azure Key Vault Secret client library for JavaScript - version 4.5.0-beta.1 - - -Azure Key Vault is a service that allows you to encrypt authentication keys, storage account keys, data encryption keys, .pfx files, and passwords by using secured keys. -If you would like to know more about Azure Key Vault, you may want to review: [What is Azure Key Vault?](/azure/key-vault/key-vault-overview) - -Azure Key Vault Secrets management allows you to securely store and -tightly control access to tokens, passwords, certificates, API keys, -and other secrets. - -Use the client library for Azure Key Vault Secrets in your Node.js application to: - -- Get, set and delete secrets. -- Update a secret and it's attributes. -- Backup and restore a secret. -- Get, purge or recover a deleted secret. -- Get all the versions of a secret. -- Get all secrets. -- Get all deleted secrets. - -> Note: This package cannot be used in the browser due to Azure Key Vault service limitations, please refer to [this document](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-secrets_4.5.0-beta.1/samples/cors/ts/README.md) for guidance. - -Key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-secrets_4.5.0-beta.1/sdk/keyvault/keyvault-secrets) -- [Package (npm)](https://www.npmjs.com/package/@azure/keyvault-secrets) -- [API Reference Documentation](/javascript/api/@azure/keyvault-secrets) -- [Product documentation](https://azure.microsoft.com/services/key-vault/) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/keyvault-secrets_4.5.0-beta.1/sdk/keyvault/keyvault-secrets/samples) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- A [Key Vault resource](/azure/key-vault/quick-create-portal) - -### Install the package - -Install the Azure Key Vault Secret client library using npm: - -`npm install @azure/keyvault-secrets` - -### Install the identity library - -Key Vault clients authenticate using the Azure Identity Library. Install it as well using npm - -`npm install @azure/identity` - -### Configure TypeScript - -TypeScript users need to have Node type definitions installed: - -```bash -npm install @types/node -``` - -You also need to enable `compilerOptions.allowSyntheticDefaultImports` in your tsconfig.json. Note that if you have enabled `compilerOptions.esModuleInterop`, `allowSyntheticDefaultImports` is enabled by default. See [TypeScript's compiler options handbook](https://www.typescriptlang.org/docs/handbook/compiler-options.html) for more information. - -### Configuring your Key Vault - -Use the [Azure Cloud Shell](https://shell.azure.com/bash) snippet below to create/get client secret credentials. - -- Create a service principal and configure its access to Azure resources: - ```Bash - az ad sp create-for-rbac -n --skip-assignment - ``` - Output: - ```json - { - "appId": "generated-app-ID", - "displayName": "dummy-app-name", - "name": "http://dummy-app-name", - "password": "random-password", - "tenant": "tenant-ID" - } - ``` -- Use the above returned credentials information to set **AZURE_CLIENT_ID**(appId), **AZURE_CLIENT_SECRET**(password) and **AZURE_TENANT_ID**(tenant) environment variables. The following example shows a way to do this in Bash: - - ```Bash - export AZURE_CLIENT_ID="generated-app-ID" - export AZURE_CLIENT_SECRET="random-password" - export AZURE_TENANT_ID="tenant-ID" - ``` - -- Grant the above mentioned application authorization to perform secret operations on the keyvault: - - ```Bash - az keyvault set-policy --name --spn $AZURE_CLIENT_ID --secret-permissions backup delete get list purge recover restore set - ``` - - > --secret-permissions: - > Accepted values: backup, delete, get, list, purge, recover, restore, set - - If you have enabled role-based access control (RBAC) for Key Vault instead, you can find roles like "Key Vault Secrets Officer" in our [RBAC guide](/azure/key-vault/general/rbac-guide). - -- Use the above mentioned Key Vault name to retrieve details of your Vault which also contains your Key Vault URL: - ```Bash - az keyvault show --name - ``` - -## Key concepts - -- The **Secret client** is the primary interface to interact with the API methods - related to secrets in the Azure Key Vault API from a JavaScript application. - Once initialized, it provides a basic set of methods that can be used to - create, read, update and delete secrets. -- A **Secret version** is a version of a secret in the Key Vault. - Each time a user assigns a value to a unique secret name, a new **version** - of that secret is created. Retrieving a secret by a name will always return - the latest value assigned, unless a specific version is provided to the - query. -- **Soft delete** allows Key Vaults to support deletion and purging as two - separate steps, so deleted secrets are not immediately lost. This only happens if the Key Vault - has [soft-delete](/azure/key-vault/key-vault-ovw-soft-delete) - enabled. -- A **Secret backup** can be generated from any created secret. These backups come as - binary data, and can only be used to regenerate a previously deleted secret. - -## Authenticating with Azure Active Directory - -The Key Vault service relies on Azure Active Directory to authenticate requests to its APIs. The [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) package provides a variety of credential types that your application can use to do this. The [README for `@azure/identity`](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-secrets_4.5.0-beta.1/sdk/identity/identity/README.md) provides more details and samples to get you started. - -Here's a quick example. First, import `DefaultAzureCredential` and `SecretClient`: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); -``` - -Once these are imported, we can next connect to the Key Vault service. To do this, we'll need to copy some settings from the Key Vault we are connecting to into our environment variables. Once they are in our environment, we can access them with the following code: - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -// DefaultAzureCredential expects the following three environment variables: -// * AZURE_TENANT_ID: The tenant ID in Azure Active Directory -// * AZURE_CLIENT_ID: The application (client) ID registered in the AAD tenant -// * AZURE_CLIENT_SECRET: The client secret for the registered application -const credential = new DefaultAzureCredential(); - -// Build the URL to reach your key vault -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -// Lastly, create our secrets client and connect to the service -const client = new SecretClient(url, credential); -``` - -## Specifying the Azure Key Vault service API version - -By default, this package uses the latest Azure Key Vault service version which is `7.1`. The only other version that is supported is `7.0`. You can change the service version being used by setting the option `serviceVersion` in the client constructor as shown below: - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -// Change the Azure Key Vault service API version being used via the `serviceVersion` option -const client = new SecretClient(url, credential, { - serviceVersion: "7.0", -}); -``` - -## Examples - -The following sections provide code snippets that cover some of the common -tasks using Azure Key Vault Secrets. The scenarios that are covered here consist of: - -- [Creating and setting a secret](#creating-and-setting-a-secret). -- [Getting a secret](#getting-a-secret). -- [Creating and updating secrets with attributes](#creating-and-updating-secrets-with-attributes). -- [Deleting a secret](#deleting-a-secret). -- [Iterating lists of secrets](#iterating-lists-of-secrets). - -### Creating and setting a secret - -`setSecret` assigns a provided value to the specified secret name. If a secret -with the same name already exists, then a new version of the secret is created. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - const result = await client.setSecret(secretName, "MySecretValue"); - console.log("result: ", result); -} - -main(); -``` - -### Getting a secret - -The simplest way to read secrets back from the vault is to get a secret by -name. This will retrieve the most recent version of the secret. You can -optionally get a different version of the key if you specify it as part of the -optional parameters. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - const latestSecret = await client.getSecret(secretName); - console.log(`Latest version of the secret ${secretName}: `, latestSecret); - const specificSecret = await client.getSecret(secretName, { version: latestSecret.properties.version! }); - console.log(`The secret ${secretName} at the version ${latestSecret.properties.version!}: `, specificSecret); -} - -main(); -``` - -### Creating and updating secrets with attributes - -A secret can have more information than its name and its value. They can also include -the following attributes: - -- `tags`: Any set of key-values that can be used to search and filter secrets. -- `contentType`: Any string that can be used to help the receiver of the secret understand how to use the secret value. -- `enabled`: A boolean value that determines whether the secret value can be read or not. -- `notBefore`: A given date after which the secret value can be retrieved. -- `expires`: A given date after which the secret value cannot be retrieved. - -An object with these attributes can be sent as the third parameter of -`setSecret`, right after the secret's name and value, as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - const result = await client.setSecret(secretName, "MySecretValue", { - enabled: false, - }); -} - -main(); -``` - -This will create a new version of the same secret, which will have the latest -provided attributes. - -Attributes can also be updated to an existing secret version with -`updateSecretProperties`, as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - const result = await client.getSecret(secretName); - await client.updateSecretProperties(secretName, result.properties.version, { enabled: false }); -} - -main(); -``` - -### Deleting a secret - -The `beginDeleteSecret` method starts the deletion of a Secret. -This process will happen in the background as soon as the necessary resources -are available. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - await client.beginDeleteSecret(secretName); -} - -main(); -``` - -If [soft-delete](/azure/key-vault/key-vault-ovw-soft-delete) -is enabled for the Key Vault, this operation will only label the secret as a -_deleted_ secret. A deleted secret can't be updated. They can only be either -read, recovered or purged. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - const poller = await client.beginDeleteSecret(secretName); - - // You can use the deleted secret immediately: - const deletedSecret = poller.getResult(); - - // The secret is being deleted. Only wait for it if you want to restore it or purge it. - await poller.pollUntilDone(); - - // You can also get the deleted secret this way: - await client.getDeletedSecret(secretName); - - // Deleted secrets can also be recovered or purged. - - // recoverDeletedSecret returns a poller, just like beginDeleteSecret. - const recoverPoller = await client.beginRecoverDeletedSecret(secretName); - await recoverPoller.pollUntilDone(); - - // And then, to purge the deleted secret: - await client.purgeDeletedSecret(secretName); -} - -main(); -``` - -Since Secrets take some time to get fully deleted, `beginDeleteSecret` -returns a Poller object that keeps track of the underlying Long Running -Operation according to our guidelines: -https://azure.github.io/azure-sdk/typescript_design.html#ts-lro - -The received poller will allow you to get the deleted secret by calling to `poller.getResult()`. -You can also wait until the deletion finishes, either by running individual service -calls until the secret is deleted, or by waiting until the process is done: - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - const poller = await client.beginDeleteSecret(secretName); - - // You can use the deleted secret immediately: - let deletedSecret = poller.getResult(); - - // Or you can wait until the secret finishes being deleted: - deletedSecret = await poller.pollUntilDone(); - console.log(deletedSecret); -} - -main(); -``` - -Another way to wait until the secret is fully deleted is to do individual calls, as follows: - -```typescript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); -const { delay } = require("@azure/core-http"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - const poller = await client.beginDeleteSecret(secretName); - - while (!poller.isDone()) { - await poller.poll(); - await delay(5000); - } - - console.log(`The secret ${secretName} is fully deleted`); -} - -main(); -``` - -### Iterating lists of secrets - -Using the SecretClient, you can retrieve and iterate through all of the -secrets in a Key Vault, as well as through all of the deleted secrets and the -versions of a specific secret. The following API methods are available: - -- `listPropertiesOfSecrets` will list all of your non-deleted secrets by their names, only - at their latest versions. -- `listDeletedSecrets` will list all of your deleted secrets by their names, - only at their latest versions. -- `listPropertiesOfSecretVersions` will list all the versions of a secret based on a secret - name. - -Which can be used as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - for await (let secretProperties of client.listPropertiesOfSecrets()) { - console.log("Secret properties: ", secretProperties); - } - for await (let deletedSecret of client.listDeletedSecrets()) { - console.log("Deleted secret: ", deletedSecret); - } - for await (let versionProperties of client.listPropertiesOfSecretVersions(secretName)) { - console.log("Version properties: ", versionProperties); - } -} - -main(); -``` - -All of these methods will return **all of the available results** at once. To -retrieve them by pages, add `.byPage()` right after invoking the API method you -want to use, as follows: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { SecretClient } = require("@azure/keyvault-secrets"); - -const credential = new DefaultAzureCredential(); - -const vaultName = ""; -const url = `https://${vaultName}.vault.azure.net`; - -const client = new SecretClient(url, credential); - -const secretName = "MySecretName"; - -async function main() { - for await (let page of client.listPropertiesOfSecrets().byPage()) { - for (let secretProperties of page) { - console.log("Secret properties: ", secretProperties); - } - } - for await (let page of client.listDeletedSecrets().byPage()) { - for (let deletedSecret of page) { - console.log("Deleted secret: ", deletedSecret); - } - } - for await (let page of client.listPropertiesOfSecretVersions(secretName).byPage()) { - for (let versionProperties of page) { - console.log("Version properties: ", versionProperties); - } - } -} - -main(); -``` - -## Troubleshooting - -See our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-secrets_4.5.0-beta.1/sdk/keyvault/keyvault-secrets/TROUBLESHOOTING.md) for details on how to diagnose various failure scenarios. - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -## Next steps - -You can find more code samples through the following links: - -- [KeyVault Secrets Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-secrets_4.5.0-beta.1/sdk/keyvault/keyvault-secrets/samples/v4/javascript) -- [KeyVault Secrets Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-secrets_4.5.0-beta.1/sdk/keyvault/keyvault-secrets/samples/v4/typescript) -- [KeyVault Secrets Test Cases](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-secrets_4.5.0-beta.1/sdk/keyvault/keyvault-secrets/test/) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/keyvault-secrets_4.5.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fkeyvault%2Fkeyvault-secrets%2FREADME.png) - diff --git a/docs-ref-services/preview/load-testing-rest-readme.md b/docs-ref-services/preview/load-testing-rest-readme.md deleted file mode 100644 index ee178f11198b..000000000000 --- a/docs-ref-services/preview/load-testing-rest-readme.md +++ /dev/null @@ -1,307 +0,0 @@ ---- -title: Azure Load Testing client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure-rest/load-testing, azure-load-testing -author: xirzec -ms.author: jeffish -ms.date: 01/26/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: azure-load-testing ---- -# Azure Load Testing client library for JavaScript - version 1.0.0-beta.2 - - -Azure Load Testing provides client library in JavaScript to the user by which they can interact natively with Azure Load Testing service. Azure Load Testing is a fully managed load-testing service that enables you to generate high-scale load. The service simulates traffic for your applications, regardless of where they're hosted. Developers, testers, and quality assurance (QA) engineers can use it to optimize application performance, scalability, or capacity. - -**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/@azure-rest/load-testing_1.0.0-beta.2/documentation/rest-clients.md) to use this library** - -## Documentation - -Various documentation is available to help you get started - -- [Source code][source_code] -- [API reference documentation][api_reference_doc] -- [Product Documentation][product_documentation] - -## Getting started - -### Currently supported environments - -- Node.js version 14.x.x or higher - -### Prerequisites - -- You must have an [Azure subscription](https://azure.microsoft.com/free/) and [Azure Load Test Service Resource](https://learn.microsoft.com/azure/load-testing/) to use this package. - -### Install the `@azure-rest/load-testing` package - -Install the AzureLoadTesting client REST client library for JavaScript with `npm`: - -```bash -npm install @azure-rest/load-testing -``` - -### Create and authenticate a `AzureLoadTesting` client - -To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/@azure-rest/load-testing_1.0.0-beta.2/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token), -provide an instance of the desired credential type obtained from the -[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/load-testing_1.0.0-beta.2/sdk/identity/identity#credentials) library. - -To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) - -After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/load-testing_1.0.0-beta.2/sdk/identity/identity#credentials) from `@azure/identity` to use. -As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/load-testing_1.0.0-beta.2/sdk/identity/identity#defaultazurecredential) -can be used to authenticate the client. - -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 - -```javascript -import AzureLoadTesting, { AzureLoadTestingClient } from "@azure-rest/load-testing"; -import { DefaultAzureCredential } from "@azure/identity"; - -const Client: AzureLoadTestingClient = AzureLoadTesting(Endpoint, new DefaultAzureCredential()); -``` - -## Key concepts - -The following components make up the Azure Load Testing Service. The Azure Load Test client library for JavaScript allows you to interact with each of these components through the use of a dedicated client object. - -#### Test - -A test specifies the test script, and configuration settings for running a load test. You can create one or more tests in an Azure Load Testing resource. - -#### App Component - -When you run a load test for an Azure-hosted application, you can monitor resource metrics for the different Azure application components (server-side metrics). While the load test runs, and after completion of the test, you can monitor and analyze the resource metrics in the Azure Load Testing dashboard. - -#### Metrics - -During a load test, Azure Load Testing collects metrics about the test execution. There are two types of metrics: - -1. Client-side metrics give you details reported by the test engine. These metrics include the number of virtual users, the request response time, the number of failed requests, or the number of requests per second. - -2. Server-side metrics are available for Azure-hosted applications and provide information about your Azure application components. Metrics can be for the number of database reads, the type of HTTP responses, or container resource consumption. - -### Test Engine - -A test engine is computing infrastructure that runs the Apache JMeter test script. You can scale out your load test by configuring the number of test engines. The test script runs in parallel across the specified number of test engines. - -### Test Run - -A test run represents one execution of a load test. It collects the logs associated with running the Apache JMeter script, the load test YAML configuration, the list of app components to monitor, and the results of the test. - -### Data-Plane Endpoint - -Data-plane of Azure Load Testing resources is addressable using the following URL format: - -`00000000-0000-0000-0000-000000000000.aaa.cnt-prod.loadtesting.azure.com` - -The first GUID `00000000-0000-0000-0000-000000000000` is the unique identifier used for accessing the Azure Load Testing resource. This is followed by `aaa` which is the Azure region of the resource. - -The data-plane endpoint is obtained from Control Plane APIs. - -**Example:** `1234abcd-12ab-12ab-12ab-123456abcdef.eus.cnt-prod.loadtesting.azure.com` - -In the above example, `eus` represents the Azure region `East US`. - -## Examples - -### Creating a load test - -```javascript -import { AzureLoadTestingClient } from "@azure-rest/load-testing"; -import { DefaultAzureCredential } from "@azure/identity"; - -var TEST_ID = "some-test-id"; -var DISPLAY_NAME = "my-load-test"; - -const client: AzureLoadTestingClient = AzureLoadTesting(Endpoint, new DefaultAzureCredential()); - -await client.path("/tests/{testId}", TEST_ID).patch({ - contentType: "application/merge-patch+json", - body: { - displayName: DISPLAY_NAME, - description: "", - loadTestConfiguration: { - engineInstances: 1, - splitAllCSVs: false, - }, - secrets: {}, - environmentVariables: {}, - passFailCriteria: { passFailMetrics: {} }, - }, -}); -``` - -### Uploading .jmx file to a Test - -```javascript -import { AzureLoadTestingClient, getLongRunningPoller } from "@azure-rest/load-testing"; -import { DefaultAzureCredential } from "@azure/identity"; -import { createReadStream } from "fs"; - -const client: AzureLoadTestingClient = AzureLoadTesting(Endpoint, new DefaultAzureCredential()); - -var TEST_ID = "some-test-id"; -const readStream = createReadStream("./sample.jmx"); - -const fileUploadResult = await client - .path("/tests/{testId}/files/{fileName}", TEST_ID, "sample.jmx") - .put({ - contentType: "application/octet-stream", - body: readStream, - }); - -if (isUnexpected(fileUploadResult)) { - throw fileUploadResult.body.error; -} - -let fileValidateResult; -const fileValidatePoller = await getLongRunningPoller(client, fileUploadResult); -try{ -fileValidateResult = await fileValidatePoller.pollUntilDone({ - abortSignal: AbortController.timeout(120*1000), // timeout of 120 seconds -});} catch (ex: any) { -new Error("Error in polling file Validation" + ex.message); //polling timed out -} - -if (fileUploadPoller.getOperationState().status != "succeeded" && fileValidateResult) - throw new Error( - "There is some issue in validation, please make sure uploaded file is a valid JMX." + - fileValidateResult.body.validationFailureDetails - ); -``` - -### Running a Test and fetching Metrics - -```javascript -import { AzureLoadTestingClient, getLongRunningPoller } from "@azure-rest/load-testing"; -import { DefaultAzureCredential } from "@azure/identity"; - -const client: AzureLoadTestingClient = AzureLoadTesting(Endpoint, new DefaultAzureCredential()); - -var TEST_ID = "some-test-id"; -var DISPLAY_NAME = "my-load-test"; -var TEST_RUN_ID = "some-test-run-id"; - -// Creating/Updating the test run -const testRunCreationResult = await client.path("/test-runs/{testRunId}", TEST_RUN_ID).patch({ - contentType: "application/merge-patch+json", - body: { - testId: TEST_ID, - displayName: DISPLAY_NAME, - }, -}); - -if (isUnexpected(testRunCreationResult)) { - throw testRunCreationResult.body.error; -} - -if (testRunCreationResult.body.testRunId === undefined) - throw new Error("Test Run ID returned as undefined."); - -const testRunPoller = await getLongRunningPoller(client, testRunCreationResult); - let testRunResult; - - try { - testRunResult = await testRunPoller.pollUntilDone({ - abortSignal: AbortController.timeout(60000), // timeout of 60 seconds - }); - } catch (ex: any) { - new Error("Error in polling test run completion" + ex.message); //polling timed out - } - - if (testRunPoller.getOperationState().status != "succeeded") - throw new Error("There is some issue in running the test, Error Response : " + testRunResult); - - if (testRunResult) { - let testRunStarttime = testRunResult.body.startDateTime; - let testRunEndTime = testRunResult.body.endDateTime; - - // get list of all metric namespaces and pick the first one - const metricNamespaces = await client - .path("/test-runs/{testRunId}/metric-namespaces", testRunId) - .get(); - - if (isUnexpected(metricNamespaces)) { - throw metricNamespaces.body.error; - } - - const metricNamespace = metricNamespaces.body.value[0]; - - if (metricNamespace.name === undefined) { - throw "No Metric Namespace name is defined."; - } - - // get list of all metric definitions and pick the first one - const metricDefinitions = await client - .path("/test-runs/{testRunId}/metric-definitions", testRunId) - .get({ - queryParameters: { - metricNamespace: metricNamespace.name, - }, - }); - - if (isUnexpected(metricDefinitions)) { - throw metricDefinitions.body.error; - } - - const metricDefinition = metricDefinitions.body.value[0]; - - if (metricDefinition.name === undefined) { - throw "No Metric Namespace name is defined."; - } - - // fetch client metrics using metric namespace and metric name - const metricsResult = await client.path("/test-runs/{testRunId}/metrics", testRunId).post({ - queryParameters: { - metricname: metricDefinition.name, - metricNamespace: metricNamespace.name, - timespan: testRunStarttime + "/" + testRunEndTime, - }, - }); - - console.log(metricsResult); - console.log(testRunResult); -} -``` - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/load-testing_1.0.0-beta.2/sdk/core/logger). - -## Next steps - -Azure Loading Testing JavaScript SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered. - -See [Azure Load Testing samples][sample_code]. - -## Contributing - -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure-rest/load-testing_1.0.0-beta.2/CONTRIBUTING.md). - -1. Fork it -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request - - - -[source_code]: https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/load-testing_1.0.0-beta.2/sdk/loadtestservice/load-testing-rest/src -[sample_code]: https://github.com/Azure/azure-sdk-for-js/tree/@azure-rest/load-testing_1.0.0-beta.2/sdk/loadtestservice/load-testing-rest/samples/v1-beta -[api_reference_doc]: /rest/api/loadtesting/ -[product_documentation]: https://azure.microsoft.com/services/load-testing/ -[azure_subscription]: https://azure.microsoft.com/free/ - diff --git a/docs-ref-services/preview/monitor-ingestion-readme.md b/docs-ref-services/preview/monitor-ingestion-readme.md deleted file mode 100644 index 5e64fe409259..000000000000 --- a/docs-ref-services/preview/monitor-ingestion-readme.md +++ /dev/null @@ -1,270 +0,0 @@ ---- -title: -keywords: Azure, javascript, SDK, API, @azure/monitor-ingestion, monitor -author: hectorhdzg -ms.author: hectorh -ms.date: 10/13/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: monitor ---- -# Azure Monitor Ingestion client library for JS - -The Azure Monitor Ingestion client library is used to send custom logs to [Azure Monitor][azure_monitor_overview]. - -This library allows you to send data from virtually any source to supported built-in tables or to custom tables that you create in Log Analytics workspace. You can even extend the schema of built-in tables with custom columns. - -**Resources:** - -- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/@azure/monitor-ingestion_1.0.0-beta.3/sdk/monitor/monitor-ingestion/src) -- [Package (NPM)](https://www.npmjs.com/) -- [Service documentation][azure_monitor_overview] -- [Change log](https://github.com/Azure/azure-sdk-for-js/blob/@azure/monitor-ingestion_1.0.0-beta.3/sdk/monitor/monitor-ingestion/CHANGELOG.md) - -## Getting started - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free) -- A [Data Collection Endpoint](/azure/azure-monitor/essentials/data-collection-endpoint-overview) -- A [Data Collection Rule](/azure/azure-monitor/essentials/data-collection-rule-overview) -- A [Log Analytics workspace](/azure/azure-monitor/logs/log-analytics-workspace-overview) - -### Install the package - -Install the Azure Monitor Ingestion client library for JS with [npm](https://www.npmjs.com/): - -```bash -npm install @azure/monitor-ingestion -``` - -### Authenticate the client - -An authenticated client is required to ingest data. To authenticate, create an instance of a [TokenCredential](/javascript/api/@azure/core-auth/tokencredential?view=azure-node-latest) class (see [@azure/identity](https://www.npmjs.com/package/@azure/identity) for `DefaultAzureCredential` and other `TokenCredential` implementations). Pass it to the constructor of your client class. - -To authenticate, the following example uses `DefaultAzureCredential` from the [@azure/identity](https://www.npmjs.com/package/@azure/identity) package: - -```ts -import { DefaultAzureCredential } from "@azure/identity"; -import { LogsIngestionClient } from "@azure/monitor-ingestion"; - -import * as dotenv from "dotenv"; -dotenv.config(); - -const logsIngestionEndpoint = process.env.LOGS_INGESTION_ENDPOINT || "logs_ingestion_endpoint"; - -const credential = new DefaultAzureCredential(); -const logsIngestionClient = new LogsIngestionClient(logsIngestionEndpoint, credential); -``` - -## Key concepts - -### Data Collection Endpoint - -Data Collection Endpoints (DCEs) allow you to uniquely configure ingestion settings for Azure Monitor. [This -article][data_collection_endpoint] provides an overview of data collection endpoints including their contents and -structure and how you can create and work with them. - -### Data Collection Rule - -Data collection rules (DCR) define data collected by Azure Monitor and specify how and where that data should be sent or -stored. The REST API call must specify a DCR to use. A single DCE can support multiple DCRs, so you can specify a -different DCR for different sources and target tables. - -The DCR must understand the structure of the input data and the structure of the target table. If the two don't match, -it can use a transformation to convert the source data to match the target table. You may also use the transform to -filter source data and perform any other calculations or conversions. - -For more details, refer to [Data collection rules in Azure Monitor][data_collection_rule]. - -### Log Analytics workspace tables - -Custom logs can send data to any custom table that you create and to certain built-in tables in your Log Analytics -workspace. The target table must exist before you can send data to it. The following built-in tables are currently supported: - -- [CommonSecurityLog](/azure/azure-monitor/reference/tables/commonsecuritylog) -- [SecurityEvents](/azure/azure-monitor/reference/tables/securityevent) -- [Syslog](/azure/azure-monitor/reference/tables/syslog) -- [WindowsEvents](/azure/azure-monitor/reference/tables/windowsevent) - -## Examples - -- [Upload custom logs](#upload-custom-logs) -- [Verify logs](#verify-logs) - -You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/monitor/Azure.Monitor.Ingestion/samples). - -### Upload custom logs - -You can create a client and call the client's `Upload` method. Take note of the data ingestion [limits](/azure/azure-monitor/service-limits#custom-logs). - -```js -const { DefaultAzureCredential } = require("@azure/identity"); -const { LogsIngestionClient } = require("@azure/monitor-ingestion"); - -require("dotenv").config(); - -async function main() { - const logsIngestionEndpoint = process.env.LOGS_INGESTION_ENDPOINT || "logs_ingestion_endpoint"; - const ruleId = process.env.DATA_COLLECTION_RULE_ID || "data_collection_rule_id"; - const streamName = process.env.STREAM_NAME || "data_stream_name"; - const credential = new DefaultAzureCredential(); - const client = new LogsIngestionClient(logsIngestionEndpoint, credential); - const logs = [ - { - Time: "2021-12-08T23:51:14.1104269Z", - Computer: "Computer1", - AdditionalContext: "context-2", - }, - { - Time: "2021-12-08T23:51:14.1104269Z", - Computer: "Computer2", - AdditionalContext: "context", - }, - ]; - const result = await client.upload(ruleId, streamName, logs); - if (result.status !== "Success") { - console.log("Some logs have failed to complete ingestion. Upload status=", result.status); - for (const errors of result.errors) { - console.log(`Error - ${JSON.stringify(errors.cause)}`); - console.log(`Log - ${JSON.stringify(errors.failedLogs)}`); - } - } -} -main().catch((err) => { - console.error("The sample encountered an error:", err); - process.exit(1); -}); - -module.exports = { main }; -``` - -### Verify logs - -You can verify that your data has been uploaded correctly by using the [@azure/monitor-query](https://github.com/Azure/azure-sdk-for-js/blob/@azure/monitor-ingestion_1.0.0-beta.3/sdk/monitor/monitor-query/README.md#install-the-package) library. Run the [Upload custom logs](#upload-custom-logs) sample first before verifying the logs. - -```js -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -/** - * @summary Demonstrates how to run query against a Log Analytics workspace to verify if the logs were uploaded - */ - -const { DefaultAzureCredential } = require("@azure/identity"); -const { LogsQueryClient } = require("@azure/monitor-query"); - -const monitorWorkspaceId = process.env.MONITOR_WORKSPACE_ID || "workspace_id"; -const tableName = process.env.TABLE_NAME || "table_name"; -require("dotenv").config(); - -async function main() { - const credential = new DefaultAzureCredential(); - const logsQueryClient = new LogsQueryClient(credential); - const queriesBatch = [ - { - workspaceId: monitorWorkspaceId, - query: tableName + " | count;", - timespan: { duration: "P1D" }, - }, - ]; - - const result = await logsQueryClient.queryBatch(queriesBatch); - if (result[0].status === "Success") { - console.log("Table entry count: ", JSON.stringify(result[0].tables)); - } else { - console.log( - `Some error encountered while retrieving the count. Status = ${result[0].status}`, - JSON.stringify(result[0]) - ); - } -} - -main().catch((err) => { - console.error("The sample encountered an error:", err); - process.exit(1); -}); - -module.exports = { main }; -``` - -### Uploading large batches of logs - -When uploading more than 1MB of logs in a single call to the `upload` method on `LogsIngestionClient`, the upload will be split into several smaller batches, each no larger than 1MB. By default, these batches will be uploaded in parallel, with a maximum of 5 batches being uploaded concurrently. It may be desirable to decrease the maximum concurrency if memory usage is a concern. The maximum number of concurrent uploads can be controlled using the `maxConcurrency` option, as shown in this example: - -```js -const { DefaultAzureCredential } = require("@azure/identity"); -const { LogsIngestionClient } = require("@azure/monitor-ingestion"); - -require("dotenv").config(); - -async function main() { - const logsIngestionEndpoint = process.env.LOGS_INGESTION_ENDPOINT || "logs_ingestion_endpoint"; - const ruleId = process.env.DATA_COLLECTION_RULE_ID || "data_collection_rule_id"; - const streamName = process.env.STREAM_NAME || "data_stream_name"; - const credential = new DefaultAzureCredential(); - const client = new LogsIngestionClient(logsIngestionEndpoint, credential); - - // Constructing a large number of logs to ensure batching takes place - const logs = []; - for (let i = 0; i < 100000; ++i) { - logs.push({ - Time: "2021-12-08T23:51:14.1104269Z", - Computer: "Computer1", - AdditionalContext: `context-${i}`, - }); - } - - // Set the maximum concurrency to 1 to prevent concurrent requests entirely - const result = await client.upload(ruleId, streamName, logs, { maxConcurrency: 1 }); - if (result.status !== "Success") { - console.log("Some logs have failed to complete ingestion. Upload status=", result.status); - for (const error of result.errors) { - console.log(`Error - ${JSON.stringify(error.cause)}`); - console.log(`Log - ${JSON.stringify(error.failedLogs)}`); - } - } -} -main().catch((err) => { - console.error("The sample encountered an error:", err); - process.exit(1); -}); - -module.exports = { main }; -``` - -### Retrieve logs - -Logs uploaded using the Monitor Ingestion client library can be retrieved using the [Monitor Query client library][monitor_query]. - -## Troubleshooting - -### Logging - -Enabling logging may help uncover useful information about failures. To see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```ts -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -For detailed instructions on how to enable logs, see the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/monitor-ingestion_1.0.0-beta.3/sdk/core/logger). - -## Next steps - -To learn more about Azure Monitor, see the [Azure Monitor service documentation][azure_monitor_overview]. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/monitor-ingestion_1.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - - - -[azure_monitor_overview]: /azure/azure-monitor/overview -[data_collection_endpoint]: /azure/azure-monitor/essentials/data-collection-endpoint-overview -[data_collection_rule]: /azure/azure-monitor/essentials/data-collection-rule-overview -[monitor_query]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/monitor-ingestion_1.0.0-beta.3/sdk/monitor/monitor-query - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/monitor/monitor-ingestion/README.png) - diff --git a/docs-ref-services/preview/monitor-opentelemetry-readme.md b/docs-ref-services/preview/monitor-opentelemetry-readme.md deleted file mode 100644 index 6e91df262cc9..000000000000 --- a/docs-ref-services/preview/monitor-opentelemetry-readme.md +++ /dev/null @@ -1,424 +0,0 @@ ---- -title: -keywords: Azure, javascript, SDK, API, @azure/monitor-opentelemetry, monitor -author: hectorhdzg -ms.author: hectorh -ms.date: 08/30/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: monitor ---- -# Azure Monitor OpenTelemetry for JavaScript - -[![npm version](https://badge.fury.io/js/%40azure%2Fmonitor-opentelemetry.svg)](https://badge.fury.io/js/%40azure%2Fmonitor-opentelemetry) - -## Getting started - -### Install the package - -`npm install @azure/monitor-opentelemetry` - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) - -- [OpenTelemetry supported runtimes](https://github.com/open-telemetry/opentelemetry-js#supported-runtimes) - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/monitor-opentelemetry_1.0.0-beta.3/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- An [Application Insights workspace](/azure/azure-monitor/app/app-insights-overview/) - -### Enable Azure Monitor OpenTelemetry Client - -> *Important:* `useAzureMonitor` must be called *before* you import anything else. There may be resulting telemetry loss if other libraries are imported first. - - -```typescript -const { useAzureMonitor, AzureMonitorOpenTelemetryOptions } = require("@azure/monitor-opentelemetry"); - -const options: AzureMonitorOpenTelemetryOptions = { - azureMonitorExporterConfig: { - connectionString: - process.env["APPLICATIONINSIGHTS_CONNECTION_STRING"] || "", - }, -} -useAzureMonitor(options); -``` - -* Connection String could be set using the environment variable APPLICATIONINSIGHTS\_CONNECTION\_STRING - -## Configuration - - -```typescript -const { AzureMonitorOpenTelemetryClient, AzureMonitorOpenTelemetryOptions } = require("@azure/monitor-opentelemetry"); -const { Resource } = require("@opentelemetry/resources"); - -const resource = new Resource({ "testAttribute": "testValue" }); -const options: AzureMonitorOpenTelemetryOptions = { - azureMonitorExporterConfig: { - // Offline storage - storageDirectory: "c://azureMonitor", - // Automatic retries - disableOfflineStorage: false, - // Application Insights Connection String - connectionString: process.env["APPLICATIONINSIGHTS_CONNECTION_STRING"] || "", - }, - otlpTraceExporterConfig: { - enabled: true, - url: '', // url is optional and can be omitted - default is http://localhost:4318/v1/traces - }, - otlpMetricExporterConfig: { - enabled: true, - url: '', // url is optional and can be omitted - default is http://localhost:4318/v1/metrics - }, - otlpLogExporterConfig: { - enabled: true, - url: '', // url is optional and can be omitted - default is http://localhost:4318/v1/logs - }, - samplingRatio: 1, - instrumentationOptions: { - azureSdk: { enabled: true }, - http: { enabled: true }, - mongoDb: { enabled: true }, - mySql: { enabled: true }, - postgreSql: { enabled: true }, - redis: { enabled: true }, - redis4: { enabled: true }, - }, - resource: resource -}; - -useAzureMonitor(options); - -``` - - -|Property|Description|Default| -| ------------------------------- |------------------------------------------------------------------------------------------------------------|-------| -| azureMonitorExporterConfig | Azure Monitor OpenTelemetry Exporter Configuration. [More info here](https://github.com/Azure/azure-sdk-for-js/tree/@azure/monitor-opentelemetry_1.0.0-beta.3/sdk/monitor/monitor-opentelemetry-exporter) | | -| otlpTraceExporterConfig | OTLP Trace Exporter Configuration. [More info here](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-http) -| otlpMetricExporterConfig | OTLP Trace Exporter Configuration. [More info here](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-http) -| otlpLogExporterConfig | OTLP Trace Exporter Configuration. [More info here](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-logs-otlp-http) | | -| samplingRatio | Sampling ratio must take a value in the range [0,1], 1 meaning all data will sampled and 0 all Tracing data will be sampled out. | 1| -| instrumentationOptions| Allow configuration of OpenTelemetry Instrumentations. | {"http": { enabled: true },"azureSdk": { enabled: false },"mongoDb": { enabled: false },"mySql": { enabled: false },"postgreSql": { enabled: false },"redis": { enabled: false }}| -| resource | Opentelemetry Resource. [More info here](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-resources) || - -Options could be set using configuration file `applicationinsights.json` located under root folder of @azure/monitor-opentelemetry package installation folder, Ex: `node_modules/@azure/monitor-opentelemetry`. These configuration values will be applied to all AzureMonitorOpenTelemetryClient instances. - - -```json -{ - "samplingRatio": 0.8, - "enableAutoCollectStandardMetrics": false, - "instrumentationOptions":{ - "azureSdk": { - "enabled": false - } - }, - ... -} - -``` - -Custom JSON file could be provided using `APPLICATIONINSIGHTS_CONFIGURATION_FILE` environment variable. - -```javascript -process.env.APPLICATIONINSIGHTS_CONFIGURATION_FILE = "C:/applicationinsights/config/customConfig.json" - -// Application Insights SDK setup.... -``` - -## Instrumentation libraries - -The following OpenTelemetry Instrumentation libraries are included as part of Azure Monitor OpenTelemetry. - -> *Warning:* Instrumentation libraries are based on experimental OpenTelemetry specifications. Microsoft's *preview* support commitment is to ensure that the following libraries emit data to Azure Monitor Application Insights, but it's possible that breaking changes or experimental mapping will block some data elements. - -### Distributed Tracing - - - [HTTP/HTTPS](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http) - - [MongoDB](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mongodb) - - [MySQL](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mysql) - - [Postgres](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pg) - - [Redis](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis) - - [Redis-4](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis-4) - - [Azure SDK](https://github.com/Azure/azure-sdk-for-js/tree/@azure/monitor-opentelemetry_1.0.0-beta.3/sdk/instrumentation/opentelemetry-instrumentation-azure-sdk) - -### Metrics -- [HTTP/HTTPS](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http) - -Other OpenTelemetry Instrumentations are available [here](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node) and could be added using TracerProvider in AzureMonitorOpenTelemetryClient. - - ```typescript - const { useAzureMonitor } = require("@azure/monitor-opentelemetry"); - const { metrics, trace } = require("@opentelemetry/api"); - const { registerInstrumentations } = require("@opentelemetry/instrumentation"); - const { ExpressInstrumentation } = require('@opentelemetry/instrumentation-express'); - - useAzureMonitor(); - const instrumentations = [ - new ExpressInstrumentation(), - ]; - registerInstrumentations({ - tracerProvider: trace.getTracerProvider(), - meterProvider: metrics.getMeterProvider(), - instrumentations: instrumentations, - }); - -``` - - -## Set the Cloud Role Name and the Cloud Role Instance - -You might set the Cloud Role Name and the Cloud Role Instance via [OpenTelemetry Resource](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#resource-sdk) attributes. - - -```typescript -const { useAzureMonitor, AzureMonitorOpenTelemetryOptions } = require("@azure/monitor-opentelemetry"); -const { Resource } = require("@opentelemetry/resources"); -const { SemanticResourceAttributes } = require("@opentelemetry/semantic-conventions"); - -// ---------------------------------------- -// Setting role name and role instance -// ---------------------------------------- -const customResource = Resource.EMPTY; -customResource.attributes[SemanticResourceAttributes.SERVICE_NAME] = "my-helloworld-service"; -customResource.attributes[SemanticResourceAttributes.SERVICE_NAMESPACE] = "my-namespace"; -customResource.attributes[SemanticResourceAttributes.SERVICE_INSTANCE_ID] = "my-instance"; - -const options: AzureMonitorOpenTelemetryOptions = { resource : customResource } -useAzureMonitor(options); -``` - -For information on standard attributes for resources, see [Resource Semantic Conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md). - - -## Modify telemetry - -This section explains how to modify telemetry. - -### Add span attributes - -To add span attributes, use either of the following two ways: - -* Use options provided by [instrumentation libraries](#instrumentation-libraries). -* Add a custom span processor. - -These attributes might include adding a custom property to your telemetry. - -> *Tip:* The advantage of using options provided by instrumentation libraries, when they're available, is that the entire context is available. As a result, users can select to add or filter more attributes. For example, the enrich option in the HttpClient instrumentation library gives users access to the httpRequestMessage itself. They can select anything from it and store it as an attribute. - -#### Add a custom property to a Trace - -Any [attributes](#add-span-attributes) you add to spans are exported as custom properties. - -Use a custom processor: - -```typescript -const { useAzureMonitor } = require("@azure/monitor-opentelemetry"); -const { trace } = require("@opentelemetry/api"); -const { ReadableSpan, Span, SpanProcessor } = require("@opentelemetry/sdk-trace-base"); -const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node"); -const { SemanticAttributes } = require("@opentelemetry/semantic-conventions"); - -useAzureMonitor(); - -class SpanEnrichingProcessor implements SpanProcessor{ - forceFlush(): Promise{ - return Promise.resolve(); - } - shutdown(): Promise{ - return Promise.resolve(); - } - onStart(_span: Span): void{} - onEnd(span: ReadableSpan){ - span.attributes["CustomDimension1"] = "value1"; - span.attributes["CustomDimension2"] = "value2"; - span.attributes[SemanticAttributes.HTTP_CLIENT_IP] = ""; - } -} - -const tracerProvider = trace.getTracerProvider().getDelegate(); -tracerProvider.addSpanProcessor(new SpanEnrichingProcessor()); -``` - -### Filter telemetry - -You might use the following ways to filter out telemetry before it leaves your application. - -1. Exclude the URL option provided by many HTTP instrumentation libraries. - - The following example shows how to exclude a certain URL from being tracked by using the [HTTP/HTTPS instrumentation library](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http): - - ```typescript - const { useAzureMonitor, AzureMonitorOpenTelemetryOptions } = require("@azure/monitor-opentelemetry"); - const { IncomingMessage } = require("http"); - const { RequestOptions } = require("https"); - const { HttpInstrumentationConfig }= require("@opentelemetry/instrumentation-http"); - - const httpInstrumentationConfig: HttpInstrumentationConfig = { - enabled: true, - ignoreIncomingRequestHook: (request: IncomingMessage) => { - // Ignore OPTIONS incoming requests - if (request.method === 'OPTIONS') { - return true; - } - return false; - }, - ignoreOutgoingRequestHook: (options: RequestOptions) => { - // Ignore outgoing requests with /test path - if (options.path === '/test') { - return true; - } - return false; - } - }; - const options : AzureMonitorOpenTelemetryOptions = { - instrumentationOptions: { - http: httpInstrumentationConfig, - } - }; - useAzureMonitor(options); - - ``` - -1. Use a custom processor. You can use a custom span processor to exclude certain spans from being exported. To mark spans to not be exported, set `TraceFlag` to `DEFAULT`. -Use the add [custom property example](#add-a-custom-property-to-a-trace), but replace the following lines of code: - - ```typescript - ... - import { SpanKind, TraceFlags } from "@opentelemetry/api"; - - class SpanEnrichingProcessor implements SpanProcessor{ - ... - - onEnd(span: ReadableSpan) { - if(span.kind == SpanKind.INTERNAL){ - span.spanContext().traceFlags = TraceFlags.NONE; - } - } - } - ``` - -## Custom telemetry - -This section explains how to collect custom telemetry from your application. - -### Add Custom Metrics - -You may want to collect metrics beyond what is collected by [instrumentation libraries](#instrumentation-libraries). - -The OpenTelemetry API offers six metric "instruments" to cover a variety of metric scenarios and you'll need to pick the correct "Aggregation Type" when visualizing metrics in Metrics Explorer. This requirement is true when using the OpenTelemetry Metric API to send metrics and when using an instrumentation library. - - -The following table shows the recommended aggregation types] for each of the OpenTelemetry Metric Instruments. - -| OpenTelemetry Instrument | Azure Monitor Aggregation Type | -|------------------------------------------------------|------------------------------------------------------------| -| Counter | Sum | -| Asynchronous Counter | Sum | -| Histogram | Average, Sum, Count (Max, Min for Python and Node.js only) | -| Asynchronous Gauge | Average | -| UpDownCounter (Python and Node.js only) | Sum | -| Asynchronous UpDownCounter (Python and Node.js only) | Sum | - ->> *Caution:* Aggregation types beyond what's shown in the table typically aren't meaningful. - -The [OpenTelemetry Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument) -describes the instruments and provides examples of when you might use each one. - -```typescript - const { useAzureMonitor } = require("@azure/monitor-opentelemetry"); - const { metrics } = require("@opentelemetry/api"); - - useAzureMonitor(); - const meter = metrics.getMeter("testMeter"); - - let histogram = meter.createHistogram("histogram"); - let counter = meter.createCounter("counter"); - let gauge = meter.createObservableGauge("gauge"); - gauge.addCallback((observableResult: ObservableResult) => { - let randomNumber = Math.floor(Math.random() * 100); - observableResult.observe(randomNumber, {"testKey": "testValue"}); - }); - - histogram.record(1, { "testKey": "testValue" }); - histogram.record(30, { "testKey": "testValue2" }); - histogram.record(100, { "testKey2": "testValue" }); - - counter.add(1, { "testKey": "testValue" }); - counter.add(5, { "testKey2": "testValue" }); - counter.add(3, { "testKey": "testValue2" }); -``` - - -### Add Custom Exceptions - -Select instrumentation libraries automatically support exceptions to Application Insights. -However, you may want to manually report exceptions beyond what instrumention libraries report. -For instance, exceptions caught by your code are *not* ordinarily not reported, and you may wish to report them -and thus draw attention to them in relevant experiences including the failures blade and end-to-end transaction view. - -```typescript -const { useAzureMonitor } = require("@azure/monitor-opentelemetry"); -const { trace } = require("@opentelemetry/api"); - -useAzureMonitor(); -const tracer = trace.getTracer("testMeter"); - -let span = tracer.startSpan("hello"); -try{ - throw new Error("Test Error"); -} -catch(error){ - span.recordException(error); -} -``` - -## Troubleshooting - -### Self-diagnostics - -Azure Monitor OpenTelemetry uses the OpenTelemetry API Logger for internal logs. To enable it, use the following code: - -```typescript -const { useAzureMonitor } = require("@azure/monitor-opentelemetry"); -const { DiagLogLevel } = require("@opentelemetry/api"); - -process.env.APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL = "VERBOSE"; -process.env.APPLICATIONINSIGHTS_LOG_DESTINATION = "file"; -process.env.APPLICATIONINSIGHTS_LOGDIR = "C:/applicationinsights/logs"; - -useAzureMonitor(); -``` - -`APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL` environment varialbe could be used to set desired log level, supporting the following values: `NONE`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `VERBOSE` and `ALL`. - -Logs could be put into local file using `APPLICATIONINSIGHTS_LOG_DESTINATION` environment variable, supported values are `file` and `file+console`, a file named `applicationinsights.log` will be generated on tmp folder by default, including all logs, `/tmp` for *nix and `USERDIR/AppData/Local/Temp` for Windows. Log directory could be configured using `APPLICATIONINSIGHTS_LOGDIR` environment variable. - - -## Examples - -For complete samples of a few champion scenarios, see the [`samples/`](https://github.com/Azure/azure-sdk-for-js/tree/@azure/monitor-opentelemetry_1.0.0-beta.3/sdk/monitor/monitor-opentelemetry/samples-dev/) folder. - -## Key concepts - -For more information on the OpenTelemetry project, please review the [**OpenTelemetry Specifications**](https://github.com/open-telemetry/opentelemetry-specification#opentelemetry-specification). - - -### Plugin Registry - -To see if a plugin has already been made for a library you are using, please check out the [OpenTelemetry Registry](https://opentelemetry.io/registry/). - -If you cannot your library in the registry, feel free to suggest a new plugin request at [`opentelemetry-js-contrib`](https://github.com/open-telemetry/opentelemetry-js-contrib). - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/monitor-opentelemetry_1.0.0-beta.3/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/monitor/monitor-opentelemetry/README.png) - diff --git a/docs-ref-services/preview/notification-hubs-readme.md b/docs-ref-services/preview/notification-hubs-readme.md deleted file mode 100644 index a4d02f1eccb9..000000000000 --- a/docs-ref-services/preview/notification-hubs-readme.md +++ /dev/null @@ -1,747 +0,0 @@ ---- -title: -keywords: Azure, javascript, SDK, API, @azure/notification-hubs, notificationhubs -author: xirzec -ms.author: jeffish -ms.date: 11/22/2022 -ms.topic: reference -ms.devlang: javascript -ms.service: notificationhubs ---- -# Azure Notification Hubs SDK for JavaScript - -Azure Notification Hubs provide a scaled-out push engine that enables you to send notifications to any platform (Apple, Amazon Kindle, Android, Baidu, Web, Windows, etc.) from any back-end (cloud or on-premises). Notification Hubs works well for both enterprise and consumer scenarios. Here are a few example scenarios: - -- Send breaking news notifications to millions with low latency. -- Send location-based coupons to interested user segments. -- Send event-related notifications to users or groups for media/sports/finance/gaming applications. -- Push promotional contents to applications to engage and market to customers. -- Notify users of enterprise events such as new messages and work items. -- Send codes for multi-factor authentication. - -Key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/blob/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/) -- [Package (npm)](https://www.npmjs.com/package/@azure/notification-hubs) -- [Product documentation](/azure/notification-hubs/) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/notification-hubs_1.0.0-beta.8/SUPPORT.md) for more details. - -### Install the package - -```bash -npm install @azure/notification-hubs -``` - -### Prerequisites - -- An [Azure Subscription](https://azure.microsoft.com) -- An [App Notification Hubs](/azure/notification-hubs/) resource. - -### Create an Azure Notification Hubs resource - -An Azure Notification Hub can be created using the following methods: - -1. [Azure Portal](/azure/notification-hubs/create-notification-hub-portal) -2. [Azure CLI](/azure/notification-hubs/create-notification-hub-azure-cli) -3. [Bicep](/azure/notification-hubs/create-notification-hub-bicep) -4. [ARM Template](/azure/notification-hubs/create-notification-hub-template) - -Once created, the Notification Hub can be configured using the [Azure Portal or Azure CLI](/azure/notification-hubs/configure-notification-hub-portal-pns-settings?tabs=azure-portal). - -### Importing the Client - -This SDK for JavaScript offers two ways of interacting with Azure Notification Hubs, either through the class-based approach, or with a modular design approach. The class-based approach is consistent across all packages to create a client and then interact with the methods on the client. - -```typescript -import { - NotificationHubsClient, - createAppleInstallation -} from "@azure/notification-hubs"; - -const client = new NotificationHubsClient("", ""); - -const installation = createAppleInstallation({ - installationId: "", - pushChannel: "", - tags: ["likes_javascript"], -}); - -const result = await client.createOrUpdateInstallation(installation); -``` - -The modular approach allows the developer to pick and choose which functions to import as each method is exposed individually. This approach uses subpath-exports with ES-Modules to expose the methods via direct imports. With the individual exports, this creates a better tree-shaking experience and smaller bundle sizes that the developer can take advantage of. - -Note that creating a client is exposed through the `"@azure/notification-hubs/api"` subpath and all client methods are exposed through the `"@azure/notification-hubs/api"` subpath. Each function exported takes the `client` as the first parameter and the rest of the parameters remain unchanged. - -The following subpaths are exposed: - -- `@azure/notification-hubs/api` - The main entry point for the client via `createClientContext` and client methods such as `getInstallation` or `sendNotification` -- `@azure/notification-hubs/models` - The Notification Hubs models and factory methods. - -The above code snippet then becomes the following: - -```typescript -import { createClientContext, createOrUpdateInstallation } from "@azure/notification-hubs/api"; -import { createAppleInstallation } from "@azure/notification-hubs/models"; - -const context = createClientContext("", ""); - -const installation = createAppleInstallation({ - installationId: "", - pushChannel: "", - tags: ["likes_javascript"], -}); - -const result = await createOrUpdateInstallation(context, installation); -``` - -### Authenticate the client - -Interaction with an Azure Notification Hub starts with the `NotificationHubsClient` which supports [Shared Access Signature connection strings](/azure/notification-hubs/notification-hubs-push-notification-security). This includes the following permission levels: **Listen**, **Manage**, **Send**. - -Listen allows for a client to register itself via the Registration and Installations API. Send allows for the client to send notifications to devices using the send APIs. Finally, Manage allows the user to do Registration and Installation management, such as queries. - -A new `NotificationHubsClient` client can be created using the constructor with the connection string and Notification Hub name. - -```typescript -import { NotificationHubsClient } from "@azure/notification-hubs"; - -const client = new NotificationHubsClient("", ""); -``` - -Using the modular approach, the `createClientContext` can be imported via the `"@azure/notification-hubs/api"` subpath. - -```typescript -import { createClientContext } from "@azure/notification-hubs/api"; - -const context = createClientContext("", ""); -``` - -## Key concepts - -Once the `NotificationHubClient` has been initialized, the following concepts can be explored. - -- Device Management via Installations and RegistrationDescriptions -- Send Notifications to Devices - -### Device Management - -Device management is a core concept to Notification Hubs to be able to store the unique identifier from the native Platform Notification Service (PNS) such as APNs or Firebase, and associated metadata such as tags used for sending push notifications to audiences. This is done with two APIs, the Installation API which is the newer and preferred mechanism, and Registrations. - -#### Installations API - -Installations are a newer and native JSON approach to device management that contains additional properties such as an installation ID and user ID which can be used for sending to audiences. The installations API has a few advantages over the existing Registration APIs in the following ways: - -- Fully idempotent API so calling create on the installation, so an operation can be retried without worries about duplications. -- Support for `userId` and `installationId` properties which can be then used in tag expressions such as `$InstallationId:{myInstallId}` and `$UserId:{bob@contoso.com}`. -- Templates are now part of the installation instead of a separate registration and can be reference by name as a tag for sending. -- Partial updates are supported through the [JSON Patch Standard](https://tools.ietf.org/html/rfc6902), which allows to add tags and change other data without having to first query the installation. - -Installations can be created through the `createOrUpdateInstallation` method such as the following: - -```typescript -import { NotificationHubsClient, createAppleInstallation } from "@azure/notification-hubs"; -import { v4 as uuid } from "uuid"; - -const client = new NotificationHubsClient("", ""); - -// Create an installation for APNs -let installation = createAppleInstallation({ - installationId: uuid(), // Must be unique - pushChannel: "00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0", // PNS specific handle - tags: ["likes_hockey", "likes_football"], -}); - -installation = await client.createOrUpdateInstallation(installation); -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { createClientContext, createOrUpdateInstallation } from "@azure/notification-hubs/api"; -import { createAppleInstallation } from "@azure/notification-hubs/models"; -import { v4 as uuid } from "uuid"; - -const context = createClientContext("", ""); - -// Create an installation for APNs -let installation = createAppleInstallation({ - installationId: uuid(), // Must be unique - pushChannel: "00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0", // PNS specific handle - tags: ["likes_hockey", "likes_football"], -}); - -installation = await createOrUpdateInstallation(context, installation); -``` - -An update to an installation can be made through the JSON Patch schema such as adding a tag and a user ID using the `updateInstallation` method. - -```typescript -import { NotificationHubsClient, JsonPatch } from "@azure/notification-hubs"; - -const client = new NotificationHubsClient("", ""); - -const installationId = ""; - -const updates: JsonPatch[] = [ - { op: "add", path: "/tags", value: "likes_baseball" }, - { op: "add", path: "/userId", value: "bob@contoso.com" }, -]; - -const installation = await client.updateInstallation(installationId, updates); -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { createClientContext, updateInstallation } from "@azure/notification-hubs/api"; -import { JsonPatch } from "@azure/notification-hubs/models"; - -const context = createClientContext("", ""); - -const installationId = ""; - -const updates: JsonPatch[] = [ - { op: "add", path: "/tags", value: "likes_baseball" }, - { op: "add", path: "/userId", value: "bob@contoso.com" }, -]; - -const installation = await updateInstallation(context, installationId, updates); -``` - -To retrieve an existing installation, use the `getInstallation` method with your existing unique installation ID. - -```typescript -import { NotificationHubsClient } from "@azure/notification-hubs"; - -const client = new NotificationHubsClient("", ""); - -const installationId = ""; - -const installation = client.getInstallation(installationId); -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { createClientContext, getInstallation } from "@azure/notification-hubs/api"; - -const context = createClientContext("", ""); - -const installationId = ""; - -const installation = getInstallation(context, installationId); -``` - -#### Registrations API - -A registration is associated with a PNS just as the installation above, with the unique device identifier from the PNS, and associated tags. Templates registrations are a way of creating pre-defined body templates which can then be customized at send time with properties to fill in for the message. For more information about templates, see [Templates documentation](/azure/notification-hubs/notification-hubs-templates-cross-platform-push-messages). - -An installation may be created in one of two ways, first by getting a registration ID from the server using `getInstallationId` and then `createOrUpdateRegistration` or via the `createRegistration` method. - -```typescript -import { - NotificationHubsClient, - createAppleRegistrationDescription, -} from "@azure/notification-hubs"; - -const client = new NotificationHubsClient("", ""); - -let registration = createAppleRegistrationDescription({ - deviceToken: "00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0", - tags: ["likes_hockey", "likes_football"], -}); - -registration = await client.createRegistration(registration); - -console.log(`New Registration ID: ${registration.registrationId}`); -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { createClientContext, createRegistration } from "@azure/notification-hubs/api"; -import { createAppleRegistrationDescription } from "@azure/notification-hubs/models"; - -const context = createClientContext("", ""); - -let registration = createAppleRegistrationDescription({ - deviceToken: "00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0", - tags: ["likes_hockey", "likes_football"], -}); - -registration = await createRegistration(context, registration); - -console.log(`New Registration ID: ${registration.registrationId}`); -``` - -Updates can be done via the `updateRegistration` method but unlike installations, does not support incremental updates. Querying for an existing registration can be done with the `getRegistration` method. - -```typescript -import { NotificationHubsClient } from "@azure/notification-hubs"; - -const client = new NotificationHubsClient("", ""); - -const registrationId = ""; - -let registration = await client.getRegistration(registrationId); - -registration.tags.push("likes_sports"); - -registration = await client.updateRegistration(registration); -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { - createClientContext, - getRegistration, - updateRegistration -} from "@azure/notification-hubs/api"; - -const context = createClientContext("", ""); - -const registrationId = ""; - -let registration = await getRegistration(context, registrationId); - -registration.tags.push("likes_sports"); - -registration = await updateRegistration(context, registration); -``` - -Registrations, unlike installations, can be queried to get all registrations, matching registrations to a condition, or by tags. Registrations can be queried using the `listRegistrations`, `listRegistrationsByChannel` and `listRegistrationsByTag` method. All methods support limiting via the `top` option and support asynchronous paging. - -```typescript -import { NotificationHubsClient } from "@azure/notification-hubs/api"; - -const client = new NotificationHubsClient("", ""); - -const registrations = await client.listRegistrationsByTag("likes_hockey"); - -let page = 0; -for await (const pages of registrations.byPage()) { - console.log(`Page number ${page++}`); - for (const item of pages) { - console.log(JSON.stringify(item, null, 2)); - } -} -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { createClientContext, listRegistrationsByTag } from "@azure/notification-hubs/api"; - -const context = createClientContext("", ""); - -const registrations = await listRegistrationsByTag(context, "likes_hockey"); - -let page = 0; -for await (const pages of registrations.byPage()) { - console.log(`Page number ${page++}`); - for (const item of pages) { - console.log(JSON.stringify(item, null, 2)); - } -} -``` - -### Send Operations - -Notification Hubs supports sending notifications to devices either directly using the unique PNS provided identifier, using tags for audience send, or a general broadcast to all devices. Using the Standard SKU and above, [scheduled send](/azure/notification-hubs/notification-hubs-send-push-notifications-scheduled) allows the user to schedule notifications up to seven days in advance. All send operations return a Tracking ID and Correlation ID which can be used for Notification Hubs support cases. With the Standard SKU and above, a Notification ID is also returned which can be used to get notification telemetry via the `getNotificationOutcomeDetails` method. - -For debugging purposes, the `enableTestSend` options can be set to `true` which gets immediate feedback from the PNS on the `sendNotification` method, however, is not supported in production scenarios. This is not supported on the scheduled send methods. - -Raw JSON or XML strings can be sent to the send or scheduled send methods, or the notification builders can be used which helps construct messages per PNS such as APNs, Firebase, Baidu, ADM and WNS. These builders will build the native message format so there is no guessing about which fields are available for each PNS. - -```typescript -// Using the class-based approach -import { createAppleNotificationBody } from "@azure/notification-hubs"; - -// Using the modular approach -import { createAppleNotification, createAppleNotificationBody } from "@azure/notification-hubs/models"; - -const apnsBody = createAppleNotificationBody({ - alert: { - title: "Notification Title", - subtitle: "Notification Subtitle", - body: "Notification body goes here", - }, - sound: "default", - interruptionLevel: "time-sensitive", -}); - -// Send the message using the modular approach -const notification = createAppleNotification({ - body: apnsBody -}) - -const result = await sendNotification(context, notification); -``` - -#### Broadcast Send - -Notification Hubs can be used to send notifications to all registered devices per platform using broadcast send through the `sendNotification` method. - -```typescript -import { - NotificationHubsClient, - createAppleNotification, -} from "@azure/notification-hubs/api"; - -const context = createClientContext(connectionString, hubName); - -const messageBody = `{ "aps" : { "alert" : "Hello" } }`; - -const message = createAppleNotification({ - body: messageBody, - headers: { - "apns-priority": "10", - "apns-push-type": "alert", - }, -}); - -const result = await client.sendNotification(message); - -console.log(`Tracking ID: ${result.trackingId}`); -console.log(`Correlation ID: ${result.correlationId}`); - -// Only available in Standard SKU and above -if (result.notificationId) { - console.log(`Notification ID: ${result.notificationId}`); -} -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { createClientContext, sendNotification } from "@azure/notification-hubs/api"; -import { createAppleNotification } from "@azure/notification-hubs/models"; - -const context = createClientContext(connectionString, hubName); - -const messageBody = `{ "aps" : { "alert" : "Hello" } }`; - -const message = createAppleNotification({ - body: messageBody, - headers: { - "apns-priority": "10", - "apns-push-type": "alert", - }, -}); - -const result = await sendNotification(context, message); - -console.log(`Tracking ID: ${result.trackingId}`); -console.log(`Correlation ID: ${result.correlationId}`); - -// Only available in Standard SKU and above -if (result.notificationId) { - console.log(`Notification ID: ${result.notificationId}`); -} -``` - -#### Direct Send - -To send directly a device, the user can send using the platform provided unique identifier such as APNs device token by calling the `sendNotification` method with a `deviceHandle` parameter. - -```typescript -import { - NotificationHubsClient, - createAppleNotification, -} from "@azure/notification-hubs"; - -const client = new NotificationHubsClient(connectionString, hubName); - -const deviceHandle = "00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0"; -const messageBody = `{ "aps" : { "alert" : "Hello" } }`; - -const message = createAppleNotification({ - body: messageBody, - headers: { - "apns-priority": "10", - "apns-push-type": "alert", - }, -}); - -const result = await client.sendNotification(message, { deviceHandle }); - -console.log(`Tracking ID: ${result.trackingId}`); -console.log(`Correlation ID: ${result.correlationId}`); - -// Only available in Standard SKU and above -if (result.notificationId) { - console.log(`Notification ID: ${result.notificationId}`); -} -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { createClientContext, sendDirectNotification } from "@azure/notification-hubs/api"; -import { createAppleNotification } from "@azure/notification-hubs/models"; - -const context = createClientContext(connectionString, hubName); - -const deviceHandle = "00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0"; -const messageBody = `{ "aps" : { "alert" : "Hello" } }`; - -const message = createAppleNotification({ - body: messageBody, - headers: { - "apns-priority": "10", - "apns-push-type": "alert", - }, -}); - -const result = await sendNotification(context, message, { deviceHandle }); - -console.log(`Tracking ID: ${result.trackingId}`); -console.log(`Correlation ID: ${result.correlationId}`); - -// Only available in Standard SKU and above -if (result.notificationId) { - console.log(`Notification ID: ${result.notificationId}`); -} -``` - -#### Audience Send - -In addition to targeting a single device, a user can target multiple devices using tags. These tags can be supplied as a list of tags, which then creates a tag expression to match registered devices, or via a tag expression which can then use Boolean logic to target the right audience. For more information about tags and tags expressions, see [Routing and Tag Expressions](/azure/notification-hubs/notification-hubs-tags-segment-push-message). - -If you wish to create a tag expression from an array of tags, there is a Tag Expression Builder available with the `createTagExpression` method which is exposed at the top level import or `@azure/notification-hubs/models/tagExpressionBuilder` modular import which creates an "or tag expression" from the tags. - -```typescript -// Top level import -import { createTagExpression } from "@azure/notification-hubs"; - -// Modular import -import { createTagExpression } from "@azure/notification-hubs/models"; - -const tags = ["likes_football", "likes_hockey"]; -const tagExpression = createTagExpression(tags); - -console.log(tagExpression); -// likes_football||likes_hockey -``` - -Tag expression messages can be sent using the following code: - -```typescript -import { - NotificationHubsClient, - createAppleNotification, -} from "@azure/notification-hubs"; - -const client = new NotificationHubsClient("", ""); - -const tagExpression = "likes_hockey && likes_football"; -const messageBody = `{ "aps" : { "alert" : "Hello" } }`; - -const notification = createAppleNotification({ - body: messageBody, - headers: { - "apns-priority": "10", - "apns-push-type": "alert", - }, -}); - -const result = await client.sendNotification(notification, { tagExpression }); - -console.log(`Tracking ID: ${result.trackingId}`); -console.log(`Correlation ID: ${result.correlationId}`); - -// Only available in Standard SKU and above -if (result.notificationId) { - console.log(`Notification ID: ${result.notificationId}`); -} -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { createClientContext, sendNotification } from "@azure/notification-hubs/api"; -import { createAppleNotification } from "@azure/notification-hubs/models"; - -const context = createClientContext("", ""); - -const tagExpression = "likes_hockey && likes_football"; -const messageBody = `{ "aps" : { "alert" : "Hello" } }`; - -const notification = createAppleNotification({ - body: messageBody, - headers: { - "apns-priority": "10", - "apns-push-type": "alert", - }, -}); - -const result = await sendNotification(context, notification, { tagExpression }); - -console.log(`Tracking ID: ${result.trackingId}`); -console.log(`Correlation ID: ${result.correlationId}`); - -// Only available in Standard SKU and above -if (result.notificationId) { - console.log(`Notification ID: ${result.notificationId}`); -} -``` - -#### Scheduled Send - -Push notifications can be scheduled up to seven days in advance with Standard SKU namespaces and above using the `scheduleBroadcastNotification` method to send to devices with tags or a general broadcast. This returns a notification ID which can be then used to cancel if necessary via the `cancelScheduledNotification` method. - -```typescript -import { - NotificationHubsClient, - createAppleNotification, -} from "@azure/notification-hubs"; - -const client = new NotificationHubsClient("", ""); - -const tagExpression = "likes_hockey && likes_football"; -const messageBody = `{ "aps" : { "alert" : "Hello" } }`; - -// Schedule 8 hours from now -const scheduledTime = new Date(Date.now() + (8 * 60 * 60 * 1000)); - -const message = createAppleNotification({ - body: messageBody, - headers: { - "apns-priority": "10", - "apns-push-type": "alert", - }, -}); - -const result = await client.scheduleNotification(scheduledTime, message, { tagExpression }); - -console.log(`Tracking ID: ${result.trackingId}`); -console.log(`Correlation ID: ${result.correlationId}`); - -// Can be used to cancel via the cancelScheduledSend method -console.log(`Notification ID: ${result.notificationId}`); -``` - -Using the modular approach, the code would be as follows: - -```typescript -import { createClientContext, scheduleNotification } from "@azure/notification-hubs/api"; -import { createAppleNotification } from "@azure/notification-hubs/models"; - -const context = createClientContext("", ""); - -const tagExpression = "likes_hockey && likes_football"; -const messageBody = `{ "aps" : { "alert" : "Hello" } }`; - -// Schedule 8 hours from now -const scheduledTime = new Date(Date.now() + (8 * 60 * 60 * 1000)); - -const message = createAppleNotification({ - body: messageBody, - headers: { - "apns-priority": "10", - "apns-push-type": "alert", - }, -}); - -const result = await scheduleNotification(context, scheduledTime, message, { tagExpression }); - -console.log(`Tracking ID: ${result.trackingId}`); -console.log(`Correlation ID: ${result.correlationId}`); - -// Can be used to cancel via the cancelScheduledSend method -console.log(`Notification ID: ${result.notificationId}`); -``` - -## Troubleshooting - -### Diagnose Dropped Notifications - -Azure Notification Hubs has a complete guide to troubleshooting problems with dropped notifications in the [Diagnose dropped notifications in Azure Notification Hubs Guide](/azure/notification-hubs/notification-hubs-push-notification-fixer). - -[Test send](/azure/notification-hubs/notification-hubs-push-notification-fixer#enabletestsend-property) is supported supported in the `sendNotification` method with the `enableTestSend` option: - -```typescript -// Using the client -const result = await client.sendNotification(notification, { tags, enableTestSend: true }); - -// Using the modular approach -const result = await sendNotification(context, notification, { tags, enableTestSend: true }); -``` - -### Logging - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/core/logger). - -## Next steps - -The following samples show you the various ways you can interact with Azure Notification Hubs: - -**Device Management:** - -- Installations API - - [Create Or Update Installation](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/createInstallation.ts) - - [Update Installation](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/updateInstallation.ts) -- Registration API - - [Create Registration](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/createRegistration.ts)s - - [Create Or Update Registration](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/createOrUpdateRegistration.ts) - - [Update Registration](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/updateRegistration.ts) - - [List Registrations](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/listRegistrations.ts) - - [List Registration By Tag](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/listRegistrationsByTag.ts) - -**Send Operations:** - -- [Broadcast Send](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/sendBroadcastNotification.ts) -- [Direct Send](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/sendDirectNotification.ts) -- [Audience Send With Tags List](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/sendTagsList.ts) -- [Audience Send With Tag Expression](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/sendTagExpression.ts) -- [Scheduled Broadcast Send](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/scheduledSendBroadcastNotification.ts) -- [Scheduled Send](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/scheduledSendNotification.ts) - -**Management Operations:** - -- [Export Registrations](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/exportRegistrationsJob.ts) -- [Import Registrations](https://github.com/Azure/azure-sdk-for-js/tree/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/samples-dev/importRegistrationsJob.ts) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/notification-hubs_1.0.0-beta.8/CONTRIBUTING.md) to learn more about how to build and test the code. - -This module's tests are a mixture of live and unit tests, which require you to have an Azure Notification Hubs instance. To execute the tests you'll need to run: - -1. `rush update` -2. `rush build -t @azure/notification-hubs` -3. Create a .env file with these contents in the `sdk\notificationhubs\notification-hubs` folder: - `NOTIFICATIONHUBS_CONNECTION_STRING=connection string for your Notification Hubs instance` - `NOTIFICATION_HUB_NAME=Notification Hub name` -4. `cd sdk\notificationhubs\notification-hubs` -5. `npm run test`. - -View our [tests](https://github.com/Azure/azure-sdk-for-js/blob/@azure/notification-hubs_1.0.0-beta.8/sdk/notificationhubs/notification-hubs/test) -folder for more details. - -## Related projects - -- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) -- [Azure Notification Hubs](/azure/notification-hubs/notification-hubs-push-notification-overview) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%notificationhubs%2Fnotification-hubs%2FREADME.png) - diff --git a/docs-ref-services/preview/schema-registry-avro-readme.md b/docs-ref-services/preview/schema-registry-avro-readme.md deleted file mode 100644 index 7fabedc3c0e6..000000000000 --- a/docs-ref-services/preview/schema-registry-avro-readme.md +++ /dev/null @@ -1,178 +0,0 @@ ---- -title: Azure Schema Registry Avro Serializer client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/schema-registry-avro, schemaregistry -author: deyaaeldeen -ms.author: dealmaha -ms.date: 04/05/2022 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure ---- -# Azure Schema Registry Avro Serializer client library for JavaScript - version 1.0.0-beta.8 - - -Azure Schema Registry is a schema repository service hosted by Azure Event Hubs, -providing schema storage, versioning, and management. This package provides an -Avro serializer capable of serializing and deserializing payloads containing -Avro-serialized data. - -Key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/schema-registry-avro_1.0.0-beta.8/sdk/schemaregistry/schema-registry-avro) -- [Package (npm)](https://www.npmjs.com/package/@azure/schema-registry-avro) -- [API Reference Documentation](https://docs.microsoft.com/javascript/api/@azure/schema-registry-avro) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/schema-registry-avro_1.0.0-beta.8/sdk/schemaregistry/schema-registry-avro/samples) - -## Getting started - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) - -### Prerequisites - -- An [Azure subscription][azure_sub] -- An existing [Schema Registry resource](https://aka.ms/schemaregistry) - -### Install the `@azure/schema-registry-avro` package - -Install the Azure Text Analytics client library for JavaScript with `npm`: - -```bash -npm install @azure/schema-registry-avro -``` - -## Key concepts - -### AvroSerializer - -Provides API to serialize to and deserialize from Avro Binary Encoding wrapped in a message -with a content type field containing the schema ID. Uses -`SchemaRegistryClient` from the [@azure/schema-registry](https://www.npmjs.com/package/@azure/schema-registry) package -to get schema IDs from schema definition or vice versa. The provided API has internal cache to avoid calling the schema registry service when possible. - -### Messages - -By default, the serializer will create messages structured as follows: - -- `data`: a byte array containing data in the Avro Binary Encoding. Note that it - is NOT Avro Object Container File. The latter includes the schema and creating - it defeats the purpose of using this serializer to move the schema out of the - message payload and into the schema registry. - -- `contentType`: a string of the following format `avro/binary+` where - the `avro/binary` part signals that this message has an Avro-serialized payload - and the `` part is the Schema ID the Schema Registry service assigned - to the schema used to serialize this payload. - -Not all messaging services are supporting the same message structure. To enable -integration with such services, the serializer can act on custom message structures -by setting the `messageAdapter` option in the constructor with a corresponding -message producer and consumer. Azure messaging client libraries export default -adapters for their message types. - -### Backward Compatibility - -The serializer v1.0.0-beta.5 and under serializes data into binary arrays. Starting from -v1.0.0-beta.6, the serializer returns messages instead that contain the serialized payload. -For a smooth transition to using the newer versions, the serializer also supports -deserializing messages with payloads that follow the old format where the schema ID -is part of the payload. - -This backward compatibility is temporary and will be removed in v1.0.0. - -## Examples - -### Serialize and deserialize an `@azure/event-hubs`'s `EventData` - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -import { createEventDataAdapter } from "@azure/event-hubs"; -const { SchemaRegistryClient } = require("@azure/schema-registry"); -const { AvroSerializer } = require("@azure/schema-registry-avro"); - -const client = new SchemaRegistryClient( - "", - new DefaultAzureCredential() -); -const serializer = new AvroSerializer(client, { - groupName: "", - messageAdapter: createEventDataAdapter(), -}); - -// Example Avro schema -const schema = JSON.stringify({ - type: "record", - name: "Rating", - namespace: "my.example", - fields: [{ name: "score", type: "int" }], -}); - -// Example value that matches the Avro schema above -const value = { score: 42 }; - -// Serialize value to a message -const message = await serializer.serialize(value, schema); - -// Deserialize a message to value -const deserializedValue = await serializer.deserialize(message); -``` - -## Troubleshooting - -The Avro serializer communicates with the [Schema Registry][schema_registry] service as needed to register or query schemas and those service calls could throw a [RestError][resterror]. Furthermore, errors of type `AvroError` will be thrown when serialization or deserialization fails. The `innerError` property will contain the underlying error that was thrown from the Avro implementation library. - -### Logging - -Enabling logging may help uncover useful information about failures. In order to -see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment -variable to `info`. Alternatively, logging can be enabled at runtime by calling -`setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -## Next steps - -Please take a look at the -[samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/schema-registry-avro_1.0.0-beta.8/sdk/schemaregistry/schema-registry-avro/samples) -directory for detailed examples on how to use this library. - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require -you to agree to a Contributor License Agreement (CLA) declaring that you have -the right to, and actually do, grant us the rights to use your contribution. For -details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot will automatically determine whether -you need to provide a CLA and decorate the PR appropriately (e.g., label, -comment). Simply follow the instructions provided by the bot. You will only need -to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of -Conduct](https://opensource.microsoft.com/codeofconduct/). For more information -see the [Code of Conduct -FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact -[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional -questions or comments. - -If you'd like to contribute to this library, please read the [contributing -guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/schema-registry-avro_1.0.0-beta.8/CONTRIBUTING.md) to -learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fschemaregistry%2Fschema-registry-avro%2FREADME.png) - -[azure_cli]: https://docs.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ -[azure_portal]: https://portal.azure.com -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/schema-registry-avro_1.0.0-beta.8/sdk/identity/identity -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/schema-registry-avro_1.0.0-beta.8/sdk/identity/identity#defaultazurecredential -[resterror]: https://docs.microsoft.com/javascript/api/@azure/core-rest-pipeline/resterror?view=azure-node-latest -[schema_registry]: https://docs.microsoft.com/javascript/api/overview/azure/schema-registry-readme?view=azure-node-latest diff --git a/docs-ref-services/preview/service-bus-readme.md b/docs-ref-services/preview/service-bus-readme.md deleted file mode 100644 index e18440350a20..000000000000 --- a/docs-ref-services/preview/service-bus-readme.md +++ /dev/null @@ -1,557 +0,0 @@ ---- -title: Azure Service Bus client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/service-bus, servicebus -author: jeremymeng -ms.author: yumeng -ms.date: 02/27/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: servicebus ---- -# Azure Service Bus client library for JavaScript - version 7.8.1-beta.1 - - -[Azure Service Bus](https://azure.microsoft.com/services/service-bus/) is a highly-reliable cloud messaging service from Microsoft. - -Use the client library `@azure/service-bus` in your application to - -- Send messages to an Azure Service Bus Queue or Topic -- Receive messages from an Azure Service Bus Queue or Subscription -- Create/Get/Delete/Update/List Queues/Topics/Subscriptions/Rules in an Azure Service Bus namespace. - -Resources for `@azure/service-bus` version 7: - -Key links: -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus) -- [Package (npm)](https://www.npmjs.com/package/@azure/service-bus) -- [API Reference Documentation][apiref] -- [Product documentation](https://azure.microsoft.com/services/service-bus/) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus/samples) -- [Troubleshooting Guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus/TROUBLESHOOTING.md) - -**NOTE**: If you are using version 1.1.10 or lower and want to migrate to the latest version -of this package please look at our [migration guide to move from Service Bus V1 to Service Bus V7][migrationguide] - -## Getting started - -### Install the package - -Install the latest version for the Azure Service Bus client library using npm. - -`npm install @azure/service-bus` - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- A [Service Bus Namespace](/azure/service-bus-messaging/) - -### Configure TypeScript - -TypeScript users need to have Node type definitions installed: - -```bash -npm install @types/node -``` - -You also need to enable `compilerOptions.allowSyntheticDefaultImports` in your tsconfig.json. Note that if you have enabled `compilerOptions.esModuleInterop`, `allowSyntheticDefaultImports` is enabled by default. See [TypeScript's compiler options handbook](https://www.typescriptlang.org/docs/handbook/compiler-options.html) for more information. - -### JavaScript Bundle - -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -In addition to what is described there, this library also needs additional polyfills for the following NodeJS core built-in modules in order to work properly in the browsers: - -- `buffer` -- `os` -- `path` -- `process` - -#### Bundling with Webpack - -If you are using Webpack v5, you can install the following dev dependencies - -- `npm install --save-dev buffer os-browserify path-browserify process` - -then add the following into your webpack.config.js - -```diff - const path = require("path"); -+const webpack = require("webpack"); - - module.exports = { - entry: "./src/index.ts", -@@ -12,8 +13,21 @@ module.exports = { - }, - ], - }, -+ plugins: [ -+ new webpack.ProvidePlugin({ -+ process: "process/browser", -+ }), -+ new webpack.ProvidePlugin({ -+ Buffer: ["buffer", "Buffer"], -+ }), -+ ], - resolve: { - extensions: [".ts", ".js"], -+ fallback: { -+ buffer: require.resolve("buffer/"), -+ os: require.resolve("os-browserify"), -+ path: require.resolve("path-browserify"), -+ }, - }, -``` - -#### Bundling with Rollup - -If you are using Rollup bundler, install the following dev dependencies - -- `npm install --save-dev buffer process @rollup/plugin-commonjs @rollup/plugin-inject @rollup/plugin-node-resolve` - -Then include the following in your rollup.config.js - -```diff -+import nodeResolve from "@rollup/plugin-node-resolve"; -+import cjs from "@rollup/plugin-commonjs"; -+import shim from "rollup-plugin-shim"; -+import inject from "@rollup/plugin-inject"; - -export default { - // other configs - plugins: [ -+ shim({ -+ fs: `export default {}`, -+ net: `export default {}`, -+ tls: `export default {}`, -+ path: `export default {}`, -+ dns: `export function resolve() { }`, -+ }), -+ nodeResolve({ -+ mainFields: ["module", "browser"], -+ preferBuiltins: false, -+ }), -+ cjs(), -+ inject({ -+ modules: { -+ Buffer: ["buffer", "Buffer"], -+ process: "process", -+ }, -+ exclude: ["./**/package.json"], -+ }), - ] -}; -``` - -Please consult the documentation of your favorite bundler for more information on using polyfills. - -### Authenticate the client - -Interaction with Service Bus starts with an instance of the [ServiceBusClient][sbclient] class. You can -authenticate to Service Bus using a connection string or using an Azure Active Directory credential. - -#### Using a connection string - -This method takes the connection string to your Service Bus instance. You can get -the connection string from the Azure portal. - -```javascript -const { ServiceBusClient } = require("@azure/service-bus"); - -const serviceBusClient = new ServiceBusClient(""); -``` - -More information about this constructor is available in the [API documentation][sbclient_constructor]. - -#### Using an Azure Active Directory Credential - -Authentication with Azure Active Directory uses the [Azure Identity library][azure_identity]. - -The example below uses the [DefaultAzureCredential][defaultazurecredential], one of many -available credential providers from the `@azure/identity` library. - -```javascript -const { ServiceBusClient } = require("@azure/service-bus"); -const { DefaultAzureCredential } = require("@azure/identity"); - -const fullyQualifiedNamespace = ".servicebus.windows.net"; -const credential = new DefaultAzureCredential(); -const serviceBusClient = new ServiceBusClient(fullyQualifiedNamespace, credential); -``` - -> NOTE: If you're using your own implementation of the `TokenCredential` interface -> against AAD, then set the "scopes" for service-bus to the following to get -> the appropriate token: - -> ```typescript -> ["https://servicebus.azure.net//user_impersonation"]; -> ``` - -More information about this constructor is available in the [API documentation][sbclient_tokencred_overload] - -## Key concepts - -Once you've initialized a `ServiceBusClient`, you can interact with these resources within a -Service Bus Namespace: - -- [Queues][queue_concept]: Allows for sending and receiving messages. Often used for point-to-point communication. -- [Topics][topic_concept]: As opposed to Queues, Topics are better suited to publish/subscribe scenarios. A topic can be sent to, but requires a subscription, of which there can be multiple in parallel, to consume from. -- [Subscriptions][subscription_concept]: The mechanism to consume from a Topic. Each subscription is independent, and receives a copy of each message sent to the topic. Rules and Filters can be used to tailor which messages are received by a specific subscription. - -For more information about these resources, see [What is Azure Service Bus?][service_bus_overview]. - -To interact with these resources, one should be familiar with the following SDK concepts: - -- Send messages, to a queue or topic, using a [`ServiceBusSender`][sender] created using [`ServiceBusClient.createSender()`][sbclient_createsender]. -- Receive messages, from either a queue or a subscription, using a [`ServiceBusReceiver`][receiver] created using [`ServiceBusClient.createReceiver()`][sbclient_createreceiver]. -- Receive messages, from session enabled queues or subscriptions, using a [`ServiceBusSessionReceiver`][sessionreceiver] created using [`ServiceBusClient.acceptSession()`][sbclient_acceptsession] or `ServiceBusClient.acceptNextSession()`. - -Please note that the Queues, Topics and Subscriptions should be created prior to using this library. - -## Examples - -The following sections provide code snippets that cover some of the common tasks using Azure Service Bus - -- [Send messages](#send-messages) -- [Receive messages](#receive-messages) -- [Settle a message](#settle-a-message) -- [Dead letter queues](#dead-letter-queues) -- [Send messages using Sessions](#send-messages-using-sessions) -- [Receive messages from Sessions](#receive-messages-from-sessions) -- [Manage resources of a service bus namespace](#manage-resources-of-a-service-bus-namespace) -- [Additional samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus/samples) - -### Send messages - -Once you have created an instance of a `ServiceBusClient` class, you can get a `ServiceBusSender` -using the [createSender][sbclient_createsender] method which you can use to [send][sender_sendmessages] messages. - -```javascript -const sender = serviceBusClient.createSender("my-queue"); - -const messages = [ - { body: "Albert Einstein" }, - { body: "Werner Heisenberg" }, - { body: "Marie Curie" }, - { body: "Steven Hawking" }, - { body: "Isaac Newton" }, - { body: "Niels Bohr" }, - { body: "Michael Faraday" }, - { body: "Galileo Galilei" }, - { body: "Johannes Kepler" }, - { body: "Nikolaus Kopernikus" } -]; - -// sending a single message -await sender.sendMessages(messages[0]); - -// sending multiple messages in a single call -// this will fail if the messages cannot fit in a batch -await sender.sendMessages(messages); - -// Sends multiple messages using one or more ServiceBusMessageBatch objects as required -let batch = await sender.createMessageBatch(); - -for (let i = 0; i < messages.length; i++) { - const message = messages[i]; - if (!batch.tryAddMessage(message)) { - // Send the current batch as it is full and create a new one - await sender.sendMessages(batch); - batch = await sender.createMessageBatch(); - - if (!batch.tryAddMessage(messages[i])) { - throw new Error("Message too big to fit in a batch"); - } - } -} -// Send the batch -await sender.sendMessages(batch); -``` - -### Receive messages - -Once you have created an instance of a `ServiceBusClient` class, you can get a `ServiceBusReceiver` -using the [createReceiver][sbclient_createreceiver] method. - -```javascript -const receiver = serviceBusClient.createReceiver("my-queue"); -``` - -There are two `receiveMode`s available. - -- "peekLock" - In peekLock mode, the receiver has a lock on the message for the duration specified on the queue. -- "receiveAndDelete" - In receiveAndDelete mode, messages are deleted from Service Bus as they are received. - -If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. -You can also [settle the messages](#settle-a-message) received in "peekLock" mode. - -You can use this receiver in one of 3 ways to receive messages: - -#### Get an array of messages - -Use the [receiveMessages][receiver_receivemessages] function which returns a promise that -resolves to an array of messages. - -```javascript -const myMessages = await receiver.receiveMessages(10); -``` - -#### Subscribe using a message handler - -Use the [subscribe][receiver_subscribe] method to set up message handlers and have -it running as long as you need. - -When you are done, call `receiver.close()` to stop receiving any more messages. - -```javascript -const myMessageHandler = async (message) => { - // your code here - console.log(`message.body: ${message.body}`); -}; -const myErrorHandler = async (args) => { - console.log( - `Error occurred with ${args.entityPath} within ${args.fullyQualifiedNamespace}: `, - args.error - ); -}; -receiver.subscribe({ - processMessage: myMessageHandler, - processError: myErrorHandler -}); -``` - -#### Use async iterator - -Use the [getMessageIterator][receiver_getmessageiterator] to get an async iterator over messages - -```javascript -for await (let message of receiver.getMessageIterator()) { - // your code here -} -``` - -### Settle a message - -Once you receive a message you can call [`completeMessage()`][receiver_complete], [`abandonMessage()`][receiver_abandon], [`deferMessage()`][receiver_defer] or [`deadLetterMessage()`][receiver_deadletter] on the receiver based on how you want to settle the message. - -To learn more, please read [Settling Received Messages](/azure/service-bus-messaging/message-transfers-locks-settlement#settling-receive-operations) - -## Dead letter queues - -The dead letter queue is a **sub-queue**. Each queue or subscription has its own dead letter queue. Dead letter queues store -messages that have been explicitly dead lettered (via [`receiver.deadLetterMessage()`][receiver_deadletter]), or messages that have exceeded -their maximum delivery count. - -Creating a receiver for a dead letter sub-queue is similar to creating a receiver for a subscription or queue: - -```javascript -// To receive from a queue's dead letter sub-queue -const deadLetterReceiverForQueue = serviceBusClient.createReceiver("queue", { - subQueueType: "deadLetter" -}); - -// To receive from a subscription's dead letter sub-queue -const deadLetterReceiverForSubscription = serviceBusClient.createReceiver("topic", "subscription", { - subQueueType: "deadLetter" -}); - -// Dead letter receivers work like any other receiver connected to a queue -// ex: -const messages = await deadLetterReceiverForQueue.receiveMessages(5); - -for (const message of messages) { - console.log(`Dead lettered message: ${message.body}`); -} -``` - -Full samples demonstrating dead letter queues more thoroughly: - -- [Using receiver.deadLetterMessage() to explicitly send messages to the dead letter sub-queue](https://github.com/Azure/azure-sdk-for-js/blob/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus/samples/v7/typescript/src/advanced/movingMessagesToDLQ.ts) -- [Receiving messages from the dead letter sub-queue](https://github.com/Azure/azure-sdk-for-js/blob/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus/samples/v7/typescript/src/advanced/processMessageFromDLQ.ts) - -### Send messages using Sessions - -> Using sessions requires you to create a session enabled Queue or Subscription. You can -> read more about how to configure this feature in the portal [here][docsms_messagesessions_fifo]. - -In order to send messages to a session, use the `ServiceBusClient` to create a sender using -[createSender][sbclient_createsender]. - -When sending the message, set the `sessionId` property in the message to ensure -your message lands in the right session. - -```javascript -const sender = serviceBusClient.createSender("my-session-queue"); -await sender.sendMessages({ - body: "my-message-body", - sessionId: "my-session" -}); -``` - -You can read more about how sessions work [here][docsms_messagesessions]. - -### Receive messages from Sessions - -> Using sessions requires you to create a session enabled Queue or Subscription. You can -> read more about how to configure this feature in the portal [here][docsms_messagesessions_fifo]. - -Unlike non-session-enabled Queues or Subscriptions, only a single receiver -can read from a session at any time. This is enforced by _locking_ a session, -which is handled by Service Bus. Conceptually, this is similar to how message -locking works when using `peekLock` mode - when a message (or session) is -locked your receiver has exclusive access to it. - -In order to open and lock a session, use an instance of `ServiceBusClient` to create a [SessionReceiver][sessionreceiver]. - -There are two ways of choosing which session to open: - -1. Specify a `sessionId`, which locks a named session. - - ```javascript - const receiver = await serviceBusClient.acceptSession("my-session-queue", "my-session"); - ``` - -2. Do not specify a session id. In this case Service Bus will find the next available session - that is not already locked. - - ```javascript - const receiver = await serviceBusClient.acceptNextSession("my-session-queue"); - ``` - - You can find the name of the session via the `sessionId` property on the `SessionReceiver`. - If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - You can also [settle the messages](#settle-a-message) received in "peekLock" mode. - -Once the receiver is created you can use choose between 3 ways to receive messages: - -- [Get an array of messages](#get-an-array-of-messages) -- [Subscribe using a message handler](#subscribe-using-a-message-handler) -- [Use async iterator](#use-async-iterator) - -You can read more about how sessions work [here][docsms_messagesessions]. - -### Manage resources of a service bus namespace - -`ServiceBusAdministrationClient` lets you manage a namespace with CRUD operations on the entities(queues, topics, and subscriptions) and on the rules of a subscription. - -- Supports authentication with a service bus connection string as well as with the AAD credentials from `@azure/identity` similar to the `ServiceBusClient`. - -Note: Service Bus doesn't support setting CORS rules for namespaces yet, hence `ServiceBusAdministrationClient` won't work in the browser without disabling web-security. For more info, refer [here](https://github.com/Azure/azure-sdk-for-js/issues/4983). - -```js -// Get the connection string from the portal -// OR -// use the token credential overload, provide the host name of your Service Bus instance and the AAD credentials from the @azure/identity library -const serviceBusAdministrationClient = new ServiceBusAdministrationClient(""); - -// Similarly, you can create topics and subscriptions as well. -const createQueueResponse = await serviceBusAdministrationClient.createQueue(queueName); -console.log("Created queue with name - ", createQueueResponse.name); - -const queueRuntimeProperties = await serviceBusAdministrationClient.getQueueRuntimeProperties( - queueName -); -console.log("Number of messages in the queue = ", queueRuntimeProperties.totalMessageCount); - -await serviceBusAdministrationClient.deleteQueue(queueName); -``` - -- Sample for reference - [administrationClient.ts](https://github.com/Azure/azure-sdk-for-js/tree/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus/samples/v7/typescript/src/advanced/administrationClient.ts) - -## Troubleshooting - -Here's some initial steps to start diagnosing issues. For more information please refer to the [Service Bus Troubleshooting Guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus/TROUBLESHOOTING.md). - -### AMQP Dependencies - -The Service Bus library depends on the [rhea-promise](https://github.com/amqp/rhea-promise) library for managing connections, sending and receiving messages over the [AMQP](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol. - -### Logging - -You can set the following environment variable to get the debug logs when using this library. - -- Getting debug logs from the Service Bus SDK - -```bash -export DEBUG=azure* -``` - -- Getting debug logs from the Service Bus SDK and the protocol level library. - -```bash -export DEBUG=azure*,rhea* -``` - -- If you are **not interested in viewing the message transformation** (which consumes lot of console/disk space) then you can set the `DEBUG` environment variable as follows: - -```bash -export DEBUG=azure*,rhea*,-rhea:raw,-rhea:message,-azure:core-amqp:datatransformer -``` - -- If you are interested only in **errors**, then you can set the `DEBUG` environment variable as follows: - -```bash -export DEBUG=azure:service-bus:error,azure:core-amqp:error,rhea-promise:error,rhea:events,rhea:frames,rhea:io,rhea:flow -``` - -### Logging to a file - -1. Set the `DEBUG` environment variable as shown above -2. Run your test script as follows: - -- Logging statements from your test script go to `out.log` and logging statements from the sdk go to `debug.log`. - ```bash - node your-test-script.js > out.log 2>debug.log - ``` -- Logging statements from your test script and the sdk go to the same file `out.log` by redirecting stderr to stdout (&1), and then redirect stdout to a file: - ```bash - node your-test-script.js >out.log 2>&1 - ``` -- Logging statements from your test script and the sdk go to the same file `out.log`. - ```bash - node your-test-script.js &> out.log - ``` - -## Next steps - -Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus/samples) -directory for detailed examples on how to use this library to send and receive messages to/from -[Service Bus Queues, Topics and Subscriptions](/azure/service-bus-messaging/service-bus-messaging-overview). - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/service-bus_7.8.1-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fservicebus%2Fservice-bus%2FREADME.png) - -[apiref]: /javascript/api/@azure/service-bus/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/service-bus_7.8.1-beta.1/sdk/identity/identity/README.md -[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/service-bus_7.8.1-beta.1/sdk/identity/identity#defaultazurecredential -[sbclient]: /javascript/api/@azure/service-bus/servicebusclient -[sbclient_constructor]: /javascript/api/@azure/service-bus/servicebusclient#ServiceBusClient_string__ServiceBusClientOptions_ -[sbclient_tokencred_overload]: /javascript/api/@azure/service-bus/servicebusclient#ServiceBusClient_string__TokenCredential__ServiceBusClientOptions_ -[sbclient_createsender]: /javascript/api/@azure/service-bus/servicebusclient#createSender_string_ -[sbclient_createreceiver]: /javascript/api/@azure/service-bus/servicebusclient#createReceiver_string__CreateReceiverOptions__peekLock___ -[sbclient_acceptsession]: /javascript/api/@azure/service-bus/servicebusclient#acceptSession_string__string__AcceptSessionOptions__peekLock___ -[sender]: /javascript/api/@azure/service-bus/servicebussender -[sender_sendmessages]: /javascript/api/@azure/service-bus/servicebussender#sendMessages_ServiceBusMessage___ServiceBusMessage_____ServiceBusMessageBatch__OperationOptionsBase_ -[receiver]: /javascript/api/@azure/service-bus/servicebusreceiver -[receiver_receivemessages]: /javascript/api/@azure/service-bus/servicebusreceiver#receiveMessages_number__ReceiveMessagesOptions_ -[receiver_subscribe]: /javascript/api/@azure/service-bus/servicebusreceiver#subscribe_MessageHandlers_ReceivedMessageT___SubscribeOptions_ -[receiver_getmessageiterator]: /javascript/api/@azure/service-bus/servicebusreceiver#getMessageIterator_GetMessageIteratorOptions_ -[receiver_abandon]: /javascript/api/@azure/service-bus/servicebusreceiver#abandonMessage_ServiceBusReceivedMessage___key__string___any_ -[receiver_complete]: /javascript/api/@azure/service-bus/servicebusreceiver#completeMessage_ServiceBusReceivedMessage_ -[receiver_deadletter]: /javascript/api/@azure/service-bus/servicebusreceiver#deadLetterMessage_ServiceBusReceivedMessage__DeadLetterOptions____key__string___any_ -[receiver_defer]: /javascript/api/@azure/service-bus/servicebusreceiver#deferMessage_ServiceBusReceivedMessage___key__string___any_ -[sessionreceiver]: /javascript/api/@azure/service-bus/servicebussessionreceiver -[migrationguide]: https://github.com/Azure/azure-sdk-for-js/blob/@azure/service-bus_7.8.1-beta.1/sdk/servicebus/service-bus/migrationguide.md -[docsms_messagesessions]: /azure/service-bus-messaging/message-sessions -[docsms_messagesessions_fifo]: /azure/service-bus-messaging/message-sessions#first-in-first-out-fifo-pattern -[queue_concept]: /azure/service-bus-messaging/service-bus-messaging-overview#queues -[topic_concept]: /azure/service-bus-messaging/service-bus-messaging-overview#topics -[subscription_concept]: /azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions -[service_bus_overview]: /azure/service-bus-messaging/service-bus-messaging-overview - diff --git a/docs-ref-services/preview/storage-blob-readme.md b/docs-ref-services/preview/storage-blob-readme.md deleted file mode 100644 index 7177e4bb8b7d..000000000000 --- a/docs-ref-services/preview/storage-blob-readme.md +++ /dev/null @@ -1,545 +0,0 @@ ---- -title: Azure Storage Blob client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/storage-blob, storage -author: EmmaZhu -ms.author: emmazhu -ms.date: 08/11/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: storage ---- -# Azure Storage Blob client library for JavaScript - version 12.16.0-beta.1 - - -Azure Storage Blob is Microsoft's object storage solution for the cloud. Blob storage is optimized for storing massive amounts of unstructured data. Unstructured data is data that does not adhere to a particular data model or definition, such as text or binary data. - -This project provides a client library in JavaScript that makes it easy to consume Microsoft Azure Storage Blob service. - -Use the client libraries in this package to: - -- Get/Set Blob Service Properties -- Create/List/Delete Containers -- Create/Read/List/Update/Delete Block Blobs -- Create/Read/List/Update/Delete Page Blobs -- Create/Read/List/Update/Delete Append Blobs - -Key links - -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-blob_12.16.0-beta.1/sdk/storage/storage-blob) -- [Package (npm)](https://www.npmjs.com/package/@azure/storage-blob/) -- [API Reference Documentation](/javascript/api/@azure/storage-blob) -- [Product documentation](/azure/storage/blobs/storage-blobs-overview) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-blob_12.16.0-beta.1/sdk/storage/storage-blob/samples) -- [Azure Storage Blob REST APIs](/rest/api/storageservices/blob-service-rest-api) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-blob_12.16.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- A [Storage Account](/azure/storage/blobs/storage-quickstart-blobs-portal) - -### Install the package - -The preferred way to install the Azure Storage Blob client library for JavaScript is to use the npm package manager. Type the following into a terminal window: - -```bash -npm install @azure/storage-blob -``` - -### Authenticate the client - -Azure Storage supports several ways to authenticate. In order to interact with the Azure Blob Storage service you'll need to create an instance of a Storage client - `BlobServiceClient`, `ContainerClient`, or `BlobClient` for example. See [samples for creating the `BlobServiceClient`](#create-the-blob-service-client) to learn more about authentication. - -- [Azure Active Directory](#with-defaultazurecredential-from-azureidentity-package) -- [Shared Key](#with-storagesharedkeycredential) -- [Shared access signatures](#with-sas-token) - -#### Azure Active Directory - -The Azure Blob Storage service supports the use of Azure Active Directory to authenticate requests to its APIs. The [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) package provides a variety of credential types that your application can use to do this. Please see the [README for `@azure/identity`](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-blob_12.16.0-beta.1/sdk/identity/identity/README.md) for more details and samples to get you started. - -### Compatibility - -This library is compatible with Node.js and browsers, and validated against LTS Node.js versions (>=8.16.0) and latest versions of Chrome, Firefox and Edge. - -#### Web Workers - -This library requires certain DOM objects to be globally available when used in the browser, which web workers do not make available by default. You will need to polyfill these to make this library work in web workers. - -For more information please refer to our [documentation for using Azure SDK for JS in Web Workers](https://aka.ms/azsdk/js/web-workers) - -This library depends on following DOM APIs which need external polyfills loaded when used in web workers: - -- [`document`](https://developer.mozilla.org/docs/Web/API/Document) -- [`DOMParser`](https://developer.mozilla.org/docs/Web/API/DOMParser) -- [`Node`](https://developer.mozilla.org/docs/Web/API/Node) -- [`XMLSerializer`](https://developer.mozilla.org/docs/Web/API/XMLSerializer) - -#### Differences between Node.js and browsers - -There are differences between Node.js and browsers runtime. When getting started with this library, pay attention to APIs or classes marked with _"ONLY AVAILABLE IN NODE.JS RUNTIME"_ or _"ONLY AVAILABLE IN BROWSERS"_. - -- If a blob holds compressed data in `gzip` or `deflate` format and its content encoding is set accordingly, downloading behavior is different between Node.js and browsers. In Node.js storage clients will download the blob in its compressed format, while in browsers the data will be downloaded in de-compressed format. - -##### Features, interfaces, classes or functions only available in Node.js - -- Shared Key Authorization based on account name and account key - - `StorageSharedKeyCredential` -- Shared Access Signature(SAS) generation - - `generateAccountSASQueryParameters()` - - `generateBlobSASQueryParameters()` -- Parallel uploading and downloading. Note that `BlockBlobClient.uploadData()` is available in both Node.js and browsers. - - `BlockBlobClient.uploadFile()` - - `BlockBlobClient.uploadStream()` - - `BlobClient.downloadToBuffer()` - - `BlobClient.downloadToFile()` - -##### Features, interfaces, classes or functions only available in browsers - -- Parallel uploading and downloading - - `BlockBlobClient.uploadBrowserData()` - -### JavaScript Bundle - -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -### CORS - -You need to set up [Cross-Origin Resource Sharing (CORS)](/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) rules for your storage account if you need to develop for browsers. Go to Azure portal and Azure Storage Explorer, find your storage account, create new CORS rules for blob/queue/file/table service(s). - -For example, you can create following CORS settings for debugging. But please customize the settings carefully according to your requirements in production environment. - -- Allowed origins: \* -- Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT -- Allowed headers: \* -- Exposed headers: \* -- Maximum age (seconds): 86400 - -## Key concepts - -Blob storage is designed for: - -- Serving images or documents directly to a browser. -- Storing files for distributed access. -- Streaming video and audio. -- Writing to log files. -- Storing data for backup and restore, disaster recovery, and archiving. -- Storing data for analysis by an on-premises or Azure-hosted service. - -Blob storage offers three types of resources: - -- The _storage account_ used via `BlobServiceClient` -- A _container_ in the storage account used via `ContainerClient` -- A _blob_ in a container used via `BlobClient` - -## Examples - -- [Import the package](#import-the-package) -- [Create the blob service client](#create-the-blob-service-client) -- [Create a new container](#create-a-new-container) -- [List the containers](#list-the-containers) -- [Create a blob by uploading data](#create-a-blob-by-uploading-data) -- [List blobs inside a container](#list-blobs-inside-a-container) -- [Download a blob and convert it to a string (Node.js)](#download-a-blob-and-convert-it-to-a-string-nodejs) -- [Download a blob and convert it to a string (Browsers)](#download-a-blob-and-convert-it-to-a-string-browsers) - -### Import the package - -To use the clients, import the package into your file: - -```javascript -const AzureStorageBlob = require("@azure/storage-blob"); -``` - -Alternatively, selectively import only the types you need: - -```javascript -const { BlobServiceClient, StorageSharedKeyCredential } = require("@azure/storage-blob"); -``` - -### Create the blob service client - -The `BlobServiceClient` requires an URL to the blob service and an access credential. It also optionally accepts some settings in the `options` parameter. - -#### with `DefaultAzureCredential` from `@azure/identity` package - -**Recommended way to instantiate a `BlobServiceClient`** - -Setup : Reference - Authorize access to blobs and queues with Azure Active Directory from a client application - /azure/storage/common/storage-auth-aad-app - -- Register a new AAD application and give permissions to access Azure Storage on behalf of the signed-in user - - - Register a new application in the Azure Active Directory(in the azure-portal) - /azure/active-directory/develop/quickstart-register-app - - In the `API permissions` section, select `Add a permission` and choose `Microsoft APIs`. - - Pick `Azure Storage` and select the checkbox next to `user_impersonation` and then click `Add permissions`. This would allow the application to access Azure Storage on behalf of the signed-in user. - -- Grant access to Azure Blob data with RBAC in the Azure Portal - - - RBAC roles for blobs and queues - /azure/storage/common/storage-auth-aad-rbac-portal. - - In the azure portal, go to your storage-account and assign **Storage Blob Data Contributor** role to the registered AAD application from `Access control (IAM)` tab (in the left-side-navbar of your storage account in the azure-portal). - -- Environment setup for the sample - - From the overview page of your AAD Application, note down the `CLIENT ID` and `TENANT ID`. In the "Certificates & Secrets" tab, create a secret and note that down. - - Make sure you have AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET as environment variables to successfully execute the sample(Can leverage process.env). - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { BlobServiceClient } = require("@azure/storage-blob"); - -// Enter your storage account name -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const blobServiceClient = new BlobServiceClient( - `https://${account}.blob.core.windows.net`, - defaultAzureCredential -); -``` - -See the [Azure AD Auth sample](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-blob_12.16.0-beta.1/sdk/storage/storage-blob/samples/v12/javascript/azureAdAuth.js) for a complete example using this method. - -[Note - Above steps are only for Node.js] - -#### using connection string - -Alternatively, you can instantiate a `BlobServiceClient` using the `fromConnectionString()` static method with the full connection string as the argument. (The connection string can be obtained from the azure portal.) [ONLY AVAILABLE IN NODE.JS RUNTIME] - -```javascript -const { BlobServiceClient } = require("@azure/storage-blob"); - -const connStr = ""; - -const blobServiceClient = BlobServiceClient.fromConnectionString(connStr); -``` - -#### with `StorageSharedKeyCredential` - -Alternatively, you instantiate a `BlobServiceClient` with a `StorageSharedKeyCredential` by passing account-name and account-key as arguments. (The account-name and account-key can be obtained from the azure portal.) -[ONLY AVAILABLE IN NODE.JS RUNTIME] - -```javascript -const { BlobServiceClient, StorageSharedKeyCredential } = require("@azure/storage-blob"); - -// Enter your storage account name and shared key -const account = ""; -const accountKey = ""; - -// Use StorageSharedKeyCredential with storage account and account key -// StorageSharedKeyCredential is only available in Node.js runtime, not in browsers -const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey); -const blobServiceClient = new BlobServiceClient( - `https://${account}.blob.core.windows.net`, - sharedKeyCredential -); -``` - -#### with SAS Token - -Also, You can instantiate a `BlobServiceClient` with a shared access signatures (SAS). You can get the SAS token from the Azure Portal or generate one using `generateAccountSASQueryParameters()`. - -```javascript -const { BlobServiceClient } = require("@azure/storage-blob"); - -const account = ""; -const sas = ""; - -const blobServiceClient = new BlobServiceClient(`https://${account}.blob.core.windows.net${sas}`); -``` - -### Create a new container - -Use `BlobServiceClient.getContainerClient()` to get a container client instance then create a new container resource. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { BlobServiceClient } = require("@azure/storage-blob"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const blobServiceClient = new BlobServiceClient( - `https://${account}.blob.core.windows.net`, - defaultAzureCredential -); - -async function main() { - // Create a container - const containerName = `newcontainer${new Date().getTime()}`; - const containerClient = blobServiceClient.getContainerClient(containerName); - const createContainerResponse = await containerClient.create(); - console.log(`Create container ${containerName} successfully`, createContainerResponse.requestId); -} - -main(); -``` - -### List the containers - -Use `BlobServiceClient.listContainers()` function to iterate the containers, -with the new `for-await-of` syntax: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { BlobServiceClient } = require("@azure/storage-blob"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const blobServiceClient = new BlobServiceClient( - `https://${account}.blob.core.windows.net`, - defaultAzureCredential -); - -async function main() { - let i = 1; - let containers = blobServiceClient.listContainers(); - for await (const container of containers) { - console.log(`Container ${i++}: ${container.name}`); - } -} - -main(); -``` - -Alternatively without using `for-await-of`: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { BlobServiceClient } = require("@azure/storage-blob"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const blobServiceClient = new BlobServiceClient( - `https://${account}.blob.core.windows.net`, - defaultAzureCredential -); - -async function main() { - let i = 1; - let iter = blobServiceClient.listContainers(); - let containerItem = await iter.next(); - while (!containerItem.done) { - console.log(`Container ${i++}: ${containerItem.value.name}`); - containerItem = await iter.next(); - } -} - -main(); -``` - -In addition, pagination is supported for listing too via `byPage()`: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { BlobServiceClient } = require("@azure/storage-blob"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const blobServiceClient = new BlobServiceClient( - `https://${account}.blob.core.windows.net`, - defaultAzureCredential -); - -async function main() { - let i = 1; - for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - if (response.containerItems) { - for (const container of response.containerItems) { - console.log(`Container ${i++}: ${container.name}`); - } - } - } -} - -main(); -``` - -For a complete sample on iterating containers please see [samples/v12/typescript/src/listContainers.ts](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-blob_12.16.0-beta.1/sdk/storage/storage-blob/samples/v12/typescript/src/listContainers.ts). - -### Create a blob by uploading data - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { BlobServiceClient } = require("@azure/storage-blob"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const blobServiceClient = new BlobServiceClient( - `https://${account}.blob.core.windows.net`, - defaultAzureCredential -); - -const containerName = ""; - -async function main() { - const containerClient = blobServiceClient.getContainerClient(containerName); - - const content = "Hello world!"; - const blobName = "newblob" + new Date().getTime(); - const blockBlobClient = containerClient.getBlockBlobClient(blobName); - const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - console.log(`Upload block blob ${blobName} successfully`, uploadBlobResponse.requestId); -} - -main(); -``` - -### List blobs inside a container - -Similar to listing containers. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { BlobServiceClient } = require("@azure/storage-blob"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const blobServiceClient = new BlobServiceClient( - `https://${account}.blob.core.windows.net`, - defaultAzureCredential -); - -const containerName = ""; - -async function main() { - const containerClient = blobServiceClient.getContainerClient(containerName); - - let i = 1; - let blobs = containerClient.listBlobsFlat(); - for await (const blob of blobs) { - console.log(`Blob ${i++}: ${blob.name}`); - } -} - -main(); -``` - -For a complete sample on iterating blobs please see [samples/v12/typescript/src/listBlobsFlat.ts](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-blob_12.16.0-beta.1/sdk/storage/storage-blob/samples/v12/typescript/src/listBlobsFlat.ts). - -### Download a blob and convert it to a string (Node.js) - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { BlobServiceClient } = require("@azure/storage-blob"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const blobServiceClient = new BlobServiceClient( - `https://${account}.blob.core.windows.net`, - defaultAzureCredential -); - -const containerName = ""; -const blobName = ""; - -async function main() { - const containerClient = blobServiceClient.getContainerClient(containerName); - const blobClient = containerClient.getBlobClient(blobName); - - // Get blob content from position 0 to the end - // In Node.js, get downloaded data by accessing downloadBlockBlobResponse.readableStreamBody - const downloadBlockBlobResponse = await blobClient.download(); - const downloaded = ( - await streamToBuffer(downloadBlockBlobResponse.readableStreamBody) - ).toString(); - console.log("Downloaded blob content:", downloaded); - - // [Node.js only] A helper method used to read a Node.js readable stream into a Buffer - async function streamToBuffer(readableStream) { - return new Promise((resolve, reject) => { - const chunks = []; - readableStream.on("data", (data) => { - chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - }); - readableStream.on("end", () => { - resolve(Buffer.concat(chunks)); - }); - readableStream.on("error", reject); - }); - } -} - -main(); -``` - -### Download a blob and convert it to a string (Browsers). - -Please refer to the [JavaScript Bundle](#javascript-bundle) section for more information on using this library in the browser. - -```javascript -const { BlobServiceClient } = require("@azure/storage-blob"); - -const account = ""; -const sas = ""; -const containerName = ""; -const blobName = ""; - -const blobServiceClient = new BlobServiceClient(`https://${account}.blob.core.windows.net${sas}`); - -async function main() { - const containerClient = blobServiceClient.getContainerClient(containerName); - const blobClient = containerClient.getBlobClient(blobName); - - // Get blob content from position 0 to the end - // In browsers, get downloaded data by accessing downloadBlockBlobResponse.blobBody - const downloadBlockBlobResponse = await blobClient.download(); - const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - console.log("Downloaded blob content", downloaded); - - // [Browsers only] A helper method used to convert a browser Blob into string. - async function blobToString(blob) { - const fileReader = new FileReader(); - return new Promise((resolve, reject) => { - fileReader.onloadend = (ev) => { - resolve(ev.target.result); - }; - fileReader.onerror = reject; - fileReader.readAsText(blob); - }); - } -} - -main(); -``` - -A complete example of simple scenarios is at [samples/v12/typescript/src/sharedKeyAuth.ts](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-blob_12.16.0-beta.1/sdk/storage/storage-blob/samples/v12/typescript/src/sharedKeyAuth.ts). - -## Troubleshooting - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -## Next steps - -More code samples: - -- [Blob Storage Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-blob_12.16.0-beta.1/sdk/storage/storage-blob/samples/v12/javascript) -- [Blob Storage Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-blob_12.16.0-beta.1/sdk/storage/storage-blob/samples/v12/typescript) -- [Blob Storage Test Cases](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-blob_12.16.0-beta.1/sdk/storage/storage-blob/test/) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-blob_12.16.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -Also refer to [Storage specific guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-blob_12.16.0-beta.1/sdk/storage/CONTRIBUTING.md) for additional information on setting up the test environment for storage libraries. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Fstorage-blob%2FREADME.png) - diff --git a/docs-ref-services/preview/storage-file-datalake-readme.md b/docs-ref-services/preview/storage-file-datalake-readme.md deleted file mode 100644 index 4b834ec1fa1a..000000000000 --- a/docs-ref-services/preview/storage-file-datalake-readme.md +++ /dev/null @@ -1,597 +0,0 @@ ---- -title: Azure Storage File Data Lake client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/storage-file-datalake, storage -author: EmmaZhu -ms.author: emmazhu -ms.date: 08/11/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: storage ---- -# Azure Storage File Data Lake client library for JavaScript - version 12.15.0-beta.1 - - -Azure Data Lake Storage (ADLS) includes all the capabilities required to make it easy for developers, data scientists, and analysts to store data of any size, shape, and speed, and do all types of processing and analytics across platforms and languages. It removes the complexities of ingesting and storing all of your data while making it faster to get up and running with batch, streaming, and interactive analytics. - -This project provides a client library in JavaScript that makes it easy to consume Microsoft Azure Storage Data Lake service. - -Use the client libraries in this package to: - -- Create/List/Delete File Systems -- Create/Read/List/Update/Delete Paths, Directories and Files - -key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-datalake_12.15.0-beta.1/sdk/storage/storage-file-datalake) -- [Package (npm)](https://www.npmjs.com/package/@azure/storage-file-datalake) -- [API Reference Documentation](/javascript/api/@azure/storage-file-datalake) -- [Product documentation](/azure/storage/blobs/data-lake-storage-introduction?toc=%2fazure%2fstorage%2fblobs%2ftoc.json) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-datalake_12.15.0-beta.1/sdk/storage/storage-file-datalake/samples) -- [Azure Storage Data Lake REST APIs](/rest/api/storageservices/data-lake-storage-gen2) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-file-datalake_12.15.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- A [Storage Account](/azure/storage/common/storage-account-create) - -### Install the package - -The preferred way to install the Azure Storage Data Lake client library for JavaScript is to use the npm package manager. Type the following into a terminal window: - -```bash -npm install @azure/storage-file-datalake -``` - -### Authenticate the client - -Azure Storage supports several ways to authenticate. In order to interact with the Azure Data Lake Storage service you'll need to create an instance of a Storage client - `DataLakeServiceClient`, `DataLakeFileSystemClient`, or `DataLakePathClient` for example. See [samples for creating the `DataLakeServiceClient`](#create-the-data-lake-service-client) to learn more about authentication. - -- [Azure Active Directory](#with-defaultazurecredential-from-azureidentity-package) -- [Shared Key](#with-storagesharedkeycredential) -- [Shared access signatures](#with-sas-token) - -#### Azure Active Directory - -The Azure Data Lake Storage service supports the use of Azure Active Directory to authenticate requests to its APIs. The [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) package provides a variety of credential types that your application can use to do this. Please see the [README for `@azure/identity`](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-file-datalake_12.15.0-beta.1/sdk/identity/identity/README.md) for more details and samples to get you started. - -### Compatibility - -This library is compatible with Node.js and browsers, and validated against LTS Node.js versions (>=8.16.0) and latest versions of Chrome, Firefox and Edge. - -#### Web Workers - -This library requires certain DOM objects to be globally available when used in the browser, which web workers do not make available by default. You will need to polyfill these to make this library work in web workers. - -For more information please refer to our [documentation for using Azure SDK for JS in Web Workers](https://aka.ms/azsdk/js/web-workers) - -This library depends on following DOM APIs which need external polyfills loaded when used in web workers: - -- [`document`](https://developer.mozilla.org/docs/Web/API/Document) -- [`DOMParser`](https://developer.mozilla.org/docs/Web/API/DOMParser) -- [`Node`](https://developer.mozilla.org/docs/Web/API/Node) -- [`XMLSerializer`](https://developer.mozilla.org/docs/Web/API/XMLSerializer) - -#### Differences between Node.js and browsers - -There are differences between Node.js and browsers runtime. When getting started with this library, pay attention to APIs or classes marked with _"ONLY AVAILABLE IN NODE.JS RUNTIME"_ or _"ONLY AVAILABLE IN BROWSERS"_. - -- If a file holds compressed data in `gzip` or `deflate` format and its content encoding is set accordingly, downloading behavior is different between Node.js and browsers. In Node.js storage clients will download the file in its compressed format, while in browsers the data will be downloaded in de-compressed format. - -##### Features, interfaces, classes or functions only available in Node.js - -- Shared Key Authorization based on account name and account key - - `StorageSharedKeyCredential` -- Shared Access Signature(SAS) generation - - `generateAccountSASQueryParameters()` - - `generateDataLakeSASQueryParameters()` -- Parallel uploading and downloading. Note that `DataLakeFileClient.upload()` is available in both Node.js and browsers. - - `DataLakeFileClient.uploadFile()` - - `DataLakeFileClient.uploadStream()` - - `DataLakeFileClient.readToBuffer()` - - `DataLakeFileClient.readToFile()` - -##### Features, interfaces, classes or functions only available in browsers - -- N/A - -### JavaScript Bundle - -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -### CORS - -You need to set up [Cross-Origin Resource Sharing (CORS)](/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) rules for your storage account if you need to develop for browsers. Go to Azure portal and Azure Storage Explorer, find your storage account, create new CORS rules for blob/queue/file/table service(s). - -For example, you can create following CORS settings for debugging. But please customize the settings carefully according to your requirements in production environment. - -- Allowed origins: \* -- Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT -- Allowed headers: \* -- Exposed headers: \* -- Maximum age (seconds): 86400 - -> Notice: Data Lake currently shares CORS settings for blob service. - -## Key concepts - -Azure Data Lake Storage Gen2 was designed to: - -- Serve multiple petabytes of information while sustaining hundreds of gigabits of throughput -- Allow you to easily manage massive amounts of data - -Key Features of DataLake Storage Gen2 include: - -- Hadoop compatible access -- A super set of POSIX permissions -- Cost effective in terms of low-cost storage capacity and transactions -- Optimized driver for big data analytics - -A fundamental part of Data Lake Storage Gen2 is the addition of a hierarchical namespace to Blob storage. The hierarchical namespace organizes objects/files into a hierarchy of directories for efficient data access. - -In the past, cloud-based analytics had to compromise in areas of performance, management, and security. Data Lake Storage Gen2 addresses each of these aspects in the following ways: - -- Performance is optimized because you do not need to copy or transform data as a prerequisite for analysis. The hierarchical namespace greatly improves the performance of directory management operations, which improves overall job performance. -- Management is easier because you can organize and manipulate files through directories and subdirectories. -- Security is enforceable because you can define POSIX permissions on directories or individual files. -- Cost effectiveness is made possible as Data Lake Storage Gen2 is built on top of the low-cost Azure Blob storage. The additional features further lower the total cost of ownership for running big data analytics on Azure. - -Data Lake storage offers three types of resources: - -- The _storage account_ used via `DataLakeServiceClient` -- A _file system_ in the storage account used via `DataLakeFileSystemClient` -- A _path_ in a file system used via `DataLakeDirectoryClient` or `DataLakeFileClient` - -| Azure DataLake Gen2 | Blob | -| ------------------------ | --------- | -| Filesystem | Container | -| Path (File or Directory) | Blob | - -> Note: This client library only supports storage accounts with hierarchical namespace (HNS) enabled. - -## Examples - -- [Import the package](#import-the-package) -- [Create the data lake service client](#create-the-data-lake-service-client) -- [Create a new file system](#create-a-new-file-system) -- [List the file systems](#list-the-file-systems) -- [Create and delete a directory](#create-and-delete-a-directory) -- [Create a file](#create-a-file) -- [List paths inside a file system](#list-paths-inside-a-file-system) -- [Download a file and convert it to a string (Node.js)](#download-a-file-and-convert-it-to-a-string-nodejs) -- [Download a file and convert it to a string (Browsers)](#download-a-file-and-convert-it-to-a-string-browsers) - -### Import the package - -To use the clients, import the package into your file: - -```javascript -const AzureStorageDataLake = require("@azure/storage-file-datalake"); -``` - -Alternatively, selectively import only the types you need: - -```javascript -const { - DataLakeServiceClient, - StorageSharedKeyCredential -} = require("@azure/storage-file-datalake"); -``` - -### Create the data lake service client - -The `DataLakeServiceClient` requires an URL to the data lake service and an access credential. It also optionally accepts some settings in the `options` parameter. - -#### with `DefaultAzureCredential` from `@azure/identity` package - -**Recommended way to instantiate a `DataLakeServiceClient`** - -> Notice. Azure Data Lake currently reuses blob related roles like "Storage Blob Data Owner" during following AAD OAuth authentication. - -Setup : Reference - Authorize access to blobs (data lake) and queues with Azure Active Directory from a client application - /azure/storage/common/storage-auth-aad-app - -- Register a new AAD application and give permissions to access Azure Storage on behalf of the signed-in user. - - - Register a new application in the Azure Active Directory(in the azure-portal) - /azure/active-directory/develop/quickstart-register-app - - In the `API permissions` section, select `Add a permission` and choose `Microsoft APIs`. - - Pick `Azure Storage` and select the checkbox next to `user_impersonation` and then click `Add permissions`. This would allow the application to access Azure Storage on behalf of the signed-in user. - -- Grant access to Azure Data Lake data with RBAC in the Azure Portal - - - RBAC roles for blobs (data lake) and queues - /azure/storage/common/storage-auth-aad-rbac-portal. - - In the azure portal, go to your storage-account and assign **Storage Blob Data Contributor** role to the registered AAD application from `Access control (IAM)` tab (in the left-side-navbar of your storage account in the azure-portal). - -- Environment setup for the sample - - From the overview page of your AAD Application, note down the `CLIENT ID` and `TENANT ID`. In the "Certificates & Secrets" tab, create a secret and note that down. - - Make sure you have AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET as environment variables to successfully execute the sample(Can leverage process.env). - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -// Enter your storage account name -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - defaultAzureCredential -); -``` - -See the [Azure AD Auth sample](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-file-datalake_12.15.0-beta.1/sdk/storage/storage-blob/samples/v12/javascript/azureAdAuth.js) for a complete example using this method. - -[Note - Above steps are only for Node.js] - -#### using connection string - -Alternatively, you can instantiate a `DataLakeServiceClient` using the `fromConnectionString()` static method with the full connection string as the argument. (The connection string can be obtained from the azure portal.) -[ONLY AVAILABLE IN NODE.JS RUNTIME] - -```javascript -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const connStr = ""; - -const dataLakeServiceClient = DataLakeServiceClient.fromConnectionString(connStr); -``` - -#### with `StorageSharedKeyCredential` - -Alternatively, you instantiate a `DataLakeServiceClient` with a `StorageSharedKeyCredential` by passing account-name and account-key as arguments. (The account-name and account-key can be obtained from the azure portal.) -[ONLY AVAILABLE IN NODE.JS RUNTIME] - -```javascript -const { - DataLakeServiceClient, - StorageSharedKeyCredential -} = require("@azure/storage-file-datalake"); - -// Enter your storage account name and shared key -const account = ""; -const accountKey = ""; - -// Use StorageSharedKeyCredential with storage account and account key -// StorageSharedKeyCredential is only available in Node.js runtime, not in browsers -const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey); -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - sharedKeyCredential -); -``` - -#### with SAS Token - -Also, You can instantiate a `DataLakeServiceClient` with a shared access signatures (SAS). You can get the SAS token from the Azure Portal or generate one using `generateAccountSASQueryParameters()`. - -```javascript -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const sas = ""; -const serviceClientWithSAS = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net${sas}` -); -``` - -### Create a new file system - -Use `DataLakeServiceClient.getFileSystemClient()` to get a file system client instance then create a new file system resource. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - defaultAzureCredential -); - -async function main() { - // Create a file system - const fileSystemName = `newfilesystem${new Date().getTime()}`; - const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName); - const createResponse = await fileSystemClient.create(); - console.log(`Create file system ${fileSystemName} successfully`, createResponse.requestId); -} - -main(); -``` - -### List the file systems - -Use `DataLakeServiceClient.listFileSystems()` function to iterate the file systems, -with the new `for-await-of` syntax: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - defaultAzureCredential -); - -async function main() { - let i = 1; - let fileSystems = datalakeServiceClient.listFileSystems(); - for await (const fileSystem of fileSystems) { - console.log(`File system ${i++}: ${fileSystem.name}`); - } -} - -main(); -``` - -Alternatively without using `for-await-of`: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - defaultAzureCredential -); - -async function main() { - let i = 1; - let iter = datalakeServiceClient.listFileSystems(); - let fileSystemItem = await iter.next(); - while (!fileSystemItem.done) { - console.log(`File System ${i++}: ${fileSystemItem.value.name}`); - fileSystemItem = await iter.next(); - } -} - -main(); -``` - -In addition, pagination is supported for listing too via `byPage()`: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - defaultAzureCredential -); - -async function main() { - let i = 1; - for await (const response of datalakeServiceClient - .listFileSystems() - .byPage({ maxPageSize: 20 })) { - if (response.fileSystemItems) { - for (const fileSystem of response.fileSystemItems) { - console.log(`File System ${i++}: ${fileSystem.name}`); - } - } - } -} - -main(); -``` - -### Create and delete a directory - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - defaultAzureCredential -); - -const fileSystemName = ""; - -async function main() { - const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName); - const directoryClient = fileSystemClient.getDirectoryClient("directory"); - await directoryClient.create(); - await directoryClient.delete(); -} - -main(); -``` - -### Create a file - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - defaultAzureCredential -); - -const fileSystemName = ""; - -async function main() { - const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName); - - const content = "Hello world!"; - const fileName = "newfile" + new Date().getTime(); - const fileClient = fileSystemClient.getFileClient(fileName); - await fileClient.create(); - await fileClient.append(content, 0, content.length); - await fileClient.flush(content.length); - console.log(`Create and upload file ${fileName} successfully`); -} - -main(); -``` - -### List paths inside a file system - -Similar to listing file systems. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - defaultAzureCredential -); - -const fileSystemName = ""; - -async function main() { - const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName); - - let i = 1; - let paths = fileSystemClient.listPaths(); - for await (const path of paths) { - console.log(`Path ${i++}: ${path.name}, is directory: ${path.isDirectory}`); - } -} - -main(); -``` - -### Download a file and convert it to a string (Node.js) - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const defaultAzureCredential = new DefaultAzureCredential(); - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net`, - defaultAzureCredential -); - -const fileSystemName = ""; -const fileName = ""; - -async function main() { - const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName); - const fileClient = fileSystemClient.getFileClient(fileName); - - // Get file content from position 0 to the end - // In Node.js, get downloaded data by accessing downloadResponse.readableStreamBody - const downloadResponse = await fileClient.read(); - const downloaded = await streamToBuffer(downloadResponse.readableStreamBody); - console.log("Downloaded file content:", downloaded.toString()); - - // [Node.js only] A helper method used to read a Node.js readable stream into a Buffer. - async function streamToBuffer(readableStream) { - return new Promise((resolve, reject) => { - const chunks = []; - readableStream.on("data", (data) => { - chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - }); - readableStream.on("end", () => { - resolve(Buffer.concat(chunks)); - }); - readableStream.on("error", reject); - }); - } -} - -main(); -``` - -### Download a file and convert it to a string (Browsers) - -```javascript -const { DataLakeServiceClient } = require("@azure/storage-file-datalake"); - -const account = ""; -const sas="" - -const datalakeServiceClient = new DataLakeServiceClient( - `https://${account}.dfs.core.windows.net${sas}` -); - -const fileSystemName = ""; -const fileName = "" - -async function main() { - const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName); - const fileClient = fileSystemClient.getFileClient(fileName); - - // Get file content from position 0 to the end - // In browsers, get downloaded data by accessing downloadResponse.contentAsBlob - const downloadResponse = await fileClient.read(); - const downloaded = await blobToString(await downloadResponse.contentAsBlob); - console.log( - "Downloaded file content", - downloaded - ); - - // [Browsers only] A helper method used to convert a browser Blob into string. - async function blobToString(blob: Blob): Promise { - const fileReader = new FileReader(); - return new Promise((resolve, reject) => { - fileReader.onloadend = (ev: any) => { - resolve(ev.target!.result); - }; - fileReader.onerror = reject; - fileReader.readAsText(blob); - }); - } -} - -main(); -``` - -## Troubleshooting - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -## Next steps - -More code samples: - -- [DataLake Storage Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-datalake_12.15.0-beta.1/sdk/storage/storage-file-datalake/samples/v12/javascript) -- [DataLake Storage Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-datalake_12.15.0-beta.1/sdk/storage/storage-file-datalake/samples/v12/typescript) -- [DataLake Storage Test Cases](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-datalake_12.15.0-beta.1/sdk/storage/storage-file-datalake/test/) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-file-datalake_12.15.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Fstorage-blob%2FREADME.png) - diff --git a/docs-ref-services/preview/storage-file-share-readme.md b/docs-ref-services/preview/storage-file-share-readme.md deleted file mode 100644 index d92d7213ffbf..000000000000 --- a/docs-ref-services/preview/storage-file-share-readme.md +++ /dev/null @@ -1,523 +0,0 @@ ---- -title: Azure Storage File Share client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/storage-file-share, storage -author: EmmaZhu -ms.author: emmazhu -ms.date: 05/31/2023 -ms.topic: reference -ms.devlang: javascript -ms.service: storage ---- -# Azure Storage File Share client library for JavaScript - version 12.15.0-beta.1 - - -Azure Files offers fully managed file shares in the cloud that are accessible via the industry standard Server Message Block (SMB) protocol. Azure file shares can be mounted concurrently by cloud or on-premises deployments of Windows, Linux, and macOS. Additionally, Azure file shares can be cached on Windows Servers with Azure File Sync for fast access near where the data is being used. - -This project provides a client library in JavaScript that makes it easy to consume Microsoft Azure File Storage service. - -Use the client libraries in this package to: - -- Get/Set File Service Properties -- Create/List/Delete File Shares -- Create/List/Delete File Directories -- Create/Read/List/Update/Delete Files - -> Note: This package was previously published under the name `@azure/storage-file`. -> It has been renamed to `@azure/storage-file-share` to better align with the upcoming new package -> for Azure Storage Files DataLake and provide a consistent set of APIs for working with files on Azure. - -Key links: - -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-share_12.15.0-beta.1/sdk/storage/storage-file-share) -- [Package (npm)](https://www.npmjs.com/package/@azure/storage-file-share/) -- [API Reference Documentation](/javascript/api/@azure/storage-file-share) -- [Product documentation](/azure/storage/files/storage-files-introduction) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-share_12.15.0-beta.1/sdk/storage/storage-file-share/samples) -- [Azure Storage File REST APIs](/rest/api/storageservices/file-service-rest-api) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-file-share_12.15.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- A [Storage Account](/azure/storage/common/storage-account-create) - -### Install the package - -The preferred way to install the Azure File Storage client library for JavaScript is to use the npm package manager. Type the following into a terminal window: - -```bash -npm install @azure/storage-file-share -``` - -### Authenticate the client - -Azure Storage supports several ways to authenticate. In order to interact with the Azure Storage File Share service you'll need to create an instance of a Storage client - `ShareServiceClient`, `ShareClient`, or `ShareDirectoryClient` for example. See [samples for creating the `ShareServiceClient`](#create-the-share-service-client) to learn more about authentication. - -- [Shared Key](#with-storagesharedkeycredential) -- [Shared access signatures](#with-sas-token) - -### Compatibility - -This library is compatible with Node.js and browsers, and validated against LTS Node.js versions (>=8.16.0) and latest versions of Chrome, Firefox and Edge. - -#### Web Workers - -This library requires certain DOM objects to be globally available when used in the browser, which web workers do not make available by default. You will need to polyfill these to make this library work in web workers. - -For more information please refer to our [documentation for using Azure SDK for JS in Web Workers](https://aka.ms/azsdk/js/web-workers) - -This library depends on following DOM APIs which need external polyfills loaded when used in web workers: - -- [`document`](https://developer.mozilla.org/docs/Web/API/Document) -- [`DOMParser`](https://developer.mozilla.org/docs/Web/API/DOMParser) -- [`Node`](https://developer.mozilla.org/docs/Web/API/Node) -- [`XMLSerializer`](https://developer.mozilla.org/docs/Web/API/XMLSerializer) - -#### Differences between Node.js and browsers - -There are differences between Node.js and browsers runtime. When getting started with this library, pay attention to APIs or classes marked with _"ONLY AVAILABLE IN NODE.JS RUNTIME"_ or _"ONLY AVAILABLE IN BROWSERS"_. - -- If a file holds compressed data in `gzip` or `deflate` format and its content encoding is set accordingly, downloading behavior is different between Node.js and browsers. In Node.js storage clients will download the file in its compressed format, while in browsers the data will be downloaded in de-compressed format. - -##### Following features, interfaces, classes or functions are only available in Node.js - -- Shared Key Authorization based on account name and account key - - `StorageSharedKeyCredential` -- Shared Access Signature(SAS) generation - - `generateAccountSASQueryParameters()` - - `generateFileSASQueryParameters()` -- Parallel uploading and downloading. Note that `ShareFileClient.uploadData()` is available in both Node.js and browsers. - - `ShareFileClient.uploadFile()` - - `ShareFileClient.uploadStream()` - - `ShareFileClient.downloadToBuffer()` - - `ShareFileClient.downloadToFile()` - -##### Following features, interfaces, classes or functions are only available in browsers - -N/A - -### JavaScript Bundle - -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -### CORS - -You need to set up [Cross-Origin Resource Sharing (CORS)](/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) rules for your storage account if you need to develop for browsers. Go to Azure portal and Azure Storage Explorer, find your storage account, create new CORS rules for blob/queue/file/table service(s). - -For example, you can create following CORS settings for debugging. But please customize the settings carefully according to your requirements in production environment. - -- Allowed origins: \* -- Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT -- Allowed headers: \* -- Exposed headers: \* -- Maximum age (seconds): 86400 - -## Key concepts - -The following components and their corresponding client libraries make up the Azure Storage File Share service: - -- The _storage account_ itself, represented by a `ShareServiceClient` -- A _file share_ within the storage account, represented by a `ShareClient` -- An optional _hierarchy of directories_ within the file share, represented by `ShareDirectoryClient` instances -- A _file_ within the file share, which may be up to 1 TiB in size, represented by a `ShareFileClient` - -## Examples - -- [Import the package](#import-the-package) -- [Create the share service client](#create-the-share-service-client) -- [List shares in the account](#list-shares-in-the-account) -- [Create a new share and a directory](#create-a-new-share-and-a-directory) -- [Create an azure file then upload to it](#create-an-azure-file-then-upload-to-it) -- [List files and directories under a directory](#list-files-and-directories-under-a-directory) -- [Download a file and convert it to a string (Node.js)](#download-a-file-and-convert-it-to-a-string-nodejs) -- [Download a file and convert it to a string (Browsers)](#download-a-file-and-convert-it-to-a-string-browsers) - -### Import the package - -To use the clients, import the package into your file: - -```javascript -const AzureStorageFileShare = require("@azure/storage-file-share"); -``` - -Alternative, selectively import only the types you need: - -```javascript -const { ShareServiceClient, StorageSharedKeyCredential } = require("@azure/storage-file-share"); -``` - -### Create the share service client - -The `ShareServiceClient` requires an URL to the file share service and an access credential. It also optionally accepts some settings in the `options` parameter. - -#### using connection string - -Alternatively, you can instantiate a `ShareServiceClient` using the `fromConnectionString()` static method with the full connection string as the argument. (The connection string can be obtained from the azure portal.) - -```javascript -const { ShareServiceClient } = require("@azure/storage-file-share"); - -const connStr = ""; - -const shareServiceClient = ShareServiceClient.fromConnectionString(connStr); -``` - -#### with `StorageSharedKeyCredential` - -Pass in a `StorageSharedKeyCredential` with your account name and account key. (The account-name and account-key can be obtained from the azure portal.) - -```javascript -const { ShareServiceClient, StorageSharedKeyCredential } = require("@azure/storage-file-share"); - -// Enter your storage account name and shared key -const account = ""; -const accountKey = ""; - -// Use StorageSharedKeyCredential with storage account and account key -// StorageSharedKeyCredential is only available in Node.js runtime, not in browsers -const credential = new StorageSharedKeyCredential(account, accountKey); -const serviceClient = new ShareServiceClient( - // When using AnonymousCredential, following url should include a valid SAS - `https://${account}.file.core.windows.net`, - credential -); -``` - -#### with SAS Token - -Also, You can instantiate a `ShareServiceClient` with a shared access signatures (SAS). You can get the SAS token from the Azure Portal or generate one using `generateAccountSASQueryParameters()`. - -```javascript -const { ShareServiceClient } = require("@azure/storage-file-share"); - -const account = ""; -const sas = ""; - -const serviceClientWithSAS = new ShareServiceClient( - `https://${account}.file.core.windows.net${sas}` -); -``` - -### List shares in the account - -Use `ShareServiceClient.listShares()` to iterator shares in this account, -with the new `for-await-of` syntax: - -```javascript -const { ShareServiceClient, StorageSharedKeyCredential } = require("@azure/storage-file-share"); - -const account = ""; -const accountKey = ""; - -const credential = new StorageSharedKeyCredential(account, accountKey); -const serviceClient = new ShareServiceClient( - `https://${account}.file.core.windows.net`, - credential -); - -async function main() { - let shareIter = serviceClient.listShares(); - let i = 1; - for await (const share of shareIter) { - console.log(`Share${i}: ${share.name}`); - i++; - } -} - -main(); -``` - -Alternatively without `for-await-of`: - -```javascript -const { ShareServiceClient, StorageSharedKeyCredential } = require("@azure/storage-file-share"); - -const account = ""; -const accountKey = ""; - -const credential = new StorageSharedKeyCredential(account, accountKey); -const serviceClient = new ShareServiceClient( - `https://${account}.file.core.windows.net`, - credential -); - -async function main() { - let shareIter = serviceClient.listShares(); - let i = 1; - let shareItem = await shareIter.next(); - while (!shareItem.done) { - console.log(`Share ${i++}: ${shareItem.value.name}`); - shareItem = await shareIter.next(); - } -} - -main(); -``` - -### Create a new share and a directory - -```javascript -const { ShareServiceClient, StorageSharedKeyCredential } = require("@azure/storage-file-share"); - -const account = ""; -const accountKey = ""; - -const credential = new StorageSharedKeyCredential(account, accountKey); -const serviceClient = new ShareServiceClient( - `https://${account}.file.core.windows.net`, - credential -); - -async function main() { - const shareName = `newshare${new Date().getTime()}`; - const shareClient = serviceClient.getShareClient(shareName); - await shareClient.create(); - console.log(`Create share ${shareName} successfully`); - - const directoryName = `newdirectory${new Date().getTime()}`; - const directoryClient = shareClient.getDirectoryClient(directoryName); - await directoryClient.create(); - console.log(`Create directory ${directoryName} successfully`); -} - -main(); -``` - -### Create an azure file then upload to it - -```javascript -const { ShareServiceClient, StorageSharedKeyCredential } = require("@azure/storage-file-share"); - -const account = ""; -const accountKey = ""; - -const credential = new StorageSharedKeyCredential(account, accountKey); -const serviceClient = new ShareServiceClient( - `https://${account}.file.core.windows.net`, - credential -); - -const shareName = ""; -const directoryName = ""; - -async function main() { - const directoryClient = serviceClient.getShareClient(shareName).getDirectoryClient(directoryName); - - const content = "Hello World!"; - const fileName = "newfile" + new Date().getTime(); - const fileClient = directoryClient.getFileClient(fileName); - await fileClient.create(content.length); - console.log(`Create file ${fileName} successfully`); - - // Upload file range - await fileClient.uploadRange(content, 0, content.length); - console.log(`Upload file range "${content}" to ${fileName} successfully`); -} - -main(); -``` - -### List files and directories under a directory - -Use `DirectoryClient.listFilesAndDirectories()` to iterator over files and directories, -with the new `for-await-of` syntax. The `kind` property can be used to identify whether -a iterm is a directory or a file. - -```javascript -const { ShareServiceClient, StorageSharedKeyCredential } = require("@azure/storage-file-share"); - -const account = ""; -const accountKey = ""; - -const credential = new StorageSharedKeyCredential(account, accountKey); -const serviceClient = new ShareServiceClient( - `https://${account}.file.core.windows.net`, - credential -); - -const shareName = ""; -const directoryName = ""; - -async function main() { - const directoryClient = serviceClient.getShareClient(shareName).getDirectoryClient(directoryName); - - let dirIter = directoryClient.listFilesAndDirectories(); - let i = 1; - for await (const item of dirIter) { - if (item.kind === "directory") { - console.log(`${i} - directory\t: ${item.name}`); - } else { - console.log(`${i} - file\t: ${item.name}`); - } - i++; - } -} - -main(); -``` - -Alternatively without using `for-await-of`: - -```javascript -const { ShareServiceClient, StorageSharedKeyCredential } = require("@azure/storage-file-share"); - -const account = ""; -const accountKey = ""; - -const credential = new StorageSharedKeyCredential(account, accountKey); -const serviceClient = new ShareServiceClient( - `https://${account}.file.core.windows.net`, - credential -); - -const shareName = ""; -const directoryName = ""; - -async function main() { - const directoryClient = serviceClient.getShareClient(shareName).getDirectoryClient(directoryName); - - let dirIter = directoryClient.listFilesAndDirectories(); - let i = 1; - let item = await dirIter.next(); - while (!item.done) { - if (item.value.kind === "directory") { - console.log(`${i} - directory\t: ${item.value.name}`); - } else { - console.log(`${i} - file\t: ${item.value.name}`); - } - item = await dirIter.next(); - } -} - -main(); -``` - -For a complete sample on iterating please see [samples/v12/typescript/src/listFilesAndDirectories.ts](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-file-share_12.15.0-beta.1/sdk/storage/storage-file-share/samples/v12/typescript/src/listFilesAndDirectories.ts). - -### Download a file and convert it to a string (Node.js) - -```javascript -const { ShareServiceClient, StorageSharedKeyCredential } = require("@azure/storage-file-share"); - -const account = ""; -const accountKey = ""; - -const credential = new StorageSharedKeyCredential(account, accountKey); -const serviceClient = new ShareServiceClient( - `https://${account}.file.core.windows.net`, - credential -); - -const shareName = ""; -const fileName = ""; - -// [Node.js only] A helper method used to read a Node.js readable stream into a Buffer -async function streamToBuffer(readableStream) { - return new Promise((resolve, reject) => { - const chunks = []; - readableStream.on("data", (data) => { - chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - }); - readableStream.on("end", () => { - resolve(Buffer.concat(chunks)); - }); - readableStream.on("error", reject); - }); -} - -async function main() { - const fileClient = serviceClient - .getShareClient(shareName) - .rootDirectoryClient.getFileClient(fileName); - - // Get file content from position 0 to the end - // In Node.js, get downloaded data by accessing downloadFileResponse.readableStreamBody - const downloadFileResponse = await fileClient.download(); - console.log( - `Downloaded file content: ${( - await streamToBuffer(downloadFileResponse.readableStreamBody) - ).toString()}` - ); -} - -main(); -``` - -### Download a file and convert it to a string (Browsers) - -Please refer to the [JavaScript Bundle](#javascript-bundle) section for more information on using this library in the browser. - -```javascript -const { ShareServiceClient } = require("@azure/storage-file-share"); - -const account = ""; -const sas = ""; -const shareName = ""; -const fileName = ""; - -const serviceClient = new ShareServiceClient(`https://${account}.file.core.windows.net${sas}`); - -async function main() { - const fileClient = serviceClient - .getShareClient(shareName) - .rootDirectoryClient.getFileClient(fileName); - - // Get file content from position 0 to the end - // In browsers, get downloaded data by accessing downloadFileResponse.blobBody - const downloadFileResponse = await fileClient.download(0); - console.log( - `Downloaded file content: ${await blobToString(await downloadFileResponse.blobBody)}` - ); -} - -// [Browser only] A helper method used to convert a browser Blob into string. -async function blobToString(blob) { - const fileReader = new FileReader(); - return new Promise((resolve, reject) => { - fileReader.onloadend = (ev) => { - resolve(ev.target.result); - }; - fileReader.onerror = reject; - fileReader.readAsText(blob); - }); -} - -main(); -``` - -A complete example of simple `ShareServiceClient` scenarios is at [samples/v12/typescript/src/shareSerivceClient.ts](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-file-share_12.15.0-beta.1/sdk/storage/storage-file-share/samples/v12/typescript/src/shareServiceClient.ts). - -## Troubleshooting - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -const { setLogLevel } = require("@azure/logger"); - -setLogLevel("info"); -``` - -## Next steps - -More code samples - -- [File Share Storage Samples (JavaScript)](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-share_12.15.0-beta.1/sdk/storage/storage-file-share/samples/v12/javascript) -- [File Share Storage Samples (TypeScript)](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-share_12.15.0-beta.1/sdk/storage/storage-file-share/samples/v12/typescript) -- [File Share Storage Test Cases](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-file-share_12.15.0-beta.1/sdk/storage/storage-file-share/test) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-file-share_12.15.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -Also refer to [Storage specific guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-file-share_12.15.0-beta.1/sdk/storage/CONTRIBUTING.md) for additional information on setting up the test environment for storage libraries. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Fstorage-file-share%2FREADME.png) - diff --git a/docs-ref-services/preview/storage-queue-readme.md b/docs-ref-services/preview/storage-queue-readme.md deleted file mode 100644 index d48214a25618..000000000000 --- a/docs-ref-services/preview/storage-queue-readme.md +++ /dev/null @@ -1,471 +0,0 @@ ---- -title: Azure Storage Queue client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/storage-queue, storage -author: maggiepint -ms.author: magpint -ms.date: 11/09/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: storage -ms.subservice: queues ---- - -# Azure Storage Queue client library for JavaScript - version 12.8.0-beta.1 - - -Azure Storage Queue provides cloud messaging between application components. In designing applications for scale, application components are often decoupled, so that they can scale independently. Queue storage delivers asynchronous messaging for communication between application components, whether they are running in the cloud, on the desktop, on an on-premises server, or on a mobile device. Queue storage also supports managing asynchronous tasks and building process work flows. - -This project provides a client library in JavaScript that makes it easy to consume the Azure Storage Queue service. - -Use the client libraries in this package to: - -- Get/Set Queue Service Properties -- Create/List/Delete Queues -- Send/Receive/Peek/Clear/Update/Delete Queue Messages - -Key links: -- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-queue_12.8.0-beta.1/sdk/storage/storage-queue) -- [Package (npm)](https://www.npmjs.com/package/@azure/storage-queue) -- [API Reference Documentation](https://docs.microsoft.com/javascript/api/@azure/storage-queue) -- [Product documentation](https://docs.microsoft.com/azure/storage/queues/storage-queues-introduction) -- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-queue_12.8.0-beta.1/sdk/storage/storage-queue/samples) -- [Azure Storage Queue REST APIs](https://docs.microsoft.com/rest/api/storageservices/queue-service-rest-api) - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. - -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-queue_12.8.0-beta.1/SUPPORT.md) for more details. - -### Prerequisites - -- An [Azure subscription](https://azure.microsoft.com/free/) -- A [Storage Account](https://docs.microsoft.com/azure/storage/common/storage-account-create) - -### Install the package - -The preferred way to install the Azure Storage Queue client library for JavaScript is to use the npm package manager. Type the following into a terminal window: - -```bash -npm install @azure/storage-queue -``` - -### Authenticate the client - -Azure Storage supports several ways to authenticate. In order to interact with the Azure Queue Storage service you'll need to create an instance of a Storage client - `QueueServiceClient` or `QueueClient` for example. See [samples for creating the `QueueServiceClient`](#create-the-queue-service-client) to learn more about authentication. - -- [Azure Active Directory](#with-defaultazurecredential-from-azureidentity-package) -- [Shared Key](#with-storagesharedkeycredential) -- [Shared access signatures](#with-sas-token) - -#### Azure Active Directory - -The Azure Queue Storage service supports the use of Azure Active Directory to authenticate requests to its APIs. The [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) package provides a variety of credential types that your application can use to do this. Please see the [README for `@azure/identity`](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-queue_12.8.0-beta.1/sdk/identity/identity/README.md) for more details and samples to get you started. - -### Compatibility - -This library is compatible with Node.js and browsers, and validated against LTS Node.js versions (>=8.16.0) and latest versions of Chrome, Firefox and Edge. - -#### Web Workers - -This library requires certain DOM objects to be globally available when used in the browser, which web workers do not make available by default. You will need to polyfill these to make this library work in web workers. - -For more information please refer to our [documentation for using Azure SDK for JS in Web Workers](https://aka.ms/azsdk/js/web-workers) - -This library depends on following DOM APIs which need external polyfills loaded when used in web workers: - -- [`document`](https://developer.mozilla.org/docs/Web/API/Document) -- [`DOMParser`](https://developer.mozilla.org/docs/Web/API/DOMParser) -- [`Node`](https://developer.mozilla.org/docs/Web/API/Node) -- [`XMLSerializer`](https://developer.mozilla.org/docs/Web/API/XMLSerializer) - -#### Differences between Node.js and browsers - -There are differences between Node.js and browsers runtime. When getting started with this library, pay attention to APIs or classes marked with _"ONLY AVAILABLE IN NODE.JS RUNTIME"_ or _"ONLY AVAILABLE IN BROWSERS"_. - -##### Following features, interfaces, classes or functions are only available in Node.js - -- Shared Key Authorization based on account name and account key - - `StorageSharedKeyCredential` -- Shared Access Signature(SAS) generation - - `generateAccountSASQueryParameters()` - - `generateQueueSASQueryParameters()` - -### JavaScript Bundle - -To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). - -### CORS - -You need to set up [Cross-Origin Resource Sharing (CORS)](https://docs.microsoft.com/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services) rules for your storage account if you need to develop for browsers. Go to Azure portal and Azure Storage Explorer, find your storage account, create new CORS rules for blob/queue/file/table service(s). - -For example, you can create following CORS settings for debugging. But please customize the settings carefully according to your requirements in production environment. - -- Allowed origins: \* -- Allowed verbs: DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT -- Allowed headers: \* -- Exposed headers: \* -- Maximum age (seconds): 86400 - -## Key concepts - -A Queue is a data store within an Azure Storage Queue service account for sending/receiving messages -between connected clients. - -Key data types in our library related to these services are: - -- A `QueueServiceClient` represents a connection (via a URL) to a given _storage account_ in the Azure Storage Queue service and provides APIs for manipulating its queues. It is authenticated to the service and can be used to create `QueueClient` objects, as well as create, delete, list queues from the service. -- A `QueueClient` represents a single _queue_ in the storage account. It can be used to manipulate the queue's messages, for example to send, receive, and peek messages in the queue. - -## Examples - -### Import the package - -To use the clients, import the package into your file: - -```javascript -const AzureStorageQueue = require("@azure/storage-queue"); -``` - -Alternatively, selectively import only the types you need: - -```javascript -const { QueueServiceClient, StorageSharedKeyCredential } = require("@azure/storage-queue"); -``` - -### Create the queue service client - -The `QueueServiceClient` requires an URL to the queue service and an access credential. It also optionally accepts some settings in the `options` parameter. - -#### with `DefaultAzureCredential` from `@azure/identity` package - -**Recommended way to instantiate a `QueueServiceClient`** - -Setup : Reference - Authorize access to blobs and queues with Azure Active Directory from a client application - https://docs.microsoft.com/azure/storage/common/storage-auth-aad-app - -- Register a new AAD application and give permissions to access Azure Storage on behalf of the signed-in user - - - Register a new application in the Azure Active Directory(in the azure-portal) - https://docs.microsoft.com/azure/active-directory/develop/quickstart-register-app - - In the `API permissions` section, select `Add a permission` and choose `Microsoft APIs`. - - Pick `Azure Storage` and select the checkbox next to `user_impersonation` and then click `Add permissions`. This would allow the application to access Azure Storage on behalf of the signed-in user. - -- Grant access to Azure Storage Queue data with RBAC in the Azure Portal - - - RBAC roles for blobs and queues - https://docs.microsoft.com/azure/storage/common/storage-auth-aad-rbac-portal. - - In the azure portal, go to your storage-account and assign **Storage Queue Data Contributor** role to the registered AAD application from `Access control (IAM)` tab (in the left-side-navbar of your storage account in the azure-portal). - -- Environment setup for the sample - - From the overview page of your AAD Application, note down the `CLIENT ID` and `TENANT ID`. In the "Certificates & Secrets" tab, create a secret and note that down. - - Make sure you have `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET` as environment variables to successfully execute the sample (can leverage process.env). - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { QueueServiceClient } = require("@azure/storage-queue"); - -const account = ""; -const credential = new DefaultAzureCredential(); - -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net`, - credential -); -``` - -[Note - Above steps are only for Node.js] - -#### using connection string - -Alternatively, you can instantiate a `QueueServiceClient` using the `fromConnectionString()` static method with the full connection string as the argument. (The connection string can be obtained from the azure portal.) [ONLY AVAILABLE IN NODE.JS RUNTIME] - -```javascript -const { QueueServiceClient } = require("@azure/storage-queue"); - -const connStr = ""; - -const queueServiceClient = QueueServiceClient.fromConnectionString(connStr); -``` - -#### with `StorageSharedKeyCredential` - -Alternatively, you instantiate a `QueueServiceClient` with a `StorageSharedKeyCredential` by passing account-name and account-key as arguments. (The account-name and account-key can be obtained from the azure portal.) -[ONLY AVAILABLE IN NODE.JS RUNTIME] - -```javascript -const { QueueServiceClient, StorageSharedKeyCredential } = require("@azure/storage-queue"); - -// Enter your storage account name and shared key -const account = ""; -const accountKey = ""; - -// Use StorageSharedKeyCredential with storage account and account key -// StorageSharedKeyCredential is only available in Node.js runtime, not in browsers -const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey); - -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net`, - sharedKeyCredential, - { - retryOptions: { maxTries: 4 }, // Retry options - telemetry: { value: "BasicSample/V11.0.0" } // Customized telemetry string - } -); -``` - -#### with SAS Token - -Also, You can instantiate a `QueueServiceClient` with a shared access signatures (SAS). You can get the SAS token from the Azure Portal or generate one using `generateAccountSASQueryParameters()`. - -```javascript -const { QueueServiceClient } = require("@azure/storage-queue"); -const account = ""; -const sas = ""; -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net${sas}` -); -``` - -### List queues in this account - -Use `QueueServiceClient.listQueues()` function to iterate the queues, -with the new `for-await-of` syntax: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { QueueServiceClient } = require("@azure/storage-queue"); - -const account = ""; -const credential = new DefaultAzureCredential(); - -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net`, - credential -); - -async function main() { - let iter1 = queueServiceClient.listQueues(); - let i = 1; - for await (const item of iter1) { - console.log(`Queue${i}: ${item.name}`); - i++; - } -} - -main(); -``` - -Alternatively without `for-await-of`: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { QueueServiceClient } = require("@azure/storage-queue"); - -const account = ""; -const credential = new DefaultAzureCredential(); - -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net`, - credential -); - -async function main() { - let iter2 = queueServiceClient.listQueues(); - let i = 1; - let item = await iter2.next(); - while (!item.done) { - console.log(`Queue ${i++}: ${item.value.name}`); - item = await iter2.next(); - } -} - -main(); -``` - -For a complete sample on iterating queues please see [samples/typescript/iterators.ts](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-queue_12.8.0-beta.1/sdk/storage/storage-queue/samples/typescript/src/iterators.ts). - -### Create a new queue - -Use `QueueServiceClient.getQueueClient()` function to create a new queue. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { QueueServiceClient } = require("@azure/storage-queue"); - -const account = ""; -const credential = new DefaultAzureCredential(); - -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net`, - credential -); - -const queueName = ""; - -async function main() { - const queueClient = queueServiceClient.getQueueClient(queueName); - const createQueueResponse = await queueClient.create(); - console.log( - `Created queue ${queueName} successfully, service assigned request Id: ${createQueueResponse.requestId}` - ); -} - -main(); -``` - -### Send a message to the queue - -Use `sendMessage()` to add a message to the queue: - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { QueueServiceClient } = require("@azure/storage-queue"); - -const account = ""; -const credential = new DefaultAzureCredential(); - -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net`, - credential -); - -const queueName = ""; - -async function main() { - const queueClient = queueServiceClient.getQueueClient(queueName); - // Send a message into the queue using the sendMessage method. - const sendMessageResponse = await queueClient.sendMessage("Hello World!"); - console.log( - `Sent message successfully, service assigned message Id: ${sendMessageResponse.messageId}, service assigned request Id: ${sendMessageResponse.requestId}` - ); -} - -main(); -``` - -### Peek a message - -`QueueClient.peekMessages()` allows looking at one or more messages in front of the queue. This call -doesn't prevent other code from accessing peeked messages. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { QueueServiceClient } = require("@azure/storage-queue"); - -const account = ""; -const credential = new DefaultAzureCredential(); - -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net`, - credential -); - -const queueName = ""; - -async function main() { - const queueClient = queueServiceClient.getQueueClient(queueName); - const peekMessagesResponse = await queueClient.peekMessages(); - console.log(`The peeked message is: ${peekMessagesResponse.peekedMessageItems[0].messageText}`); -} - -main(); -``` - -### Processing a message - -Messages are processed in two steps. - -- First call `queueClient.receiveMessages()`. This makes the messages invisible to other code reading messages from this queue for a default period of 30 seconds. -- When processing of a message is done, call `queueClient.deleteMessage()` with the message's `popReceipt`. - -If your code fails to process a message due to hardware or software failure, this two-step process ensures that another instance of your code can get the same message and try again. - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { QueueServiceClient } = require("@azure/storage-queue"); - -const account = ""; -const credential = new DefaultAzureCredential(); - -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net`, - credential -); - -const queueName = ""; - -async function main() { - const queueClient = queueServiceClient.getQueueClient(queueName); - const response = await queueClient.receiveMessages(); - if (response.receivedMessageItems.length == 1) { - const receivedMessageItem = response.receivedMessageItems[0]; - console.log(`Processing & deleting message with content: ${receivedMessageItem.messageText}`); - const deleteMessageResponse = await queueClient.deleteMessage( - receivedMessageItem.messageId, - receivedMessageItem.popReceipt - ); - console.log( - `Delete message successfully, service assigned request Id: ${deleteMessageResponse.requestId}` - ); - } -} - -main(); -``` - -### Delete a queue - -```javascript -const { DefaultAzureCredential } = require("@azure/identity"); -const { QueueServiceClient } = require("@azure/storage-queue"); - -const account = ""; -const credential = new DefaultAzureCredential(); - -const queueServiceClient = new QueueServiceClient( - `https://${account}.queue.core.windows.net`, - credential -); - -const queueName = ""; - -async function main() { - const queueClient = queueServiceClient.getQueueClient(queueName); - const deleteQueueResponse = await queueClient.delete(); - console.log( - `Deleted queue successfully, service assigned request Id: ${deleteQueueResponse.requestId}` - ); -} - -main(); -``` - -A complete example of basic scenarios is at [samples/basic.ts](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-queue_12.8.0-beta.1/sdk/storage/storage-queue/samples/typescript/src/basic.ts). - -## Troubleshooting - -Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: - -```javascript -import { setLogLevel } from "@azure/logger"; - -setLogLevel("info"); -``` - -## Next steps - -More code samples - -- [Queue Storage Samples](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-queue_12.8.0-beta.1/sdk/storage/storage-queue/samples) -- [Queue Storage Test Cases](https://github.com/Azure/azure-sdk-for-js/tree/@azure/storage-queue_12.8.0-beta.1/sdk/storage/storage-queue/test) - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-queue_12.8.0-beta.1/CONTRIBUTING.md) to learn more about how to build and test the code. - -Also refer to [Storage specific guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/storage-queue_12.8.0-beta.1/sdk/storage/CONTRIBUTING.md) for additional information on setting up the test environment for storage libraries. - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Fstorage-queue%2FREADME.png) - diff --git a/docs-ref-services/preview/web-pubsub-express-readme.md b/docs-ref-services/preview/web-pubsub-express-readme.md deleted file mode 100644 index 7cbcb65fe2fa..000000000000 --- a/docs-ref-services/preview/web-pubsub-express-readme.md +++ /dev/null @@ -1,224 +0,0 @@ ---- -title: -keywords: Azure, javascript, SDK, API, @azure/web-pubsub-express, webpubsub -author: maggiepint -ms.author: magpint -ms.date: 11/11/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure-web-pubsub ---- - -# Azure Web PubSub CloudEvents handlers for Express - -[Azure Web PubSub service](https://aka.ms/awps/doc) is an Azure-managed service that helps developers easily build web applications with real-time features and publish-subscribe pattern. Any scenario that requires real-time publish-subscribe messaging between server and clients or among clients can use Azure Web PubSub service. Traditional real-time features that often require polling from server or submitting HTTP requests can also use Azure Web PubSub service. - -When a WebSocket connection connects, the Web PubSub service transforms the connection lifecycle and messages into [events in CloudEvents format](https://docs.microsoft.com/azure/azure-web-pubsub/concept-service-internals#workflow). This library provides an express middleware to handle events representing the WebSocket connection's lifecycle and messages, as shown in below diagram: - -![cloudevents](https://user-images.githubusercontent.com/668244/140321213-6442b3b8-72ee-4c28-aec1-127f9ea8f5d9.png) - -Details about the terms used here are described in [Key concepts](#key-concepts) section. - -[Source code](https://github.com/Azure/azure-sdk-for-js/blob/@azure/web-pubsub-express_1.0.0-beta.4/sdk/web-pubsub/web-pubsub-express) | -[Package (NPM)](https://www.npmjs.com/package/@azure/web-pubsub-express) | -[API reference documentation](https://aka.ms/awps/sdk/js) | -[Product documentation](https://aka.ms/awps/doc) | -[Samples][samples_ref] - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) -- [Express](https://expressjs.com/) version 4.x.x or higher - -### Prerequisites - -- An [Azure subscription][azure_sub]. -- An existing Azure Web PubSub endpoint. - -### 1. Install the `@azure/web-pubsub-express` package - -```bash -npm install @azure/web-pubsub-express -``` - -### 2. Create a `WebPubSubEventHandler` - -```js -const express = require("express"); - -const { WebPubSubEventHandler } = require("@azure/web-pubsub-express"); -const handler = new WebPubSubEventHandler("chat"); - -const app = express(); - -app.use(handler.getMiddleware()); - -app.listen(3000, () => - console.log(`Azure WebPubSub Upstream ready at http://localhost:3000${handler.path}`) -); -``` - -## Key concepts - -### Connection - -A connection, also known as a client or a client connection, represents an individual WebSocket connection connected to the Web PubSub service. When successfully connected, a unique connection ID is assigned to this connection by the Web PubSub service. - -### Hub - -A hub is a logical concept for a set of client connections. Usually you use one hub for one purpose, for example, a chat hub, or a notification hub. When a client connection is created, it connects to a hub, and during its lifetime, it belongs to that hub. Different applications can share one Azure Web PubSub service by using different hub names. - -### Group - -A group is a subset of connections to the hub. You can add a client connection to a group, or remove the client connection from the group, anytime you want. For example, when a client joins a chat room, or when a client leaves the chat room, this chat room can be considered to be a group. A client can join multiple groups, and a group can contain multiple clients. - -### User - -Connections to Web PubSub can belong to one user. A user might have multiple connections, for example when a single user is connected across multiple devices or multiple browser tabs. - -### Client Events - -Events are created during the lifecycle of a client connection. For example, a simple WebSocket client connection creates a `connect` event when it tries to connect to the service, a `connected` event when it successfully connected to the service, a `message` event when it sends messages to the service and a `disconnected` event when it disconnects from the service. - -### Event Handler - -Event handler contains the logic to handle the client events. Event handler needs to be registered and configured in the service through the portal or Azure CLI beforehand. The place to host the event handler logic is generally considered as the server-side. - -## Examples - -### Handle the `connect` request and assign `` - -```js -const express = require("express"); - -const { WebPubSubEventHandler } = require("@azure/web-pubsub-express"); -const handler = new WebPubSubEventHandler("chat", { - handleConnect: (req, res) => { - // auth the connection and set the userId of the connection - res.success({ - userId: "" - }); - }, - allowedEndpoints: ["https://.webpubsub.azure.com"] -}); - -const app = express(); - -app.use(handler.getMiddleware()); - -app.listen(3000, () => - console.log(`Azure WebPubSub Upstream ready at http://localhost:3000${handler.path}`) -); -``` - -### Only allow specified endpoints - -```js -const express = require("express"); - -const { WebPubSubEventHandler } = require("@azure/web-pubsub-express"); -const handler = new WebPubSubEventHandler("chat", { - allowedEndpoints: [ - "https://.webpubsub.azure.com", - "https://.webpubsub.azure.com" - ] -}); - -const app = express(); - -app.use(handler.getMiddleware()); - -app.listen(3000, () => - console.log(`Azure WebPubSub Upstream ready at http://localhost:3000${handler.path}`) -); -``` - -### Set custom event handler path - -```js -const express = require("express"); - -const { WebPubSubEventHandler } = require("@azure/web-pubsub-express"); -const handler = new WebPubSubEventHandler("chat", { - path: "customPath1" -}); - -const app = express(); - -app.use(handler.getMiddleware()); - -app.listen(3000, () => - // Azure WebPubSub Upstream ready at http://localhost:3000/customPath1 - console.log(`Azure WebPubSub Upstream ready at http://localhost:3000${handler.path}`) -); -``` - -### Set and read connection state - -```js -const express = require("express"); - -const { WebPubSubEventHandler } = require("@azure/web-pubsub-express"); - -const handler = new WebPubSubEventHandler("chat", { - handleConnect(req, res) { - // You can set the state for the connection, it lasts throughout the lifetime of the connection - res.setState("calledTime", 1); - res.success(); - }, - handleUserEvent(req, res) { - var calledTime = req.context.states.calledTime++; - console.log(calledTime); - // You can also set the state here - res.setState("calledTime", calledTime); - res.success(); - } -}); - -const app = express(); - -app.use(handler.getMiddleware()); - -app.listen(3000, () => - console.log(`Azure WebPubSub Upstream ready at http://localhost:3000${handler.path}`) -); -``` - -## Troubleshooting - -### Enable logs - -You can set the following environment variable to get the debug logs when using this library. - -- Getting debug logs from the SignalR client library - -```bash -export AZURE_LOG_LEVEL=verbose -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/web-pubsub-express_1.0.0-beta.4/sdk/core/logger). - -### Live Trace - -Use **Live Trace** from the Web PubSub service portal to view the live traffic. - -## Next steps - -Please take a look at the -[samples][samples_ref] -directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/web-pubsub-express_1.0.0-beta.4/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -[azure_sub]: https://azure.microsoft.com/free/ -[samples_ref]: https://github.com/Azure/azure-webpubsub/tree/main/samples/javascript/ - diff --git a/docs-ref-services/preview/web-pubsub-readme.md b/docs-ref-services/preview/web-pubsub-readme.md deleted file mode 100644 index 1faf2fe60fee..000000000000 --- a/docs-ref-services/preview/web-pubsub-readme.md +++ /dev/null @@ -1,250 +0,0 @@ ---- -title: Azure Web PubSub service client library for JavaScript -keywords: Azure, javascript, SDK, API, @azure/web-pubsub, webpubsub -author: maggiepint -ms.author: magpint -ms.date: 11/10/2021 -ms.topic: reference -ms.technology: azure -ms.devlang: javascript -ms.service: azure-web-pubsub ---- - -# Azure Web PubSub service client library for JavaScript - version 1.0.0-beta.4 - - -[Azure Web PubSub service](https://aka.ms/awps/doc) is an Azure-managed service that helps developers easily build web applications with real-time features and publish-subscribe pattern. Any scenario that requires real-time publish-subscribe messaging between server and clients or among clients can use Azure Web PubSub service. Traditional real-time features that often require polling from server or submitting HTTP requests can also use Azure Web PubSub service. - -You can use this library in your app server side to manage the WebSocket client connections, as shown in below diagram: - -![overflow](https://user-images.githubusercontent.com/668244/140014067-25a00959-04dc-47e8-ac25-6957bd0a71ce.png). - -- Send messages to hubs and groups. -- Send messages to particular users and connections. -- Organize users and connections into groups. -- Close connections -- Grant, revoke, and check permissions for an existing connection - -Details about the terms used here are described in [Key concepts](#key-concepts) section. - -[Source code](https://github.com/Azure/azure-sdk-for-js/blob/@azure/web-pubsub_1.0.0-beta.4/sdk/web-pubsub/web-pubsub) | -[Package (NPM)](https://www.npmjs.com/package/@azure/web-pubsub) | -[API reference documentation](https://aka.ms/awps/sdk/js) | -[Product documentation](https://aka.ms/awps/doc) | -[Samples][samples_ref] - -## Getting started - -### Currently supported environments - -- [LTS versions of Node.js](https://nodejs.org/about/releases/) - -### Prerequisites - -- An [Azure subscription][azure_sub]. -- An existing Azure Web PubSub service instance. - -### 1. Install the `@azure/web-pubsub` package - -```bash -npm install @azure/web-pubsub -``` - -### 2. Create and authenticate a WebPubSubServiceClient - -```js -const { WebPubSubServiceClient } = require("@azure/web-pubsub"); - -const serviceClient = new WebPubSubServiceClient("", ""); -``` - -You can also authenticate the `WebPubSubServiceClient` using an endpoint and an `AzureKeyCredential`: - -```js -const { WebPubSubServiceClient, AzureKeyCredential } = require("@azure/web-pubsub"); - -const key = new AzureKeyCredential(""); -const serviceClient = new WebPubSubServiceClient("", key, ""); -``` - -Or authenticate the `WebPubSubServiceClient` using [Azure Active Directory][aad_doc] - -1. Install the `@azure/identity` dependency - -```batch -npm install @azure/identity -``` - -2. Update the source code to use `DefaultAzureCredential`: - -```js -const { WebPubSubServiceClient, AzureKeyCredential } = require("@azure/web-pubsub"); - -const key = new DefaultAzureCredential(); -const serviceClient = new WebPubSubServiceClient("", key, ""); -``` - -## Key concepts - -### Connection - -A connection, also known as a client or a client connection, represents an individual WebSocket connection connected to the Web PubSub service. When successfully connected, a unique connection ID is assigned to this connection by the Web PubSub service. - -### Hub - -A hub is a logical concept for a set of client connections. Usually you use one hub for one purpose, for example, a chat hub, or a notification hub. When a client connection is created, it connects to a hub, and during its lifetime, it belongs to that hub. Different applications can share one Azure Web PubSub service by using different hub names. - -### Group - -A group is a subset of connections to the hub. You can add a client connection to a group, or remove the client connection from the group, anytime you want. For example, when a client joins a chat room, or when a client leaves the chat room, this chat room can be considered to be a group. A client can join multiple groups, and a group can contain multiple clients. - -### User - -Connections to Web PubSub can belong to one user. A user might have multiple connections, for example when a single user is connected across multiple devices or multiple browser tabs. - -### Message - -When the client is connected, it can send messages to the upstream application, or receive messages from the upstream application, through the WebSocket connection. - -## Examples - -### Get the access token for a client to start the WebSocket connection - -```js -const { WebPubSubServiceClient } = require("@azure/web-pubsub"); - -const serviceClient = new WebPubSubServiceClient("", ""); - -// Get the access token for the WebSocket client connection to use -let token = await serviceClient.getClientAccessToken(); - -// Or get the access token and assign the client a userId -token = await serviceClient.getClientAccessToken({ userId: "user1" }); - -// return the token to the WebSocket client -``` - -### Broadcast messages to all connections in a hub - -```js -const { WebPubSubServiceClient } = require("@azure/web-pubsub"); - -const serviceClient = new WebPubSubServiceClient("", ""); - -// Send a JSON message -await serviceClient.sendToAll({ message: "Hello world!" }); - -// Send a plain text message -await serviceClient.sendToAll("Hi there!", { contentType: "text/plain" }); - -// Send a binary message -const payload = new Uint8Array(10); -await serviceClient.sendToAll(payload.buffer); -``` - -### Send messages to all connections in a group - -```js -const { WebPubSubServiceClient } = require("@azure/web-pubsub"); - -const serviceClient = new WebPubSubServiceClient("", ""); - -const groupClient = serviceClient.group(""); - -// Add user to the group -await groupClient.addUser("user1"); - -// Send a JSON message -await groupClient.sendToAll({ message: "Hello world!" }); - -// Send a plain text message -await groupClient.sendToAll("Hi there!", { contentType: "text/plain" }); - -// Send a binary message -const payload = new Uint8Array(10); -await groupClient.sendToAll(payload.buffer); -``` - -### Send messages to all connections for a user - -```js -const { WebPubSubServiceClient } = require("@azure/web-pubsub"); - -const serviceClient = new WebPubSubServiceClient("", ""); - -// Send a JSON message -await serviceClient.sendToUser("user1", { message: "Hello world!" }); - -// Send a plain text message -await serviceClient.sendToUser("user1", "Hi there!", { contentType: "text/plain" }); - -// Send a binary message -const payload = new Uint8Array(10); -await serviceClient.sendToUser("user1", payload.buffer); -``` - -### Check if the group has any connection - -```js -const { WebPubSubServiceClient } = require("@azure/web-pubsub"); -const WebSocket = require("ws"); - -const serviceClient = new WebPubSubServiceClient("", ""); - -const groupClient = serviceClient.group(""); - -// close all the connections in the group -await groupClient.closeAllConnections({ reason: "" }); - -// check if the group has any connections -const hasConnections = await serviceClient.groupExists(""); -``` - -### Access the raw HTTP response for an operation - -```js -const { WebPubSubServiceClient } = require("@azure/web-pubsub"); - -function onResponse(rawResponse: FullOperationResponse): void { - console.log(rawResponse); -} -const serviceClient = new WebPubSubServiceClient("", ""); -await serviceClient.sendToAll({ message: "Hello world!" }, { onResponse }); -``` - -## Troubleshooting - -### Enable logs - -You can set the following environment variable to get the debug logs when using this library. - -- Getting debug logs from the SignalR client library - -```bash -export AZURE_LOG_LEVEL=verbose -``` - -For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/@azure/web-pubsub_1.0.0-beta.4/sdk/core/logger). - -### Live Trace - -Use **Live Trace** from the Web PubSub service portal to view the live traffic. - -## Next steps - -Please take a look at the -[samples][samples_ref] -directory for detailed examples on how to use this library. - -## Contributing - -If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/@azure/web-pubsub_1.0.0-beta.4/CONTRIBUTING.md) to learn more about how to build and test the code. - -## Related projects - -- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -[azure_sub]: https://azure.microsoft.com/free/ -[samples_ref]: https://github.com/Azure/azure-sdk-for-js/tree/@azure/web-pubsub_1.0.0-beta.4/sdk/web-pubsub/web-pubsub/samples -[aad_doc]: https://aka.ms/awps/aad - diff --git a/metadata/preview/azure-ai-form-recognizer.json b/metadata/preview/azure-ai-form-recognizer.json deleted file mode 100644 index ad2ad32a6f45..000000000000 --- a/metadata/preview/azure-ai-form-recognizer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/ai-form-recognizer", - "Version": "4.1.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/formrecognizer/ai-form-recognizer", - "ServiceDirectory": "formrecognizer", - "ReadMePath": "sdk/formrecognizer/ai-form-recognizer/README.md", - "ChangeLogPath": "sdk/formrecognizer/ai-form-recognizer/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-ai-form-recognizer", - "ReleaseStatus": "2023-04-11" -} diff --git a/metadata/preview/azure-ai-language-text.json b/metadata/preview/azure-ai-language-text.json deleted file mode 100644 index bf3e8ffe39d4..000000000000 --- a/metadata/preview/azure-ai-language-text.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/ai-language-text", - "Version": "1.1.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/cognitivelanguage/ai-language-text", - "ServiceDirectory": "cognitivelanguage", - "ReadMePath": "sdk/cognitivelanguage/ai-language-text/README.md", - "ChangeLogPath": "sdk/cognitivelanguage/ai-language-text/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-ai-language-text", - "ReleaseStatus": "2023-03-07" -} diff --git a/metadata/preview/azure-arm-analysisservices.json b/metadata/preview/azure-arm-analysisservices.json deleted file mode 100644 index f6b8e66a6b3b..000000000000 --- a/metadata/preview/azure-arm-analysisservices.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-analysisservices", - "Version": "4.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/analysisservices/arm-analysisservices", - "ServiceDirectory": "analysisservices", - "ReadMePath": "sdk/analysisservices/arm-analysisservices/README.md", - "ChangeLogPath": "sdk/analysisservices/arm-analysisservices/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-analysisservices", - "ReleaseStatus": "2021-11-30" -} diff --git a/metadata/preview/azure-arm-apimanagement.json b/metadata/preview/azure-arm-apimanagement.json deleted file mode 100644 index f18408db69fc..000000000000 --- a/metadata/preview/azure-arm-apimanagement.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-apimanagement", - "Version": "8.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/apimanagement/arm-apimanagement", - "ServiceDirectory": "apimanagement", - "ReadMePath": "sdk/apimanagement/arm-apimanagement/README.md", - "ChangeLogPath": "sdk/apimanagement/arm-apimanagement/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-apimanagement", - "ReleaseStatus": "2021-11-17" -} diff --git a/metadata/preview/azure-arm-appconfiguration.json b/metadata/preview/azure-arm-appconfiguration.json deleted file mode 100644 index 4e06936bd2d8..000000000000 --- a/metadata/preview/azure-arm-appconfiguration.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-appconfiguration", - "Version": "3.0.0-beta.4", - "DevVersion": null, - "DirectoryPath": "sdk/appconfiguration/arm-appconfiguration", - "ServiceDirectory": "appconfiguration", - "ReadMePath": "sdk/appconfiguration/arm-appconfiguration/README.md", - "ChangeLogPath": "sdk/appconfiguration/arm-appconfiguration/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-appconfiguration", - "ReleaseStatus": "2022-04-14" -} diff --git a/metadata/preview/azure-arm-appcontainers.json b/metadata/preview/azure-arm-appcontainers.json deleted file mode 100644 index 0d84a8e40812..000000000000 --- a/metadata/preview/azure-arm-appcontainers.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-appcontainers", - "Version": "2.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/appcontainers/arm-appcontainers", - "ServiceDirectory": "appcontainers", - "ReadMePath": "sdk/appcontainers/arm-appcontainers/README.md", - "ChangeLogPath": "sdk/appcontainers/arm-appcontainers/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-appcontainers", - "ReleaseStatus": "2023-05-12" -} diff --git a/metadata/preview/azure-arm-appservice.json b/metadata/preview/azure-arm-appservice.json deleted file mode 100644 index 86556de9e9b0..000000000000 --- a/metadata/preview/azure-arm-appservice.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-appservice", - "Version": "10.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/appservice/arm-appservice", - "ServiceDirectory": "appservice", - "ReadMePath": "sdk/appservice/arm-appservice/README.md", - "ChangeLogPath": "sdk/appservice/arm-appservice/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-appservice", - "ReleaseStatus": "2021-10-09" -} diff --git a/metadata/preview/azure-arm-batch.json b/metadata/preview/azure-arm-batch.json deleted file mode 100644 index 1edf927c7140..000000000000 --- a/metadata/preview/azure-arm-batch.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-batch", - "Version": "7.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/batch/arm-batch", - "ServiceDirectory": "batch", - "ReadMePath": "sdk/batch/arm-batch/README.md", - "ChangeLogPath": "sdk/batch/arm-batch/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-batch", - "ReleaseStatus": "2021-11-18" -} diff --git a/metadata/preview/azure-arm-botservice.json b/metadata/preview/azure-arm-botservice.json deleted file mode 100644 index 22589edd7b6b..000000000000 --- a/metadata/preview/azure-arm-botservice.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-botservice", - "Version": "4.0.0-beta.5", - "DevVersion": null, - "DirectoryPath": "sdk/botservice/arm-botservice", - "ServiceDirectory": "botservice", - "ReadMePath": "sdk/botservice/arm-botservice/README.md", - "ChangeLogPath": "sdk/botservice/arm-botservice/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-botservice", - "ReleaseStatus": "2022-11-18" -} diff --git a/metadata/preview/azure-arm-cdn.json b/metadata/preview/azure-arm-cdn.json deleted file mode 100644 index 3f3dd649e254..000000000000 --- a/metadata/preview/azure-arm-cdn.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-cdn", - "Version": "6.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/cdn/arm-cdn", - "ServiceDirectory": "cdn", - "ReadMePath": "sdk/cdn/arm-cdn/README.md", - "ChangeLogPath": "sdk/cdn/arm-cdn/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-cdn", - "ReleaseStatus": "2021-11-11" -} diff --git a/metadata/preview/azure-arm-commerce-profile-2020-09-01-hybrid.json b/metadata/preview/azure-arm-commerce-profile-2020-09-01-hybrid.json deleted file mode 100644 index c31e449ffb02..000000000000 --- a/metadata/preview/azure-arm-commerce-profile-2020-09-01-hybrid.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-commerce-profile-2020-09-01-hybrid", - "Version": "2.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/commerce/arm-commerce-profile-2020-09-01-hybrid", - "ServiceDirectory": "commerce", - "ReadMePath": "sdk/commerce/arm-commerce-profile-2020-09-01-hybrid/README.md", - "ChangeLogPath": "sdk/commerce/arm-commerce-profile-2020-09-01-hybrid/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-commerce-profile-2020-09-01-hybrid", - "ReleaseStatus": "2022-03-10" -} diff --git a/metadata/preview/azure-arm-compute.json b/metadata/preview/azure-arm-compute.json deleted file mode 100644 index 9c6b4ae7c659..000000000000 --- a/metadata/preview/azure-arm-compute.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-compute", - "Version": "17.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/compute/arm-compute", - "ServiceDirectory": "compute", - "ReadMePath": "sdk/compute/arm-compute/README.md", - "ChangeLogPath": "sdk/compute/arm-compute/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-compute", - "ReleaseStatus": "2021-10-18" -} diff --git a/metadata/preview/azure-arm-consumption.json b/metadata/preview/azure-arm-consumption.json deleted file mode 100644 index 9ecf1ff83aeb..000000000000 --- a/metadata/preview/azure-arm-consumption.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-consumption", - "Version": "9.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/consumption/arm-consumption", - "ServiceDirectory": "consumption", - "ReadMePath": "sdk/consumption/arm-consumption/README.md", - "ChangeLogPath": "sdk/consumption/arm-consumption/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-consumption", - "ReleaseStatus": "2021-11-16" -} diff --git a/metadata/preview/azure-arm-containerinstance.json b/metadata/preview/azure-arm-containerinstance.json deleted file mode 100644 index 2435e045ff7d..000000000000 --- a/metadata/preview/azure-arm-containerinstance.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-containerinstance", - "Version": "9.1.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/containerinstance/arm-containerinstance", - "ServiceDirectory": "containerinstance", - "ReadMePath": "sdk/containerinstance/arm-containerinstance/README.md", - "ChangeLogPath": "sdk/containerinstance/arm-containerinstance/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-containerinstance", - "ReleaseStatus": "2023-04-10" -} diff --git a/metadata/preview/azure-arm-cosmosdbforpostgresql.json b/metadata/preview/azure-arm-cosmosdbforpostgresql.json deleted file mode 100644 index ed3114411e3a..000000000000 --- a/metadata/preview/azure-arm-cosmosdbforpostgresql.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-cosmosdbforpostgresql", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/cosmosforpostgresql/arm-cosmosdbforpostgresql", - "ServiceDirectory": "cosmosforpostgresql", - "ReadMePath": "sdk/cosmosforpostgresql/arm-cosmosdbforpostgresql/README.md", - "ChangeLogPath": "sdk/cosmosforpostgresql/arm-cosmosdbforpostgresql/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-cosmosdbforpostgresql", - "ReleaseStatus": "2023-06-08" -} diff --git a/metadata/preview/azure-arm-dashboard.json b/metadata/preview/azure-arm-dashboard.json deleted file mode 100644 index b8a72b0db02f..000000000000 --- a/metadata/preview/azure-arm-dashboard.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-dashboard", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/dashboard/arm-dashboard", - "ServiceDirectory": "dashboard", - "ReadMePath": "sdk/dashboard/arm-dashboard/README.md", - "ChangeLogPath": "sdk/dashboard/arm-dashboard/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-dashboard", - "ReleaseStatus": "2022-04-13" -} diff --git a/metadata/preview/azure-arm-databox.json b/metadata/preview/azure-arm-databox.json deleted file mode 100644 index 6e55ed640bff..000000000000 --- a/metadata/preview/azure-arm-databox.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-databox", - "Version": "5.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/databox/arm-databox", - "ServiceDirectory": "databox", - "ReadMePath": "sdk/databox/arm-databox/README.md", - "ChangeLogPath": "sdk/databox/arm-databox/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-databox", - "ReleaseStatus": "2022-11-18" -} diff --git a/metadata/preview/azure-arm-datafactory.json b/metadata/preview/azure-arm-datafactory.json deleted file mode 100644 index 080dac1b7d3e..000000000000 --- a/metadata/preview/azure-arm-datafactory.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-datafactory", - "Version": "10.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/datafactory/arm-datafactory", - "ServiceDirectory": "datafactory", - "ReadMePath": "sdk/datafactory/arm-datafactory/README.md", - "ChangeLogPath": "sdk/datafactory/arm-datafactory/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-datafactory", - "ReleaseStatus": "2021-11-23" -} diff --git a/metadata/preview/azure-arm-dataprotection.json b/metadata/preview/azure-arm-dataprotection.json deleted file mode 100644 index 46705f5315e7..000000000000 --- a/metadata/preview/azure-arm-dataprotection.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-dataprotection", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/dataprotection/arm-dataprotection", - "ServiceDirectory": "dataprotection", - "ReadMePath": "sdk/dataprotection/arm-dataprotection/README.md", - "ChangeLogPath": "sdk/dataprotection/arm-dataprotection/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-dataprotection", - "ReleaseStatus": "2023-02-09" -} diff --git a/metadata/preview/azure-arm-desktopvirtualization.json b/metadata/preview/azure-arm-desktopvirtualization.json deleted file mode 100644 index 9f53905bc1c9..000000000000 --- a/metadata/preview/azure-arm-desktopvirtualization.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-desktopvirtualization", - "Version": "1.0.0-beta.4", - "DevVersion": null, - "DirectoryPath": "sdk/desktopvirtualization/arm-desktopvirtualization", - "ServiceDirectory": "desktopvirtualization", - "ReadMePath": "sdk/desktopvirtualization/arm-desktopvirtualization/README.md", - "ChangeLogPath": "sdk/desktopvirtualization/arm-desktopvirtualization/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-desktopvirtualization", - "ReleaseStatus": "2022-11-21" -} diff --git a/metadata/preview/azure-arm-devcenter.json b/metadata/preview/azure-arm-devcenter.json deleted file mode 100644 index 74971d6fb096..000000000000 --- a/metadata/preview/azure-arm-devcenter.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-devcenter", - "Version": "1.0.0-beta.4", - "DevVersion": null, - "DirectoryPath": "sdk/devcenter/arm-devcenter", - "ServiceDirectory": "devcenter", - "ReadMePath": "sdk/devcenter/arm-devcenter/README.md", - "ChangeLogPath": "sdk/devcenter/arm-devcenter/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-devcenter", - "ReleaseStatus": "2022-11-23" -} diff --git a/metadata/preview/azure-arm-deviceupdate.json b/metadata/preview/azure-arm-deviceupdate.json deleted file mode 100644 index e2ed89a4ee21..000000000000 --- a/metadata/preview/azure-arm-deviceupdate.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-deviceupdate", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/deviceupdate/arm-deviceupdate", - "ServiceDirectory": "deviceupdate", - "ReadMePath": "sdk/deviceupdate/arm-deviceupdate/README.md", - "ChangeLogPath": "sdk/deviceupdate/arm-deviceupdate/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-deviceupdate", - "ReleaseStatus": "2022-07-12" -} diff --git a/metadata/preview/azure-arm-devtestlabs.json b/metadata/preview/azure-arm-devtestlabs.json deleted file mode 100644 index a29edfc46ce9..000000000000 --- a/metadata/preview/azure-arm-devtestlabs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-devtestlabs", - "Version": "4.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/devtestlabs/arm-devtestlabs", - "ServiceDirectory": "devtestlabs", - "ReadMePath": "sdk/devtestlabs/arm-devtestlabs/README.md", - "ChangeLogPath": "sdk/devtestlabs/arm-devtestlabs/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-devtestlabs", - "ReleaseStatus": "2021-12-02" -} diff --git a/metadata/preview/azure-arm-digitaltwins.json b/metadata/preview/azure-arm-digitaltwins.json deleted file mode 100644 index 774f3313e4df..000000000000 --- a/metadata/preview/azure-arm-digitaltwins.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-digitaltwins", - "Version": "3.1.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/digitaltwins/arm-digitaltwins", - "ServiceDirectory": "digitaltwins", - "ReadMePath": "sdk/digitaltwins/arm-digitaltwins/README.md", - "ChangeLogPath": "sdk/digitaltwins/arm-digitaltwins/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-digitaltwins", - "ReleaseStatus": "2022-03-02" -} diff --git a/metadata/preview/azure-arm-dnsresolver.json b/metadata/preview/azure-arm-dnsresolver.json deleted file mode 100644 index c1fd9c75a93f..000000000000 --- a/metadata/preview/azure-arm-dnsresolver.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-dnsresolver", - "Version": "1.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/dnsresolver/arm-dnsresolver", - "ServiceDirectory": "dnsresolver", - "ReadMePath": "sdk/dnsresolver/arm-dnsresolver/README.md", - "ChangeLogPath": "sdk/dnsresolver/arm-dnsresolver/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-dnsresolver", - "ReleaseStatus": "2022-04-18" -} diff --git a/metadata/preview/azure-arm-dynatrace.json b/metadata/preview/azure-arm-dynatrace.json deleted file mode 100644 index 3a33ee48eff0..000000000000 --- a/metadata/preview/azure-arm-dynatrace.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-dynatrace", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/dynatrace/arm-dynatrace", - "ServiceDirectory": "dynatrace", - "ReadMePath": "sdk/dynatrace/arm-dynatrace/README.md", - "ChangeLogPath": "sdk/dynatrace/arm-dynatrace/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-dynatrace", - "ReleaseStatus": "2022-07-12" -} diff --git a/metadata/preview/azure-arm-features.json b/metadata/preview/azure-arm-features.json deleted file mode 100644 index 5ee1022a0248..000000000000 --- a/metadata/preview/azure-arm-features.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-features", - "Version": "3.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/features/arm-features", - "ServiceDirectory": "features", - "ReadMePath": "sdk/features/arm-features/README.md", - "ChangeLogPath": "sdk/features/arm-features/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-features", - "ReleaseStatus": "2021-10-09" -} diff --git a/metadata/preview/azure-arm-graphservices.json b/metadata/preview/azure-arm-graphservices.json deleted file mode 100644 index cfb0413e6f84..000000000000 --- a/metadata/preview/azure-arm-graphservices.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-graphservices", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/graphservices/arm-graphservices", - "ServiceDirectory": "graphservices", - "ReadMePath": "sdk/graphservices/arm-graphservices/README.md", - "ChangeLogPath": "sdk/graphservices/arm-graphservices/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-graphservices", - "ReleaseStatus": "2023-03-14" -} diff --git a/metadata/preview/azure-arm-hybridconnectivity.json b/metadata/preview/azure-arm-hybridconnectivity.json deleted file mode 100644 index 164761552548..000000000000 --- a/metadata/preview/azure-arm-hybridconnectivity.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-hybridconnectivity", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/hybridconnectivity/arm-hybridconnectivity", - "ServiceDirectory": "hybridconnectivity", - "ReadMePath": "sdk/hybridconnectivity/arm-hybridconnectivity/README.md", - "ChangeLogPath": "sdk/hybridconnectivity/arm-hybridconnectivity/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-hybridconnectivity", - "ReleaseStatus": "2023-08-30" -} diff --git a/metadata/preview/azure-arm-iothub.json b/metadata/preview/azure-arm-iothub.json deleted file mode 100644 index 2de01e890e50..000000000000 --- a/metadata/preview/azure-arm-iothub.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-iothub", - "Version": "6.3.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/iothub/arm-iothub", - "ServiceDirectory": "iothub", - "ReadMePath": "sdk/iothub/arm-iothub/README.md", - "ChangeLogPath": "sdk/iothub/arm-iothub/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-iothub", - "ReleaseStatus": "2023-09-13" -} diff --git a/metadata/preview/azure-arm-keyvault.json b/metadata/preview/azure-arm-keyvault.json deleted file mode 100644 index 4404884d5da1..000000000000 --- a/metadata/preview/azure-arm-keyvault.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-keyvault", - "Version": "2.1.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/keyvault/arm-keyvault", - "ServiceDirectory": "keyvault", - "ReadMePath": "sdk/keyvault/arm-keyvault/README.md", - "ChangeLogPath": "sdk/keyvault/arm-keyvault/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-keyvault", - "ReleaseStatus": "2022-11-28" -} diff --git a/metadata/preview/azure-arm-kubernetesconfiguration.json b/metadata/preview/azure-arm-kubernetesconfiguration.json deleted file mode 100644 index 706c8af6efbf..000000000000 --- a/metadata/preview/azure-arm-kubernetesconfiguration.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-kubernetesconfiguration", - "Version": "5.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/kubernetesconfiguration/arm-kubernetesconfiguration", - "ServiceDirectory": "kubernetesconfiguration", - "ReadMePath": "sdk/kubernetesconfiguration/arm-kubernetesconfiguration/README.md", - "ChangeLogPath": "sdk/kubernetesconfiguration/arm-kubernetesconfiguration/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-kubernetesconfiguration", - "ReleaseStatus": "2022-01-17" -} diff --git a/metadata/preview/azure-arm-labservices.json b/metadata/preview/azure-arm-labservices.json deleted file mode 100644 index 9603ae1e3b47..000000000000 --- a/metadata/preview/azure-arm-labservices.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-labservices", - "Version": "3.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/labservices/arm-labservices", - "ServiceDirectory": "labservices", - "ReadMePath": "sdk/labservices/arm-labservices/README.md", - "ChangeLogPath": "sdk/labservices/arm-labservices/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-labservices", - "ReleaseStatus": "2022-06-17" -} diff --git a/metadata/preview/azure-arm-links.json b/metadata/preview/azure-arm-links.json deleted file mode 100644 index 5c4f7db1f04d..000000000000 --- a/metadata/preview/azure-arm-links.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-links", - "Version": "2.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/links/arm-links", - "ServiceDirectory": "links", - "ReadMePath": "sdk/links/arm-links/README.md", - "ChangeLogPath": "sdk/links/arm-links/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-links", - "ReleaseStatus": "2021-10-09" -} diff --git a/metadata/preview/azure-arm-loadtesting.json b/metadata/preview/azure-arm-loadtesting.json deleted file mode 100644 index d5f4b1220f49..000000000000 --- a/metadata/preview/azure-arm-loadtesting.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-loadtesting", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/loadtestservice/arm-loadtesting", - "ServiceDirectory": "loadtestservice", - "ReadMePath": "sdk/loadtestservice/arm-loadtesting/README.md", - "ChangeLogPath": "sdk/loadtestservice/arm-loadtesting/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-loadtesting", - "ReleaseStatus": "2023-01-06" -} diff --git a/metadata/preview/azure-arm-locks.json b/metadata/preview/azure-arm-locks.json deleted file mode 100644 index 857f21acd257..000000000000 --- a/metadata/preview/azure-arm-locks.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-locks", - "Version": "2.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/locks/arm-locks", - "ServiceDirectory": "locks", - "ReadMePath": "sdk/locks/arm-locks/README.md", - "ChangeLogPath": "sdk/locks/arm-locks/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-locks", - "ReleaseStatus": "2021-10-09" -} diff --git a/metadata/preview/azure-arm-logic.json b/metadata/preview/azure-arm-logic.json deleted file mode 100644 index e396767d2ea3..000000000000 --- a/metadata/preview/azure-arm-logic.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-logic", - "Version": "8.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/logic/arm-logic", - "ServiceDirectory": "logic", - "ReadMePath": "sdk/logic/arm-logic/README.md", - "ChangeLogPath": "sdk/logic/arm-logic/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-logic", - "ReleaseStatus": "2021-10-22" -} diff --git a/metadata/preview/azure-arm-machinelearning.json b/metadata/preview/azure-arm-machinelearning.json deleted file mode 100644 index c23630c4feb2..000000000000 --- a/metadata/preview/azure-arm-machinelearning.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-machinelearning", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/machinelearning/arm-machinelearning", - "ServiceDirectory": "machinelearning", - "ReadMePath": "sdk/machinelearning/arm-machinelearning/README.md", - "ChangeLogPath": "sdk/machinelearning/arm-machinelearning/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-machinelearning", - "ReleaseStatus": "2022-05-26" -} diff --git a/metadata/preview/azure-arm-managedapplications.json b/metadata/preview/azure-arm-managedapplications.json deleted file mode 100644 index 21d43e2a6202..000000000000 --- a/metadata/preview/azure-arm-managedapplications.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-managedapplications", - "Version": "2.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/managedapplications/arm-managedapplications", - "ServiceDirectory": "managedapplications", - "ReadMePath": "sdk/managedapplications/arm-managedapplications/README.md", - "ChangeLogPath": "sdk/managedapplications/arm-managedapplications/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-managedapplications", - "ReleaseStatus": "2021-10-09" -} diff --git a/metadata/preview/azure-arm-managednetworkfabric.json b/metadata/preview/azure-arm-managednetworkfabric.json deleted file mode 100644 index 1f351f637f22..000000000000 --- a/metadata/preview/azure-arm-managednetworkfabric.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-managednetworkfabric", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/managednetworkfabric/arm-managednetworkfabric", - "ServiceDirectory": "managednetworkfabric", - "ReadMePath": "sdk/managednetworkfabric/arm-managednetworkfabric/README.md", - "ChangeLogPath": "sdk/managednetworkfabric/arm-managednetworkfabric/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-managednetworkfabric", - "ReleaseStatus": "2023-06-26" -} diff --git a/metadata/preview/azure-arm-managementgroups.json b/metadata/preview/azure-arm-managementgroups.json deleted file mode 100644 index 83cd68dc6a54..000000000000 --- a/metadata/preview/azure-arm-managementgroups.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-managementgroups", - "Version": "2.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/managementgroups/arm-managementgroups", - "ServiceDirectory": "managementgroups", - "ReadMePath": "sdk/managementgroups/arm-managementgroups/README.md", - "ChangeLogPath": "sdk/managementgroups/arm-managementgroups/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-managementgroups", - "ReleaseStatus": "2021-11-22" -} diff --git a/metadata/preview/azure-arm-maps.json b/metadata/preview/azure-arm-maps.json deleted file mode 100644 index 5b6daed17d1b..000000000000 --- a/metadata/preview/azure-arm-maps.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-maps", - "Version": "3.1.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/maps/arm-maps", - "ServiceDirectory": "maps", - "ReadMePath": "sdk/maps/arm-maps/README.md", - "ChangeLogPath": "sdk/maps/arm-maps/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-maps", - "ReleaseStatus": "2022-11-29" -} diff --git a/metadata/preview/azure-arm-mediaservices.json b/metadata/preview/azure-arm-mediaservices.json deleted file mode 100644 index c90da368d066..000000000000 --- a/metadata/preview/azure-arm-mediaservices.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-mediaservices", - "Version": "10.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/mediaservices/arm-mediaservices", - "ServiceDirectory": "mediaservices", - "ReadMePath": "sdk/mediaservices/arm-mediaservices/README.md", - "ChangeLogPath": "sdk/mediaservices/arm-mediaservices/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-mediaservices", - "ReleaseStatus": "2021-10-28" -} diff --git a/metadata/preview/azure-arm-mobilenetwork.json b/metadata/preview/azure-arm-mobilenetwork.json deleted file mode 100644 index 6124dff15217..000000000000 --- a/metadata/preview/azure-arm-mobilenetwork.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-mobilenetwork", - "Version": "1.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/mobilenetwork/arm-mobilenetwork", - "ServiceDirectory": "mobilenetwork", - "ReadMePath": "sdk/mobilenetwork/arm-mobilenetwork/README.md", - "ChangeLogPath": "sdk/mobilenetwork/arm-mobilenetwork/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-mobilenetwork", - "ReleaseStatus": "2022-08-01" -} diff --git a/metadata/preview/azure-arm-msi.json b/metadata/preview/azure-arm-msi.json deleted file mode 100644 index 25f61cea2e91..000000000000 --- a/metadata/preview/azure-arm-msi.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-msi", - "Version": "2.1.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/msi/arm-msi", - "ServiceDirectory": "msi", - "ReadMePath": "sdk/msi/arm-msi/README.md", - "ChangeLogPath": "sdk/msi/arm-msi/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-msi", - "ReleaseStatus": "2022-06-27" -} diff --git a/metadata/preview/azure-arm-mysql.json b/metadata/preview/azure-arm-mysql.json deleted file mode 100644 index 60b8cc050c5c..000000000000 --- a/metadata/preview/azure-arm-mysql.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-mysql", - "Version": "5.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/mysql/arm-mysql", - "ServiceDirectory": "mysql", - "ReadMePath": "sdk/mysql/arm-mysql/README.md", - "ChangeLogPath": "sdk/mysql/arm-mysql/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-mysql", - "ReleaseStatus": "2021-11-08" -} diff --git a/metadata/preview/azure-arm-network.json b/metadata/preview/azure-arm-network.json deleted file mode 100644 index 9edfdde28582..000000000000 --- a/metadata/preview/azure-arm-network.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-network", - "Version": "26.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/network/arm-network", - "ServiceDirectory": "network", - "ReadMePath": "sdk/network/arm-network/README.md", - "ChangeLogPath": "sdk/network/arm-network/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-network", - "ReleaseStatus": "2021-11-02" -} diff --git a/metadata/preview/azure-arm-networkcloud.json b/metadata/preview/azure-arm-networkcloud.json deleted file mode 100644 index 30fbf394c006..000000000000 --- a/metadata/preview/azure-arm-networkcloud.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-networkcloud", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/networkcloud/arm-networkcloud", - "ServiceDirectory": "networkcloud", - "ReadMePath": "sdk/networkcloud/arm-networkcloud/README.md", - "ChangeLogPath": "sdk/networkcloud/arm-networkcloud/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-networkcloud", - "ReleaseStatus": "2023-07-07" -} diff --git a/metadata/preview/azure-arm-notificationhubs.json b/metadata/preview/azure-arm-notificationhubs.json deleted file mode 100644 index 2d940f695bc1..000000000000 --- a/metadata/preview/azure-arm-notificationhubs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-notificationhubs", - "Version": "2.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/notificationhubs/arm-notificationhubs", - "ServiceDirectory": "notificationhubs", - "ReadMePath": "sdk/notificationhubs/arm-notificationhubs/README.md", - "ChangeLogPath": "sdk/notificationhubs/arm-notificationhubs/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-notificationhubs", - "ReleaseStatus": "2021-11-01" -} diff --git a/metadata/preview/azure-arm-operationalinsights.json b/metadata/preview/azure-arm-operationalinsights.json deleted file mode 100644 index 8385d0caebac..000000000000 --- a/metadata/preview/azure-arm-operationalinsights.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-operationalinsights", - "Version": "9.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/operationalinsights/arm-operationalinsights", - "ServiceDirectory": "operationalinsights", - "ReadMePath": "sdk/operationalinsights/arm-operationalinsights/README.md", - "ChangeLogPath": "sdk/operationalinsights/arm-operationalinsights/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-operationalinsights", - "ReleaseStatus": "2023-01-30" -} diff --git a/metadata/preview/azure-arm-orbital.json b/metadata/preview/azure-arm-orbital.json deleted file mode 100644 index 7842b9bb7421..000000000000 --- a/metadata/preview/azure-arm-orbital.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-orbital", - "Version": "1.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/orbital/arm-orbital", - "ServiceDirectory": "orbital", - "ReadMePath": "sdk/orbital/arm-orbital/README.md", - "ChangeLogPath": "sdk/orbital/arm-orbital/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-orbital", - "ReleaseStatus": "2022-04-27" -} diff --git a/metadata/preview/azure-arm-paloaltonetworksngfw.json b/metadata/preview/azure-arm-paloaltonetworksngfw.json deleted file mode 100644 index 906212d3ffbf..000000000000 --- a/metadata/preview/azure-arm-paloaltonetworksngfw.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-paloaltonetworksngfw", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw", - "ServiceDirectory": "paloaltonetworksngfw", - "ReadMePath": "sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/README.md", - "ChangeLogPath": "sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-paloaltonetworksngfw", - "ReleaseStatus": "2023-03-27" -} diff --git a/metadata/preview/azure-arm-policy.json b/metadata/preview/azure-arm-policy.json deleted file mode 100644 index 072f1276210b..000000000000 --- a/metadata/preview/azure-arm-policy.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-policy", - "Version": "5.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/policy/arm-policy", - "ServiceDirectory": "policy", - "ReadMePath": "sdk/policy/arm-policy/README.md", - "ChangeLogPath": "sdk/policy/arm-policy/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-policy", - "ReleaseStatus": "2021-10-18" -} diff --git a/metadata/preview/azure-arm-postgresql.json b/metadata/preview/azure-arm-postgresql.json deleted file mode 100644 index 0af4872d1362..000000000000 --- a/metadata/preview/azure-arm-postgresql.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-postgresql", - "Version": "6.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/postgresql/arm-postgresql", - "ServiceDirectory": "postgresql", - "ReadMePath": "sdk/postgresql/arm-postgresql/README.md", - "ChangeLogPath": "sdk/postgresql/arm-postgresql/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-postgresql", - "ReleaseStatus": "2021-10-19" -} diff --git a/metadata/preview/azure-arm-purview.json b/metadata/preview/azure-arm-purview.json deleted file mode 100644 index a19d3b77b6ef..000000000000 --- a/metadata/preview/azure-arm-purview.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-purview", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/purview/arm-purview", - "ServiceDirectory": "purview", - "ReadMePath": "sdk/purview/arm-purview/README.md", - "ChangeLogPath": "sdk/purview/arm-purview/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-purview", - "ReleaseStatus": "2021-09-09" -} diff --git a/metadata/preview/azure-arm-recoveryservices.json b/metadata/preview/azure-arm-recoveryservices.json deleted file mode 100644 index f4a0a325a661..000000000000 --- a/metadata/preview/azure-arm-recoveryservices.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-recoveryservices", - "Version": "5.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/recoveryservices/arm-recoveryservices", - "ServiceDirectory": "recoveryservices", - "ReadMePath": "sdk/recoveryservices/arm-recoveryservices/README.md", - "ChangeLogPath": "sdk/recoveryservices/arm-recoveryservices/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-recoveryservices", - "ReleaseStatus": "2021-10-25" -} diff --git a/metadata/preview/azure-arm-rediscache.json b/metadata/preview/azure-arm-rediscache.json deleted file mode 100644 index d2b32f3ceb79..000000000000 --- a/metadata/preview/azure-arm-rediscache.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-rediscache", - "Version": "6.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/redis/arm-rediscache", - "ServiceDirectory": "redis", - "ReadMePath": "sdk/redis/arm-rediscache/README.md", - "ChangeLogPath": "sdk/redis/arm-rediscache/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-rediscache", - "ReleaseStatus": "2021-10-09" -} diff --git a/metadata/preview/azure-arm-resourceconnector.json b/metadata/preview/azure-arm-resourceconnector.json deleted file mode 100644 index e3aa5b080ae8..000000000000 --- a/metadata/preview/azure-arm-resourceconnector.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-resourceconnector", - "Version": "1.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/resourceconnector/arm-resourceconnector", - "ServiceDirectory": "resourceconnector", - "ReadMePath": "sdk/resourceconnector/arm-resourceconnector/README.md", - "ChangeLogPath": "sdk/resourceconnector/arm-resourceconnector/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-resourceconnector", - "ReleaseStatus": "2023-04-21" -} diff --git a/metadata/preview/azure-arm-resourcehealth.json b/metadata/preview/azure-arm-resourcehealth.json deleted file mode 100644 index 52bf271b60c4..000000000000 --- a/metadata/preview/azure-arm-resourcehealth.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-resourcehealth", - "Version": "3.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/resourcehealth/arm-resourcehealth", - "ServiceDirectory": "resourcehealth", - "ReadMePath": "sdk/resourcehealth/arm-resourcehealth/README.md", - "ChangeLogPath": "sdk/resourcehealth/arm-resourcehealth/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-resourcehealth", - "ReleaseStatus": "2021-11-23" -} diff --git a/metadata/preview/azure-arm-resources-subscriptions.json b/metadata/preview/azure-arm-resources-subscriptions.json deleted file mode 100644 index cf8b0caaa92c..000000000000 --- a/metadata/preview/azure-arm-resources-subscriptions.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-resources-subscriptions", - "Version": "2.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/resources-subscriptions/arm-resources-subscriptions", - "ServiceDirectory": "resources-subscriptions", - "ReadMePath": "sdk/resources-subscriptions/arm-resources-subscriptions/README.md", - "ChangeLogPath": "sdk/resources-subscriptions/arm-resources-subscriptions/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-resources-subscriptions", - "ReleaseStatus": "2021-10-20" -} diff --git a/metadata/preview/azure-arm-resources.json b/metadata/preview/azure-arm-resources.json deleted file mode 100644 index cfe5b989e44c..000000000000 --- a/metadata/preview/azure-arm-resources.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-resources", - "Version": "5.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/resources/arm-resources", - "ServiceDirectory": "resources", - "ReadMePath": "sdk/resources/arm-resources/README.md", - "ChangeLogPath": "sdk/resources/arm-resources/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-resources", - "ReleaseStatus": "2021-10-09" -} diff --git a/metadata/preview/azure-arm-search.json b/metadata/preview/azure-arm-search.json deleted file mode 100644 index c5e9f97ee85a..000000000000 --- a/metadata/preview/azure-arm-search.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-search", - "Version": "3.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/search/arm-search", - "ServiceDirectory": "search", - "ReadMePath": "sdk/search/arm-search/README.md", - "ChangeLogPath": "sdk/search/arm-search/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-search", - "ReleaseStatus": "2021-11-29" -} diff --git a/metadata/preview/azure-arm-selfhelp.json b/metadata/preview/azure-arm-selfhelp.json deleted file mode 100644 index 8d5892d955ef..000000000000 --- a/metadata/preview/azure-arm-selfhelp.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-selfhelp", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/selfhelp/arm-selfhelp", - "ServiceDirectory": "selfhelp", - "ReadMePath": "sdk/selfhelp/arm-selfhelp/README.md", - "ChangeLogPath": "sdk/selfhelp/arm-selfhelp/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-selfhelp", - "ReleaseStatus": "2023-04-27" -} diff --git a/metadata/preview/azure-arm-servicefabric.json b/metadata/preview/azure-arm-servicefabric.json deleted file mode 100644 index 4796ccfa3611..000000000000 --- a/metadata/preview/azure-arm-servicefabric.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-servicefabric", - "Version": "2.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/servicefabric/arm-servicefabric", - "ServiceDirectory": "servicefabric", - "ReadMePath": "sdk/servicefabric/arm-servicefabric/README.md", - "ChangeLogPath": "sdk/servicefabric/arm-servicefabric/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-servicefabric", - "ReleaseStatus": "2021-11-03" -} diff --git a/metadata/preview/azure-arm-storage.json b/metadata/preview/azure-arm-storage.json deleted file mode 100644 index 91bf98b3cdbc..000000000000 --- a/metadata/preview/azure-arm-storage.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-storage", - "Version": "17.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/storage/arm-storage", - "ServiceDirectory": "storage", - "ReadMePath": "sdk/storage/arm-storage/README.md", - "ChangeLogPath": "sdk/storage/arm-storage/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-storage", - "ReleaseStatus": "2021-10-09" -} diff --git a/metadata/preview/azure-arm-storagecache.json b/metadata/preview/azure-arm-storagecache.json deleted file mode 100644 index 5d69155987c5..000000000000 --- a/metadata/preview/azure-arm-storagecache.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-storagecache", - "Version": "7.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/storagecache/arm-storagecache", - "ServiceDirectory": "storagecache", - "ReadMePath": "sdk/storagecache/arm-storagecache/README.md", - "ChangeLogPath": "sdk/storagecache/arm-storagecache/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-storagecache", - "ReleaseStatus": "2023-03-06" -} diff --git a/metadata/preview/azure-arm-streamanalytics.json b/metadata/preview/azure-arm-streamanalytics.json deleted file mode 100644 index 1536c6051884..000000000000 --- a/metadata/preview/azure-arm-streamanalytics.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-streamanalytics", - "Version": "3.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/streamanalytics/arm-streamanalytics", - "ServiceDirectory": "streamanalytics", - "ReadMePath": "sdk/streamanalytics/arm-streamanalytics/README.md", - "ChangeLogPath": "sdk/streamanalytics/arm-streamanalytics/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-streamanalytics", - "ReleaseStatus": "2021-11-02" -} diff --git a/metadata/preview/azure-arm-templatespecs.json b/metadata/preview/azure-arm-templatespecs.json deleted file mode 100644 index 89ff4c11cb10..000000000000 --- a/metadata/preview/azure-arm-templatespecs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-templatespecs", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/templatespecs/arm-templatespecs", - "ServiceDirectory": "templatespecs", - "ReadMePath": "sdk/templatespecs/arm-templatespecs/README.md", - "ChangeLogPath": "sdk/templatespecs/arm-templatespecs/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-templatespecs", - "ReleaseStatus": "2021-08-25" -} diff --git a/metadata/preview/azure-arm-trafficmanager.json b/metadata/preview/azure-arm-trafficmanager.json deleted file mode 100644 index d2cfa8ad3319..000000000000 --- a/metadata/preview/azure-arm-trafficmanager.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-trafficmanager", - "Version": "6.1.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/trafficmanager/arm-trafficmanager", - "ServiceDirectory": "trafficmanager", - "ReadMePath": "sdk/trafficmanager/arm-trafficmanager/README.md", - "ChangeLogPath": "sdk/trafficmanager/arm-trafficmanager/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-trafficmanager", - "ReleaseStatus": "2022-11-15" -} diff --git a/metadata/preview/azure-arm-voiceservices.json b/metadata/preview/azure-arm-voiceservices.json deleted file mode 100644 index b8aed6e0065b..000000000000 --- a/metadata/preview/azure-arm-voiceservices.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-voiceservices", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/voiceservices/arm-voiceservices", - "ServiceDirectory": "voiceservices", - "ReadMePath": "sdk/voiceservices/arm-voiceservices/README.md", - "ChangeLogPath": "sdk/voiceservices/arm-voiceservices/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-voiceservices", - "ReleaseStatus": "2023-03-07" -} diff --git a/metadata/preview/azure-arm-workloads.json b/metadata/preview/azure-arm-workloads.json deleted file mode 100644 index 9f22b5f293e6..000000000000 --- a/metadata/preview/azure-arm-workloads.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/arm-workloads", - "Version": "1.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/workloads/arm-workloads", - "ServiceDirectory": "workloads", - "ReadMePath": "sdk/workloads/arm-workloads/README.md", - "ChangeLogPath": "sdk/workloads/arm-workloads/CHANGELOG.md", - "Group": null, - "SdkType": "mgmt", - "IsNewSdk": true, - "ArtifactName": "azure-arm-workloads", - "ReleaseStatus": "2023-03-02" -} diff --git a/metadata/preview/azure-communication-email.json b/metadata/preview/azure-communication-email.json deleted file mode 100644 index 0e76f91168d4..000000000000 --- a/metadata/preview/azure-communication-email.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/communication-email", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/communication/communication-email", - "ServiceDirectory": "communication", - "ReadMePath": "sdk/communication/communication-email/README.md", - "ChangeLogPath": "sdk/communication/communication-email/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-communication-email", - "ReleaseStatus": "2023-03-01" -} diff --git a/metadata/preview/azure-communication-identity.json b/metadata/preview/azure-communication-identity.json deleted file mode 100644 index b79248893c95..000000000000 --- a/metadata/preview/azure-communication-identity.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/communication-identity", - "Version": "1.1.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/communication/communication-identity", - "ServiceDirectory": "communication", - "ReadMePath": "sdk/communication/communication-identity/README.md", - "ChangeLogPath": "sdk/communication/communication-identity/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-communication-identity", - "ReleaseStatus": "2022-04-05" -} diff --git a/metadata/preview/azure-communication-rooms.json b/metadata/preview/azure-communication-rooms.json deleted file mode 100644 index 43f78abcb043..000000000000 --- a/metadata/preview/azure-communication-rooms.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/communication-rooms", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/communication/communication-rooms", - "ServiceDirectory": "communication", - "ReadMePath": "sdk/communication/communication-rooms/README.md", - "ChangeLogPath": "sdk/communication/communication-rooms/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-communication-rooms", - "ReleaseStatus": "2023-05-17" -} diff --git a/metadata/preview/azure-container-registry.json b/metadata/preview/azure-container-registry.json deleted file mode 100644 index 08242c9e439b..000000000000 --- a/metadata/preview/azure-container-registry.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/container-registry", - "Version": "1.1.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/containerregistry/container-registry", - "ServiceDirectory": "containerregistry", - "ReadMePath": "sdk/containerregistry/container-registry/README.md", - "ChangeLogPath": "sdk/containerregistry/container-registry/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-container-registry", - "ReleaseStatus": "2023-04-11" -} diff --git a/metadata/preview/azure-core-lro.json b/metadata/preview/azure-core-lro.json deleted file mode 100644 index f64dc586f124..000000000000 --- a/metadata/preview/azure-core-lro.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/core-lro", - "Version": "2.3.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/core/core-lro", - "ServiceDirectory": "core", - "ReadMePath": "sdk/core/core-lro/README.md", - "ChangeLogPath": "sdk/core/core-lro/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-core-lro", - "ReleaseStatus": "2022-05-18" -} diff --git a/metadata/preview/azure-core-tracing.json b/metadata/preview/azure-core-tracing.json deleted file mode 100644 index 71d5309b1e9a..000000000000 --- a/metadata/preview/azure-core-tracing.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/core-tracing", - "Version": "1.0.0-preview.14", - "DevVersion": null, - "DirectoryPath": "sdk/core/core-tracing", - "ServiceDirectory": "core", - "ReadMePath": "sdk/core/core-tracing/README.md", - "ChangeLogPath": "sdk/core/core-tracing/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-core-tracing", - "ReleaseStatus": "2022-02-03" -} diff --git a/metadata/preview/azure-digital-twins-core.json b/metadata/preview/azure-digital-twins-core.json deleted file mode 100644 index 66fad94a339e..000000000000 --- a/metadata/preview/azure-digital-twins-core.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/digital-twins-core", - "Version": "1.1.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/digitaltwins/digital-twins-core", - "ServiceDirectory": "digitaltwins", - "ReadMePath": "sdk/digitaltwins/digital-twins-core/README.md", - "ChangeLogPath": "sdk/digitaltwins/digital-twins-core/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-digital-twins-core", - "ReleaseStatus": "2022-04-04" -} diff --git a/metadata/preview/azure-event-hubs.json b/metadata/preview/azure-event-hubs.json deleted file mode 100644 index 021850fb18bf..000000000000 --- a/metadata/preview/azure-event-hubs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/event-hubs", - "Version": "5.8.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/eventhub/event-hubs", - "ServiceDirectory": "eventhub", - "ReadMePath": "sdk/eventhub/event-hubs/README.md", - "ChangeLogPath": "sdk/eventhub/event-hubs/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-event-hubs", - "ReleaseStatus": "2022-04-05" -} diff --git a/metadata/preview/azure-eventgrid.json b/metadata/preview/azure-eventgrid.json deleted file mode 100644 index 5e423f9d22d1..000000000000 --- a/metadata/preview/azure-eventgrid.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/eventgrid", - "Version": "4.13.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/eventgrid/eventgrid", - "ServiceDirectory": "eventgrid", - "ReadMePath": "sdk/eventgrid/eventgrid/README.md", - "ChangeLogPath": "sdk/eventgrid/eventgrid/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-eventgrid", - "ReleaseStatus": "2023-06-26" -} diff --git a/metadata/preview/azure-identity-cache-persistence.json b/metadata/preview/azure-identity-cache-persistence.json deleted file mode 100644 index a3156403716a..000000000000 --- a/metadata/preview/azure-identity-cache-persistence.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/identity-cache-persistence", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/identity/identity-cache-persistence", - "ServiceDirectory": "identity", - "ReadMePath": "sdk/identity/identity-cache-persistence/README.md", - "ChangeLogPath": "sdk/identity/identity-cache-persistence/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-identity-cache-persistence", - "ReleaseStatus": "2021-09-09" -} diff --git a/metadata/preview/azure-identity-vscode.json b/metadata/preview/azure-identity-vscode.json deleted file mode 100644 index 97dd0584ae76..000000000000 --- a/metadata/preview/azure-identity-vscode.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/identity-vscode", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/identity/identity-vscode", - "ServiceDirectory": "identity", - "ReadMePath": "sdk/identity/identity-vscode/README.md", - "ChangeLogPath": "sdk/identity/identity-vscode/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-identity-vscode", - "ReleaseStatus": "2021-09-09" -} diff --git a/metadata/preview/azure-identity.json b/metadata/preview/azure-identity.json deleted file mode 100644 index 459e9438c963..000000000000 --- a/metadata/preview/azure-identity.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/identity", - "Version": "3.2.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/identity/identity", - "ServiceDirectory": "identity", - "ReadMePath": "sdk/identity/identity/README.md", - "ChangeLogPath": "sdk/identity/identity/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-identity", - "ReleaseStatus": "2023-04-13" -} diff --git a/metadata/preview/azure-keyvault-admin.json b/metadata/preview/azure-keyvault-admin.json deleted file mode 100644 index 67a1722ddb76..000000000000 --- a/metadata/preview/azure-keyvault-admin.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/keyvault-admin", - "Version": "4.4.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/keyvault/keyvault-admin", - "ServiceDirectory": "keyvault", - "ReadMePath": "sdk/keyvault/keyvault-admin/README.md", - "ChangeLogPath": "sdk/keyvault/keyvault-admin/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-keyvault-admin", - "ReleaseStatus": "2022-11-10" -} diff --git a/metadata/preview/azure-keyvault-certificates.json b/metadata/preview/azure-keyvault-certificates.json deleted file mode 100644 index ba337ea198d6..000000000000 --- a/metadata/preview/azure-keyvault-certificates.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/keyvault-certificates", - "Version": "4.5.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/keyvault/keyvault-certificates", - "ServiceDirectory": "keyvault", - "ReadMePath": "sdk/keyvault/keyvault-certificates/README.md", - "ChangeLogPath": "sdk/keyvault/keyvault-certificates/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-keyvault-certificates", - "ReleaseStatus": "2022-07-07" -} diff --git a/metadata/preview/azure-keyvault-common.json b/metadata/preview/azure-keyvault-common.json deleted file mode 100644 index 1d4a9e2d18bd..000000000000 --- a/metadata/preview/azure-keyvault-common.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/keyvault-common", - "Version": "1.0.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/keyvault/keyvault-common", - "ServiceDirectory": "keyvault", - "ReadMePath": "sdk/keyvault/keyvault-common/README.md", - "ChangeLogPath": "sdk/keyvault/keyvault-common/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-keyvault-common", - "ReleaseStatus": "2022-11-08" -} diff --git a/metadata/preview/azure-keyvault-keys.json b/metadata/preview/azure-keyvault-keys.json deleted file mode 100644 index 6f87f4cceba9..000000000000 --- a/metadata/preview/azure-keyvault-keys.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/keyvault-keys", - "Version": "4.7.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/keyvault/keyvault-keys", - "ServiceDirectory": "keyvault", - "ReadMePath": "sdk/keyvault/keyvault-keys/README.md", - "ChangeLogPath": "sdk/keyvault/keyvault-keys/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-keyvault-keys", - "ReleaseStatus": "2022-11-10" -} diff --git a/metadata/preview/azure-keyvault-secrets.json b/metadata/preview/azure-keyvault-secrets.json deleted file mode 100644 index fdc47643a8a7..000000000000 --- a/metadata/preview/azure-keyvault-secrets.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/keyvault-secrets", - "Version": "4.5.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/keyvault/keyvault-secrets", - "ServiceDirectory": "keyvault", - "ReadMePath": "sdk/keyvault/keyvault-secrets/README.md", - "ChangeLogPath": "sdk/keyvault/keyvault-secrets/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-keyvault-secrets", - "ReleaseStatus": "2022-07-07" -} diff --git a/metadata/preview/azure-monitor-ingestion.json b/metadata/preview/azure-monitor-ingestion.json deleted file mode 100644 index 3b758201cfa6..000000000000 --- a/metadata/preview/azure-monitor-ingestion.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/monitor-ingestion", - "Version": "1.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/monitor/monitor-ingestion", - "ServiceDirectory": "monitor", - "ReadMePath": "sdk/monitor/monitor-ingestion/README.md", - "ChangeLogPath": "sdk/monitor/monitor-ingestion/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-monitor-ingestion", - "ReleaseStatus": "2022-10-13" -} diff --git a/metadata/preview/azure-monitor-opentelemetry.json b/metadata/preview/azure-monitor-opentelemetry.json deleted file mode 100644 index 682dc4e794fc..000000000000 --- a/metadata/preview/azure-monitor-opentelemetry.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/monitor-opentelemetry", - "Version": "1.0.0-beta.3", - "DevVersion": null, - "DirectoryPath": "sdk/monitor/monitor-opentelemetry", - "ServiceDirectory": "monitor", - "ReadMePath": "sdk/monitor/monitor-opentelemetry/README.md", - "ChangeLogPath": "sdk/monitor/monitor-opentelemetry/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-monitor-opentelemetry", - "ReleaseStatus": "2023-08-30" -} diff --git a/metadata/preview/azure-notification-hubs.json b/metadata/preview/azure-notification-hubs.json deleted file mode 100644 index d2c80bd3d3e8..000000000000 --- a/metadata/preview/azure-notification-hubs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/notification-hubs", - "Version": "1.0.0-beta.8", - "DevVersion": null, - "DirectoryPath": "sdk/notificationhubs/notification-hubs", - "ServiceDirectory": "notificationhubs", - "ReadMePath": "sdk/notificationhubs/notification-hubs/README.md", - "ChangeLogPath": "sdk/notificationhubs/notification-hubs/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-notification-hubs", - "ReleaseStatus": "2022-11-21" -} diff --git a/metadata/preview/azure-rest-core-client.json b/metadata/preview/azure-rest-core-client.json deleted file mode 100644 index a33f660c3a27..000000000000 --- a/metadata/preview/azure-rest-core-client.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure-rest/core-client", - "Version": "1.0.0-beta.10", - "DevVersion": null, - "DirectoryPath": "sdk/core/core-client-rest", - "ServiceDirectory": "core", - "ReadMePath": "sdk/core/core-client-rest/README.md", - "ChangeLogPath": "sdk/core/core-client-rest/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-rest-core-client", - "ReleaseStatus": "2022-06-07" -} diff --git a/metadata/preview/azure-rest-iot-device-update.json b/metadata/preview/azure-rest-iot-device-update.json deleted file mode 100644 index e769f01781d5..000000000000 --- a/metadata/preview/azure-rest-iot-device-update.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure-rest/iot-device-update", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/deviceupdate/iot-device-update-rest", - "ServiceDirectory": "deviceupdate", - "ReadMePath": "sdk/deviceupdate/iot-device-update-rest/README.md", - "ChangeLogPath": "sdk/deviceupdate/iot-device-update-rest/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-rest-iot-device-update", - "ReleaseStatus": "2022-07-08" -} diff --git a/metadata/preview/azure-rest-load-testing.json b/metadata/preview/azure-rest-load-testing.json deleted file mode 100644 index ffb40d6dfcbd..000000000000 --- a/metadata/preview/azure-rest-load-testing.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure-rest/load-testing", - "Version": "1.0.0-beta.2", - "DevVersion": null, - "DirectoryPath": "sdk/loadtestservice/load-testing-rest", - "ServiceDirectory": "loadtestservice", - "ReadMePath": "sdk/loadtestservice/load-testing-rest/README.md", - "ChangeLogPath": "sdk/loadtestservice/load-testing-rest/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-rest-load-testing", - "ReleaseStatus": "2023-01-26" -} diff --git a/metadata/preview/azure-schema-registry-avro.json b/metadata/preview/azure-schema-registry-avro.json deleted file mode 100644 index dacfa9e4e239..000000000000 --- a/metadata/preview/azure-schema-registry-avro.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/schema-registry-avro", - "Version": "1.0.0-beta.8", - "DevVersion": null, - "DirectoryPath": "sdk/schemaregistry/schema-registry-avro", - "ServiceDirectory": "schemaregistry", - "ReadMePath": "sdk/schemaregistry/schema-registry-avro/README.md", - "ChangeLogPath": "sdk/schemaregistry/schema-registry-avro/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-schema-registry-avro", - "ReleaseStatus": "2022-04-05" -} diff --git a/metadata/preview/azure-service-bus.json b/metadata/preview/azure-service-bus.json deleted file mode 100644 index 8f4fa050ca1b..000000000000 --- a/metadata/preview/azure-service-bus.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/service-bus", - "Version": "7.8.1-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/servicebus/service-bus", - "ServiceDirectory": "servicebus", - "ReadMePath": "sdk/servicebus/service-bus/README.md", - "ChangeLogPath": "sdk/servicebus/service-bus/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-service-bus", - "ReleaseStatus": "2023-02-27" -} diff --git a/metadata/preview/azure-storage-blob.json b/metadata/preview/azure-storage-blob.json deleted file mode 100644 index b036527a87b1..000000000000 --- a/metadata/preview/azure-storage-blob.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/storage-blob", - "Version": "12.16.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/storage/storage-blob", - "ServiceDirectory": "storage", - "ReadMePath": "sdk/storage/storage-blob/README.md", - "ChangeLogPath": "sdk/storage/storage-blob/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-storage-blob", - "ReleaseStatus": "2023-08-11" -} diff --git a/metadata/preview/azure-storage-file-datalake.json b/metadata/preview/azure-storage-file-datalake.json deleted file mode 100644 index 62e066db85e5..000000000000 --- a/metadata/preview/azure-storage-file-datalake.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/storage-file-datalake", - "Version": "12.15.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/storage/storage-file-datalake", - "ServiceDirectory": "storage", - "ReadMePath": "sdk/storage/storage-file-datalake/README.md", - "ChangeLogPath": "sdk/storage/storage-file-datalake/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-storage-file-datalake", - "ReleaseStatus": "2023-08-11" -} diff --git a/metadata/preview/azure-storage-file-share.json b/metadata/preview/azure-storage-file-share.json deleted file mode 100644 index 7e477e7825fb..000000000000 --- a/metadata/preview/azure-storage-file-share.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/storage-file-share", - "Version": "12.15.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/storage/storage-file-share", - "ServiceDirectory": "storage", - "ReadMePath": "sdk/storage/storage-file-share/README.md", - "ChangeLogPath": "sdk/storage/storage-file-share/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-storage-file-share", - "ReleaseStatus": "2023-05-31" -} diff --git a/metadata/preview/azure-storage-queue.json b/metadata/preview/azure-storage-queue.json deleted file mode 100644 index 2f5e64e0c8a8..000000000000 --- a/metadata/preview/azure-storage-queue.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/storage-queue", - "Version": "12.8.0-beta.1", - "DevVersion": null, - "DirectoryPath": "sdk/storage/storage-queue", - "ServiceDirectory": "storage", - "ReadMePath": "sdk/storage/storage-queue/README.md", - "ChangeLogPath": "sdk/storage/storage-queue/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-storage-queue", - "ReleaseStatus": "2021-11-09" -} diff --git a/metadata/preview/azure-web-pubsub-express.json b/metadata/preview/azure-web-pubsub-express.json deleted file mode 100644 index e921f6f6913f..000000000000 --- a/metadata/preview/azure-web-pubsub-express.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/web-pubsub-express", - "Version": "1.0.0-beta.4", - "DevVersion": null, - "DirectoryPath": "sdk/web-pubsub/web-pubsub-express", - "ServiceDirectory": "web-pubsub", - "ReadMePath": "sdk/web-pubsub/web-pubsub-express/README.md", - "ChangeLogPath": "sdk/web-pubsub/web-pubsub-express/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-web-pubsub-express", - "ReleaseStatus": "2021-11-09" -} diff --git a/metadata/preview/azure-web-pubsub.json b/metadata/preview/azure-web-pubsub.json deleted file mode 100644 index d9d7f71bbba2..000000000000 --- a/metadata/preview/azure-web-pubsub.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Name": "@azure/web-pubsub", - "Version": "1.0.0-beta.4", - "DevVersion": null, - "DirectoryPath": "sdk/web-pubsub/web-pubsub", - "ServiceDirectory": "web-pubsub", - "ReadMePath": "sdk/web-pubsub/web-pubsub/README.md", - "ChangeLogPath": "sdk/web-pubsub/web-pubsub/CHANGELOG.md", - "Group": null, - "SdkType": "client", - "IsNewSdk": true, - "ArtifactName": "azure-web-pubsub", - "ReleaseStatus": "2021-11-09" -}