이 패키지에는 Azure ComputeSchedule 클라이언트용 동형 SDK(Node.js와 브라우저 모두에서 실행)가 포함되어 있습니다.
Microsoft.ComputeSchedule 리소스 공급자 관리 API.
Key links:
Getting started
현재 지원되는 환경
- Node.js의 LTS 버전
- Safari, Chrome, Edge 및 Firefox의 최신 버전입니다.
See our support policy for more details.
Prerequisites
@azure/arm-computeschedule 패키지 설치
다음을 사용하여 npmJavaScript용 Azure ComputeSchedule 클라이언트 라이브러리를 설치합니다.
npm install @azure/arm-computeschedule
ComputeScheduleClient를 만들고 인증하기
Azure ComputeSchedule API endpoint 에 액세스하기 위한 클라이언트 개체를 만들려면 Azure ComputeSchedule 리소스와 credential. Azure ComputeSchedule 클라이언트는 Azure Active Directory 자격 증명을 사용하여 인증할 수 있습니다.
You can find the endpoint for your Azure ComputeSchedule resource in the Azure Portal.
You can authenticate with Azure Active Directory using a credential from the @azure/identity library or an existing AAD Token.
To use the DefaultAzureCredential provider shown below, or other credential providers provided with the Azure SDK, please install the @azure/identity package:
npm install @azure/identity
또한 새 AAD 응용 프로그램을 등록하고 서비스 주체에 적절한 역할을 할당하여 Azure ComputeSchedule에 대한 액세스 권한을 부여 해야 합니다(참고: 다음과 "Owner" 같은 역할은 필요한 권한을 부여하지 않음).
For more information about how to create an Azure AD Application check out this guide.
Node.js 및 노드와 유사한 환경을 사용하여 DefaultAzureCredential 클래스를 사용하여 클라이언트를 인증할 수 있습니다.
import { ComputeScheduleClient } from "@azure/arm-computeschedule";
import { DefaultAzureCredential } from "@azure/identity";
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new ComputeScheduleClient(new DefaultAzureCredential(), subscriptionId);
브라우저 환경의 경우 InteractiveBrowserCredential 패키지의 @azure/identity 사용하여 인증합니다.
import { InteractiveBrowserCredential } from "@azure/identity";
import { ComputeScheduleClient } from "@azure/arm-computeschedule";
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new InteractiveBrowserCredential({
tenantId: "<YOUR_TENANT_ID>",
clientId: "<YOUR_CLIENT_ID>",
});
const client = new ComputeScheduleClient(credential, subscriptionId);
JavaScript Bundle
브라우저에서 이 클라이언트 라이브러리를 사용하려면 먼저 번들러를 사용해야 합니다. For details on how to do this, please refer to our bundling documentation.
Key concepts
ComputeScheduleClient
ComputeScheduleClient 는 Azure ComputeSchedule 클라이언트 라이브러리를 사용하는 개발자를 위한 기본 인터페이스입니다. 이 클라이언트 개체의 메서드를 탐색하여 액세스할 수 있는 Azure ComputeSchedule 서비스의 다양한 기능을 이해합니다.
Troubleshooting
Logging
로깅을 사용하도록 설정하면 오류에 대한 유용한 정보를 파악하는 데 도움이 될 수 있습니다. HTTP 요청 및 응답 로그를 보려면 AZURE_LOG_LEVEL 환경 변수를 info설정합니다. 또는 setLogLevel@azure/logger 호출하여 런타임에 로깅을 사용하도록 설정할 수 있습니다.
import { setLogLevel } from "@azure/logger";
setLogLevel("info");
로그를 사용하도록 설정하는 방법에 대한 자세한 지침은 @azure/로거 패키지 문서확인할 수 있습니다.
Contributing
If you'd like to contribute to this library, please read the contributing guide to learn more about how to build and test the code.
Related projects
- JavaScript용 Microsoft Azure SDK
Azure SDK for JavaScript