azure-sdk-for-js/sdk/visualstudio/arm-visualstudio
KarishmaGhiya d807729ccc
Move arm packages- batch2 (#2229)
* resolved conflicts in arm-compute package

* Moved arm-cognitiveservices

* Moved arm-cosmosdb

* Moved arm-hanaonazure

* Moved arm-hdinsight

* Moved arm-iotcentral

* Moved arm-iothub

* Moved arm-iotspaces

* Moved arm-kusto

* Moved arm-labservices

* Moved arm-links

* Moved arm-locks

* Moved arm-logic and arm-machinelearningcompute

* Moved  arm-machinelearningexperimentation

* Moved arm-machinelearningservices

* Moved arm-managedapplications

* Moved arm-managementgroups

* Moved arm-managementpartner

* Moved arm-maps

* Moved arm-mariadb

* Moved arm-marketplaceordering

* Moved arm-mediaservices

* Moved arm-migrate

* Moved arm-mixedreality

* Moved arm-monitor

* Moved arm-msi

* Moved arm-mysql

* Moved arm-netapp

* Moved arm-network

* Moved arm-notificationhubs

* Moved arm-operationalinsights

* Moved arm-operations

* Moved arm-policy

* Moved arm-policyinsights

* Moved arm-postgresql

* Moved arm-powerbidedicated

* Moved arm-powerbiembedded

* Moved arm-privatedns

* Moved arm-recoveryservices

* Moved arm-recoveryservices-siterecovery

* Moved arm-recoveryservicesbackup

* Moved arm-rediscache

* Moved arm-relay

* Moved arm-reservations

* Moved arm-resourcegraph

* Moved arm-resourcehealth

* Moved arm-resources

* Moved arm-search

* Moved arm-security

* Moved arm-servicebus

* Moved arm-servicefabricmesh

* Moved arm-servicemap

* Moved arm-signalr

* Moved arm-sql

* Moved arm-sqlvirtualmachine

* Moved arm-storage

* Moved arm-storageimportexport

* Moved arm-storagesync

* Moved arm-storsimple1200series

* Moved arm-storsimple8000series

* Moved arm-streamanalytics

* Moved arm-subscriptions

* Moved arm-timeseriesinsights

* Moved arm-trafficmanager

* Moved arm-visualstudio

* Moved arm-webservices

* Moved arm-workspaces

* moved arm-workspaces and arm-webservices under machinelearning service folder

* Moved arm-commitmentplans

* Moved arm-containerregistry

* Moved arm-containerservice

* fixed the repo structure for arm-containerservice

* updated service folder for arm-operations

* updated service folder for arm-subscriptions

* updated service folder for arm-recoveryservices-siterecovery

* updated service folder for arm-servicemap

* updated service folder for arm-rediscache

* updated service folder for arm-rediscache
2019-04-15 16:10:23 -07:00
..
src Move arm packages- batch2 (#2229) 2019-04-15 16:10:23 -07:00
LICENSE.txt Move arm packages- batch2 (#2229) 2019-04-15 16:10:23 -07:00
README.md Move arm packages- batch2 (#2229) 2019-04-15 16:10:23 -07:00
package.json Move arm packages- batch2 (#2229) 2019-04-15 16:10:23 -07:00
rollup.config.js Move arm packages- batch2 (#2229) 2019-04-15 16:10:23 -07:00
tsconfig.json Move arm packages- batch2 (#2229) 2019-04-15 16:10:23 -07:00

README.md

Azure VisualStudioResourceProviderClient SDK for JavaScript

This package contains an isomorphic SDK for VisualStudioResourceProviderClient.

Currently supported environments

  • Node.js version 6.x.x or higher
  • Browser JavaScript

How to Install

npm install @azure/arm-visualstudio

How to use

nodejs - Authentication, client creation and list operations as an example written in TypeScript.

Install @azure/ms-rest-nodeauth
npm install @azure/ms-rest-nodeauth
Sample code
import * as msRest from "@azure/ms-rest-js";
import * as msRestAzure from "@azure/ms-rest-azure-js";
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
import { VisualStudioResourceProviderClient, VisualStudioResourceProviderModels, VisualStudioResourceProviderMappers } from "@azure/arm-visualstudio";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
  const client = new VisualStudioResourceProviderClient(creds, subscriptionId);
  client.operations.list().then((result) => {
    console.log("The result is:");
    console.log(result);
  });
}).catch((err) => {
  console.error(err);
});

browser - Authentication, client creation and list operations as an example written in JavaScript.

Install @azure/ms-rest-browserauth
npm install @azure/ms-rest-browserauth
Sample code

See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

  • index.html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>@azure/arm-visualstudio sample</title>
    <script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
    <script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
    <script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
    <script src="node_modules/@azure/arm-visualstudio/dist/arm-visualstudio.js"></script>
    <script type="text/javascript">
      const subscriptionId = "<Subscription_Id>";
      const authManager = new msAuth.AuthManager({
        clientId: "<client id for your Azure AD app>",
        tenant: "<optional tenant for your organization>"
      });
      authManager.finalizeLogin().then((res) => {
        if (!res.isLoggedIn) {
          // may cause redirects
          authManager.login();
        }
        const client = new Azure.ArmVisualstudio.VisualStudioResourceProviderClient(res.creds, subscriptionId);
        client.operations.list().then((result) => {
          console.log("The result is:");
          console.log(result);
        }).catch((err) => {
          console.log("An error occurred:");
          console.error(err);
        });
      });
    </script>
  </head>
  <body></body>
</html>

Impressions