Nota
O acesso a esta página requer autorização. Pode tentar iniciar sessão ou alterar os diretórios.
O acesso a esta página requer autorização. Pode tentar alterar os diretórios.
Este pacote contém um SDK isomórfico (executado em Node.js e em navegadores) para o cliente Azure ComputeSchedule.
API de gerenciamento do provedor de recursos Microsoft.ComputeSchedule.
Key links:
Getting started
Ambientes atualmente suportados
- Versões LTS do Node.js
- Últimas versões do Safari, Chrome, Edge e Firefox.
See our support policy for more details.
Prerequisites
Instalar o pacote @azure/arm-computeschedule
Instale a biblioteca de cliente do Azure ComputeSchedule para JavaScript com npm:
npm install @azure/arm-computeschedule
Criar e autenticar um ComputeScheduleClient
Para criar um objeto cliente para acessar a API ComputeSchedule do Azure, você precisará endpoint do recurso ComputeSchedule do Azure e de um credentialarquivo . O cliente Azure ComputeSchedule pode usar credenciais do Azure Ative Directory para autenticar.
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
Você também precisará registrar um novo aplicativo AAD e conceder acesso ao Azure ComputeSchedule atribuindo a função adequada à sua entidade de serviço (observação: funções como "Owner" não concederão as permissões necessárias).
For more information about how to create an Azure AD Application check out this guide.
Usando ambientes Node.js e Node-like, você pode usar a classe DefaultAzureCredential para autenticar o cliente.
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);
Para ambientes de navegador, use o InteractiveBrowserCredential do pacote @azure/identity para autenticar.
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
Para usar essa biblioteca de cliente no navegador, primeiro você precisa usar um bundler. For details on how to do this, please refer to our bundling documentation.
Key concepts
ComputeScheduleClient
ComputeScheduleClient é a interface principal para desenvolvedores que usam a biblioteca de cliente Azure ComputeSchedule. Explore os métodos neste objeto de cliente para entender os diferentes recursos do serviço Azure ComputeSchedule que você pode acessar.
Troubleshooting
Logging
Habilitar o registro em log pode ajudar a descobrir informações úteis sobre falhas. Para ver um log de solicitações e respostas HTTP, defina a AZURE_LOG_LEVEL variável de ambiente como info. Como alternativa, o registro em log pode ser habilitado em tempo de execução chamando setLogLevel o @azure/logger:
import { setLogLevel } from "@azure/logger";
setLogLevel("info");
Para obter instruções mais detalhadas sobre como habilitar logs, você pode consultar os documentos do pacote @azure/logger.
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
- SDK do Microsoft Azure para JavaScript
Azure SDK for JavaScript