@azure/arm-visualstudio 3.0.0 → 4.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/LICENSE.txt +1 -1
  4. package/README.md +70 -78
  5. package/dist/index.js +1332 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.min.js +1 -0
  8. package/dist/index.min.js.map +1 -0
  9. package/dist-esm/samples-dev/checkAvailabilityOfAnAccountName.d.ts +2 -0
  10. package/dist-esm/samples-dev/checkAvailabilityOfAnAccountName.d.ts.map +1 -0
  11. package/dist-esm/samples-dev/checkAvailabilityOfAnAccountName.js +33 -0
  12. package/dist-esm/samples-dev/checkAvailabilityOfAnAccountName.js.map +1 -0
  13. package/dist-esm/samples-dev/createAProjectResource.d.ts +2 -0
  14. package/dist-esm/samples-dev/createAProjectResource.d.ts.map +1 -0
  15. package/dist-esm/samples-dev/createAProjectResource.js +43 -0
  16. package/dist-esm/samples-dev/createAProjectResource.js.map +1 -0
  17. package/dist-esm/samples-dev/createAnAccountResource.d.ts +2 -0
  18. package/dist-esm/samples-dev/createAnAccountResource.d.ts.map +1 -0
  19. package/dist-esm/samples-dev/createAnAccountResource.js +32 -0
  20. package/dist-esm/samples-dev/createAnAccountResource.js.map +1 -0
  21. package/dist-esm/samples-dev/createAnExtensionResource.d.ts +2 -0
  22. package/dist-esm/samples-dev/createAnExtensionResource.d.ts.map +1 -0
  23. package/dist-esm/samples-dev/createAnExtensionResource.js +44 -0
  24. package/dist-esm/samples-dev/createAnExtensionResource.js.map +1 -0
  25. package/dist-esm/samples-dev/deleteAnAccountResource.d.ts +2 -0
  26. package/dist-esm/samples-dev/deleteAnAccountResource.d.ts.map +1 -0
  27. package/dist-esm/samples-dev/deleteAnAccountResource.js +31 -0
  28. package/dist-esm/samples-dev/deleteAnAccountResource.js.map +1 -0
  29. package/dist-esm/samples-dev/deleteAnExtensionResource.d.ts +2 -0
  30. package/dist-esm/samples-dev/deleteAnExtensionResource.d.ts.map +1 -0
  31. package/dist-esm/samples-dev/deleteAnExtensionResource.js +32 -0
  32. package/dist-esm/samples-dev/deleteAnExtensionResource.js.map +1 -0
  33. package/dist-esm/samples-dev/getAListOfAccountResourcesInTheResourceGroup.d.ts +2 -0
  34. package/dist-esm/samples-dev/getAListOfAccountResourcesInTheResourceGroup.d.ts.map +1 -0
  35. package/dist-esm/samples-dev/getAListOfAccountResourcesInTheResourceGroup.js +30 -0
  36. package/dist-esm/samples-dev/getAListOfAccountResourcesInTheResourceGroup.js.map +1 -0
  37. package/dist-esm/samples-dev/getAListOfExtensionResourcesWithinTheResourceGroup.d.ts +2 -0
  38. package/dist-esm/samples-dev/getAListOfExtensionResourcesWithinTheResourceGroup.d.ts.map +1 -0
  39. package/dist-esm/samples-dev/getAListOfExtensionResourcesWithinTheResourceGroup.js +31 -0
  40. package/dist-esm/samples-dev/getAListOfExtensionResourcesWithinTheResourceGroup.js.map +1 -0
  41. package/dist-esm/samples-dev/getAListOfOperationsForThisResourceProvider.d.ts +2 -0
  42. package/dist-esm/samples-dev/getAListOfOperationsForThisResourceProvider.d.ts.map +1 -0
  43. package/dist-esm/samples-dev/getAListOfOperationsForThisResourceProvider.js +29 -0
  44. package/dist-esm/samples-dev/getAListOfOperationsForThisResourceProvider.js.map +1 -0
  45. package/dist-esm/samples-dev/getAListOfProjectResourcesInTheTeamServicesAccount.d.ts +2 -0
  46. package/dist-esm/samples-dev/getAListOfProjectResourcesInTheTeamServicesAccount.d.ts.map +1 -0
  47. package/dist-esm/samples-dev/getAListOfProjectResourcesInTheTeamServicesAccount.js +31 -0
  48. package/dist-esm/samples-dev/getAListOfProjectResourcesInTheTeamServicesAccount.js.map +1 -0
  49. package/dist-esm/samples-dev/getAProjectResource.d.ts +2 -0
  50. package/dist-esm/samples-dev/getAProjectResource.d.ts.map +1 -0
  51. package/dist-esm/samples-dev/getAProjectResource.js +32 -0
  52. package/dist-esm/samples-dev/getAProjectResource.js.map +1 -0
  53. package/dist-esm/samples-dev/getAnAccountResource.d.ts +2 -0
  54. package/dist-esm/samples-dev/getAnAccountResource.d.ts.map +1 -0
  55. package/dist-esm/samples-dev/getAnAccountResource.js +31 -0
  56. package/dist-esm/samples-dev/getAnAccountResource.js.map +1 -0
  57. package/dist-esm/samples-dev/getAnExtensionResource.d.ts +2 -0
  58. package/dist-esm/samples-dev/getAnExtensionResource.d.ts.map +1 -0
  59. package/dist-esm/samples-dev/getAnExtensionResource.js +32 -0
  60. package/dist-esm/samples-dev/getAnExtensionResource.js.map +1 -0
  61. package/dist-esm/samples-dev/getTheStatusOfTheProjectCreationJob.d.ts +2 -0
  62. package/dist-esm/samples-dev/getTheStatusOfTheProjectCreationJob.d.ts.map +1 -0
  63. package/dist-esm/samples-dev/getTheStatusOfTheProjectCreationJob.js +36 -0
  64. package/dist-esm/samples-dev/getTheStatusOfTheProjectCreationJob.js.map +1 -0
  65. package/dist-esm/samples-dev/updateAProjectResource.d.ts +2 -0
  66. package/dist-esm/samples-dev/updateAProjectResource.d.ts.map +1 -0
  67. package/dist-esm/samples-dev/updateAProjectResource.js +40 -0
  68. package/dist-esm/samples-dev/updateAProjectResource.js.map +1 -0
  69. package/dist-esm/samples-dev/updateAnExtensionResource.d.ts +2 -0
  70. package/dist-esm/samples-dev/updateAnExtensionResource.d.ts.map +1 -0
  71. package/dist-esm/samples-dev/updateAnExtensionResource.js +44 -0
  72. package/dist-esm/samples-dev/updateAnExtensionResource.js.map +1 -0
  73. package/dist-esm/src/index.d.ts +4 -0
  74. package/dist-esm/src/index.d.ts.map +1 -0
  75. package/dist-esm/src/index.js +11 -0
  76. package/dist-esm/src/index.js.map +1 -0
  77. package/dist-esm/src/lroImpl.d.ts +16 -0
  78. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  79. package/dist-esm/src/lroImpl.js +29 -0
  80. package/dist-esm/src/lroImpl.js.map +1 -0
  81. package/dist-esm/src/models/index.d.ts +253 -0
  82. package/dist-esm/src/models/index.d.ts.map +1 -0
  83. package/{esm → dist-esm/src}/models/index.js +1 -0
  84. package/dist-esm/src/models/index.js.map +1 -0
  85. package/dist-esm/src/models/mappers.d.ts +18 -0
  86. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  87. package/{esm → dist-esm/src}/models/mappers.js +168 -223
  88. package/dist-esm/src/models/mappers.js.map +1 -0
  89. package/dist-esm/src/models/parameters.d.ts +21 -0
  90. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  91. package/{esm → dist-esm/src}/models/parameters.js +84 -46
  92. package/dist-esm/src/models/parameters.js.map +1 -0
  93. package/dist-esm/src/operations/accounts.d.ts +57 -0
  94. package/dist-esm/src/operations/accounts.d.ts.map +1 -0
  95. package/dist-esm/src/operations/accounts.js +185 -0
  96. package/dist-esm/src/operations/accounts.js.map +1 -0
  97. package/dist-esm/src/operations/extensions.d.ts +54 -0
  98. package/dist-esm/src/operations/extensions.d.ts.map +1 -0
  99. package/dist-esm/src/operations/extensions.js +190 -0
  100. package/dist-esm/src/operations/extensions.js.map +1 -0
  101. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  102. package/dist-esm/src/operations/index.d.ts.map +1 -0
  103. package/{esm → dist-esm/src}/operations/index.js +1 -2
  104. package/dist-esm/src/operations/index.js.map +1 -0
  105. package/dist-esm/src/operations/operations.d.ts +18 -0
  106. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  107. package/dist-esm/src/operations/operations.js +42 -0
  108. package/dist-esm/src/operations/operations.js.map +1 -0
  109. package/dist-esm/src/operations/projects.d.ts +77 -0
  110. package/dist-esm/src/operations/projects.d.ts.map +1 -0
  111. package/dist-esm/src/operations/projects.js +253 -0
  112. package/dist-esm/src/operations/projects.js.map +1 -0
  113. package/dist-esm/src/operationsInterfaces/accounts.d.ts +49 -0
  114. package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
  115. package/{src/models/operationsMappers.ts → dist-esm/src/operationsInterfaces/accounts.js} +2 -7
  116. package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
  117. package/dist-esm/src/operationsInterfaces/extensions.d.ts +46 -0
  118. package/dist-esm/src/operationsInterfaces/extensions.d.ts.map +1 -0
  119. package/{esm/models/operationsMappers.js → dist-esm/src/operationsInterfaces/extensions.js} +2 -2
  120. package/dist-esm/src/operationsInterfaces/extensions.js.map +1 -0
  121. package/dist-esm/src/operationsInterfaces/index.d.ts +5 -0
  122. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  123. package/dist-esm/src/operationsInterfaces/index.js +12 -0
  124. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  125. package/dist-esm/src/operationsInterfaces/operations.d.ts +10 -0
  126. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  127. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  128. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  129. package/dist-esm/src/operationsInterfaces/projects.d.ts +69 -0
  130. package/dist-esm/src/operationsInterfaces/projects.d.ts.map +1 -0
  131. package/dist-esm/src/operationsInterfaces/projects.js +9 -0
  132. package/dist-esm/src/operationsInterfaces/projects.js.map +1 -0
  133. package/dist-esm/src/visualStudioResourceProviderClient.d.ts +21 -0
  134. package/dist-esm/src/visualStudioResourceProviderClient.d.ts.map +1 -0
  135. package/dist-esm/src/visualStudioResourceProviderClient.js +54 -0
  136. package/dist-esm/src/visualStudioResourceProviderClient.js.map +1 -0
  137. package/dist-esm/test/sampleTest.d.ts +2 -0
  138. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  139. package/dist-esm/test/sampleTest.js +40 -0
  140. package/dist-esm/test/sampleTest.js.map +1 -0
  141. package/package.json +79 -33
  142. package/review/arm-visualstudio.api.md +314 -0
  143. package/rollup.config.js +181 -30
  144. package/src/{models/projectsMappers.ts → index.ts} +3 -10
  145. package/src/lroImpl.ts +34 -0
  146. package/src/models/index.ts +224 -547
  147. package/src/models/mappers.ts +172 -227
  148. package/src/models/parameters.ts +113 -47
  149. package/src/operations/accounts.ts +149 -286
  150. package/src/operations/extensions.ts +130 -231
  151. package/src/operations/index.ts +1 -2
  152. package/src/operations/operations.ts +26 -42
  153. package/src/operations/projects.ts +237 -278
  154. package/src/operationsInterfaces/accounts.ts +96 -0
  155. package/src/operationsInterfaces/extensions.ts +91 -0
  156. package/src/operationsInterfaces/index.ts +12 -0
  157. package/src/operationsInterfaces/operations.ts +21 -0
  158. package/src/operationsInterfaces/projects.ts +128 -0
  159. package/src/visualStudioResourceProviderClient.ts +76 -38
  160. package/tsconfig.json +5 -4
  161. package/types/arm-visualstudio.d.ts +493 -0
  162. package/types/tsdoc-metadata.json +11 -0
  163. package/dist/arm-visualstudio.js +0 -1546
  164. package/dist/arm-visualstudio.js.map +0 -1
  165. package/dist/arm-visualstudio.min.js +0 -1
  166. package/dist/arm-visualstudio.min.js.map +0 -1
  167. package/esm/models/accountsMappers.d.ts +0 -2
  168. package/esm/models/accountsMappers.d.ts.map +0 -1
  169. package/esm/models/accountsMappers.js +0 -9
  170. package/esm/models/accountsMappers.js.map +0 -1
  171. package/esm/models/extensionsMappers.d.ts +0 -2
  172. package/esm/models/extensionsMappers.d.ts.map +0 -1
  173. package/esm/models/extensionsMappers.js +0 -9
  174. package/esm/models/extensionsMappers.js.map +0 -1
  175. package/esm/models/index.d.ts +0 -579
  176. package/esm/models/index.d.ts.map +0 -1
  177. package/esm/models/index.js.map +0 -1
  178. package/esm/models/mappers.d.ts +0 -20
  179. package/esm/models/mappers.d.ts.map +0 -1
  180. package/esm/models/mappers.js.map +0 -1
  181. package/esm/models/operationsMappers.d.ts +0 -2
  182. package/esm/models/operationsMappers.d.ts.map +0 -1
  183. package/esm/models/operationsMappers.js.map +0 -1
  184. package/esm/models/parameters.d.ts +0 -14
  185. package/esm/models/parameters.d.ts.map +0 -1
  186. package/esm/models/parameters.js.map +0 -1
  187. package/esm/models/projectsMappers.d.ts +0 -2
  188. package/esm/models/projectsMappers.d.ts.map +0 -1
  189. package/esm/models/projectsMappers.js +0 -9
  190. package/esm/models/projectsMappers.js.map +0 -1
  191. package/esm/operations/accounts.d.ts +0 -147
  192. package/esm/operations/accounts.d.ts.map +0 -1
  193. package/esm/operations/accounts.js +0 -223
  194. package/esm/operations/accounts.js.map +0 -1
  195. package/esm/operations/extensions.d.ts +0 -141
  196. package/esm/operations/extensions.d.ts.map +0 -1
  197. package/esm/operations/extensions.js +0 -199
  198. package/esm/operations/extensions.js.map +0 -1
  199. package/esm/operations/index.d.ts.map +0 -1
  200. package/esm/operations/index.js.map +0 -1
  201. package/esm/operations/operations.d.ts +0 -29
  202. package/esm/operations/operations.d.ts.map +0 -1
  203. package/esm/operations/operations.js +0 -47
  204. package/esm/operations/operations.js.map +0 -1
  205. package/esm/operations/projects.d.ts +0 -165
  206. package/esm/operations/projects.d.ts.map +0 -1
  207. package/esm/operations/projects.js +0 -243
  208. package/esm/operations/projects.js.map +0 -1
  209. package/esm/visualStudioResourceProviderClient.d.ts +0 -27
  210. package/esm/visualStudioResourceProviderClient.d.ts.map +0 -1
  211. package/esm/visualStudioResourceProviderClient.js +0 -40
  212. package/esm/visualStudioResourceProviderClient.js.map +0 -1
  213. package/esm/visualStudioResourceProviderClientContext.d.ts +0 -22
  214. package/esm/visualStudioResourceProviderClientContext.d.ts.map +0 -1
  215. package/esm/visualStudioResourceProviderClientContext.js +0 -60
  216. package/esm/visualStudioResourceProviderClientContext.js.map +0 -1
  217. package/src/models/accountsMappers.ts +0 -22
  218. package/src/models/extensionsMappers.ts +0 -19
  219. package/src/visualStudioResourceProviderClientContext.ts +0 -67
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Release History
2
+
3
+ ## 4.0.0-beta.1 (2022-01-21)
4
+
5
+ The package of @azure/arm-visualstudio is using our next generation design principles since version 4.0.0-beta.1, which contains breaking changes.
6
+
7
+ To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
8
+
9
+ To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).
10
+
11
+ To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Microsoft
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Microsoft
3
+ Copyright (c) 2018 Microsoft
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,6 +1,15 @@
1
- ## Azure VisualStudioResourceProviderClient SDK for JavaScript
1
+ # Azure Visual Studio Resource Provider client library for JavaScript
2
2
 
3
- This package contains an isomorphic SDK (runs both in node.js and in browsers) for VisualStudioResourceProviderClient.
3
+ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Visual Studio Resource Provider client.
4
+
5
+ Use these APIs to manage Visual Studio Team Services resources through the Azure Resource Manager. All task operations conform to the HTTP/1.1 protocol specification and each operation returns an x-ms-request-id header that can be used to obtain information about the request. You must make sure that requests made to these resources are secure. For more information, see https://docs.microsoft.com/en-us/rest/api/index.
6
+
7
+ [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/visualstudio/arm-visualstudio) |
8
+ [Package (NPM)](https://www.npmjs.com/package/@azure/arm-visualstudio) |
9
+ [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-visualstudio?view=azure-node-preview) |
10
+ [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
11
+
12
+ ## Getting started
4
13
 
5
14
  ### Currently supported environments
6
15
 
@@ -9,98 +18,81 @@ This package contains an isomorphic SDK (runs both in node.js and in browsers) f
9
18
 
10
19
  ### Prerequisites
11
20
 
12
- You must have an [Azure subscription](https://azure.microsoft.com/free/).
21
+ - An [Azure subscription][azure_sub].
13
22
 
14
- ### How to install
23
+ ### Install the `@azure/arm-visualstudio` package
15
24
 
16
- To use this SDK in your project, you will need to install two packages.
17
- - `@azure/arm-visualstudio` that contains the client.
18
- - `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory.
25
+ Install the Azure Visual Studio Resource Provider client library for JavaScript with `npm`:
19
26
 
20
- Install both packages using the below command:
21
27
  ```bash
22
- npm install --save @azure/arm-visualstudio @azure/identity
28
+ npm install @azure/arm-visualstudio
23
29
  ```
24
- > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
25
- If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
26
30
 
27
- ### How to use
31
+ ### Create and authenticate a `VisualStudioResourceProviderClient`
32
+
33
+ To create a client object to access the Azure Visual Studio Resource Provider API, you will need the `endpoint` of your Azure Visual Studio Resource Provider resource and a `credential`. The Azure Visual Studio Resource Provider client can use Azure Active Directory credentials to authenticate.
34
+ You can find the endpoint for your Azure Visual Studio Resource Provider resource in the [Azure Portal][azure_portal].
28
35
 
29
- - If you are writing a client side browser application,
30
- - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions.
31
- - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below.
32
- - If you are writing a server side application,
33
- - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples)
34
- - Complete the set up steps required by the credential if any.
35
- - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below.
36
+ 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/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
36
37
 
37
- In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
38
- Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
39
- #### nodejs - Authentication, client creation, and list operations as an example written in JavaScript.
38
+ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
39
+
40
+ ```bash
41
+ npm install @azure/identity
42
+ ```
40
43
 
41
- ##### Sample code
44
+ You will also need to **register a new AAD application and grant access to Azure Visual Studio Resource Provider** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
45
+ 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`.
46
+
47
+ 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).
42
48
 
43
49
  ```javascript
44
- const { DefaultAzureCredential } = require("@azure/identity");
45
50
  const { VisualStudioResourceProviderClient } = require("@azure/arm-visualstudio");
46
- const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
47
-
48
- // Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples
49
- // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
50
- const creds = new DefaultAzureCredential();
51
- const client = new VisualStudioResourceProviderClient(creds, subscriptionId);
52
- client.operations.list().then((result) => {
53
- console.log("The result is:");
54
- console.log(result);
55
- }).catch((err) => {
56
- console.log("An error occurred:");
57
- console.error(err);
58
- });
51
+ const { DefaultAzureCredential } = require("@azure/identity");
52
+ const subscriptionId = "00000000-0000-0000-0000-000000000000";
53
+ const client = new VisualStudioResourceProviderClient(new DefaultAzureCredential(), subscriptionId);
59
54
  ```
60
55
 
61
- #### browser - Authentication, client creation, and list operations as an example written in JavaScript.
62
-
63
- In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
64
- - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser.
65
- - Note down the client Id from the previous step and use it in the browser sample below.
66
-
67
- ##### Sample code
68
-
69
- - index.html
70
-
71
- ```html
72
- <!DOCTYPE html>
73
- <html lang="en">
74
- <head>
75
- <title>@azure/arm-visualstudio sample</title>
76
- <script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
77
- <script src="node_modules/@azure/identity/dist/index.js"></script>
78
- <script src="node_modules/@azure/arm-visualstudio/dist/arm-visualstudio.js"></script>
79
- <script type="text/javascript">
80
- const subscriptionId = "<Subscription_Id>";
81
- // Create credentials using the `@azure/identity` package.
82
- // Please note that you can also use credentials from the `@azure/ms-rest-browserauth` package instead.
83
- const credential = new InteractiveBrowserCredential(
84
- {
85
- clientId: "<client id for your Azure AD app>",
86
- tenant: "<optional tenant for your organization>"
87
- });
88
- const client = new Azure.ArmVisualstudio.VisualStudioResourceProviderClient(creds, subscriptionId);
89
- client.operations.list().then((result) => {
90
- console.log("The result is:");
91
- console.log(result);
92
- }).catch((err) => {
93
- console.log("An error occurred:");
94
- console.error(err);
95
- });
96
- </script>
97
- </head>
98
- <body></body>
99
- </html>
56
+
57
+ ### JavaScript Bundle
58
+ 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).
59
+
60
+ ## Key concepts
61
+
62
+ ### VisualStudioResourceProviderClient
63
+
64
+ `VisualStudioResourceProviderClient` is the primary interface for developers using the Azure Visual Studio Resource Provider client library. Explore the methods on this client object to understand the different features of the Azure Visual Studio Resource Provider service that you can access.
65
+
66
+ ## Troubleshooting
67
+
68
+ ### Logging
69
+
70
+ 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`:
71
+
72
+ ```javascript
73
+ const { setLogLevel } = require("@azure/logger");
74
+ setLogLevel("info");
100
75
  ```
101
76
 
77
+ 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/main/sdk/core/logger).
78
+
79
+ ## Next steps
80
+
81
+ 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.
82
+
83
+ ## Contributing
84
+
85
+ If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
86
+
102
87
  ## Related projects
103
88
 
104
- - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
89
+ - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
90
+
91
+ ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fvisualstudio%2Farm-visualstudio%2FREADME.png)
105
92
 
106
- ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/visualstudio/arm-visualstudio/README.png)
93
+ [azure_cli]: https://docs.microsoft.com/cli/azure
94
+ [azure_sub]: https://azure.microsoft.com/free/
95
+ [azure_sub]: https://azure.microsoft.com/free/
96
+ [azure_portal]: https://portal.azure.com
97
+ [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
98
+ [defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential