@azure/arm-subscriptions 3.1.2 → 5.0.0

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 (199) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +69 -79
  4. package/dist/index.js +2330 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/index.d.ts +5 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +12 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/lroImpl.d.ts +16 -0
  13. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  14. package/dist-esm/src/lroImpl.js +29 -0
  15. package/dist-esm/src/lroImpl.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +658 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +36 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +36 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/dist-esm/src/models/mappers.js +1057 -0
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +15 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +121 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/alias.d.ts +53 -0
  29. package/dist-esm/src/operations/alias.d.ts.map +1 -0
  30. package/dist-esm/src/operations/alias.js +180 -0
  31. package/dist-esm/src/operations/alias.js.map +1 -0
  32. package/dist-esm/src/operations/billingAccount.d.ts +19 -0
  33. package/dist-esm/src/operations/billingAccount.d.ts.map +1 -0
  34. package/dist-esm/src/operations/billingAccount.js +47 -0
  35. package/dist-esm/src/operations/billingAccount.js.map +1 -0
  36. package/{esm → dist-esm/src}/operations/index.d.ts +2 -0
  37. package/dist-esm/src/operations/index.d.ts.map +1 -0
  38. package/{esm → dist-esm/src}/operations/index.js +5 -5
  39. package/dist-esm/src/operations/index.js.map +1 -0
  40. package/dist-esm/src/operations/operations.d.ts +32 -0
  41. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  42. package/dist-esm/src/operations/operations.js +120 -0
  43. package/dist-esm/src/operations/operations.js.map +1 -0
  44. package/dist-esm/src/operations/subscriptionOperations.d.ts +53 -0
  45. package/dist-esm/src/operations/subscriptionOperations.d.ts.map +1 -0
  46. package/dist-esm/src/operations/subscriptionOperations.js +201 -0
  47. package/dist-esm/src/operations/subscriptionOperations.js.map +1 -0
  48. package/dist-esm/src/operations/subscriptionPolicy.d.ts +43 -0
  49. package/dist-esm/src/operations/subscriptionPolicy.d.ts.map +1 -0
  50. package/dist-esm/src/operations/subscriptionPolicy.js +169 -0
  51. package/dist-esm/src/operations/subscriptionPolicy.js.map +1 -0
  52. package/dist-esm/src/operations/subscriptions.d.ts +54 -0
  53. package/dist-esm/src/operations/subscriptions.d.ts.map +1 -0
  54. package/dist-esm/src/operations/subscriptions.js +201 -0
  55. package/dist-esm/src/operations/subscriptions.js.map +1 -0
  56. package/dist-esm/src/operations/tenants.d.ts +32 -0
  57. package/dist-esm/src/operations/tenants.d.ts.map +1 -0
  58. package/dist-esm/src/operations/tenants.js +114 -0
  59. package/dist-esm/src/operations/tenants.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/alias.d.ts +45 -0
  61. package/dist-esm/src/operationsInterfaces/alias.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/alias.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/alias.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/billingAccount.d.ts +11 -0
  65. package/dist-esm/src/operationsInterfaces/billingAccount.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/billingAccount.js +9 -0
  67. package/dist-esm/src/operationsInterfaces/billingAccount.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/index.d.ts +8 -0
  69. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/index.js +15 -0
  71. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  73. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/subscriptionOperations.d.ts +45 -0
  77. package/dist-esm/src/operationsInterfaces/subscriptionOperations.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/subscriptionOperations.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/subscriptionOperations.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.d.ts +22 -0
  81. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/subscriptionPolicy.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts +24 -0
  85. package/dist-esm/src/operationsInterfaces/subscriptions.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/subscriptions.js +9 -0
  87. package/dist-esm/src/operationsInterfaces/subscriptions.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/tenants.d.ts +11 -0
  89. package/dist-esm/src/operationsInterfaces/tenants.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/tenants.js +9 -0
  91. package/dist-esm/src/operationsInterfaces/tenants.js.map +1 -0
  92. package/dist-esm/src/subscriptionClient.d.ts +21 -0
  93. package/dist-esm/src/subscriptionClient.d.ts.map +1 -0
  94. package/dist-esm/src/subscriptionClient.js +50 -0
  95. package/dist-esm/src/subscriptionClient.js.map +1 -0
  96. package/dist-esm/test/sampleTest.d.ts +2 -0
  97. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  98. package/dist-esm/test/sampleTest.js +40 -0
  99. package/dist-esm/test/sampleTest.js.map +1 -0
  100. package/package.json +65 -32
  101. package/review/arm-subscriptions.api.md +559 -0
  102. package/rollup.config.js +181 -30
  103. package/src/index.ts +12 -0
  104. package/src/lroImpl.ts +34 -0
  105. package/src/models/index.ts +551 -489
  106. package/src/models/mappers.ts +685 -190
  107. package/src/models/parameters.ts +94 -27
  108. package/src/operations/alias.ts +170 -170
  109. package/src/operations/billingAccount.ts +65 -0
  110. package/src/operations/index.ts +5 -5
  111. package/src/operations/operations.ts +103 -40
  112. package/src/operations/subscriptionOperations.ts +216 -120
  113. package/src/operations/subscriptionPolicy.ts +207 -0
  114. package/src/operations/subscriptions.ts +163 -153
  115. package/src/operations/tenants.ts +87 -79
  116. package/src/operationsInterfaces/alias.ts +75 -0
  117. package/src/operationsInterfaces/billingAccount.ts +25 -0
  118. package/src/operationsInterfaces/index.ts +15 -0
  119. package/src/operationsInterfaces/operations.ts +22 -0
  120. package/src/operationsInterfaces/subscriptionOperations.ts +92 -0
  121. package/src/operationsInterfaces/subscriptionPolicy.ts +46 -0
  122. package/src/operationsInterfaces/subscriptions.ts +48 -0
  123. package/src/operationsInterfaces/tenants.ts +22 -0
  124. package/src/subscriptionClient.ts +81 -43
  125. package/tsconfig.json +3 -3
  126. package/types/arm-subscriptions.d.ts +925 -0
  127. package/types/tsdoc-metadata.json +11 -0
  128. package/dist/arm-subscriptions.js +0 -1442
  129. package/dist/arm-subscriptions.js.map +0 -1
  130. package/dist/arm-subscriptions.min.js +0 -1
  131. package/dist/arm-subscriptions.min.js.map +0 -1
  132. package/esm/models/aliasMappers.d.ts +0 -2
  133. package/esm/models/aliasMappers.d.ts.map +0 -1
  134. package/esm/models/aliasMappers.js +0 -9
  135. package/esm/models/aliasMappers.js.map +0 -1
  136. package/esm/models/index.d.ts +0 -624
  137. package/esm/models/index.d.ts.map +0 -1
  138. package/esm/models/index.js +0 -8
  139. package/esm/models/index.js.map +0 -1
  140. package/esm/models/mappers.d.ts +0 -25
  141. package/esm/models/mappers.d.ts.map +0 -1
  142. package/esm/models/mappers.js +0 -574
  143. package/esm/models/mappers.js.map +0 -1
  144. package/esm/models/operationsMappers.d.ts +0 -2
  145. package/esm/models/operationsMappers.d.ts.map +0 -1
  146. package/esm/models/operationsMappers.js +0 -9
  147. package/esm/models/operationsMappers.js.map +0 -1
  148. package/esm/models/parameters.d.ts +0 -8
  149. package/esm/models/parameters.d.ts.map +0 -1
  150. package/esm/models/parameters.js +0 -75
  151. package/esm/models/parameters.js.map +0 -1
  152. package/esm/models/subscriptionOperationsMappers.d.ts +0 -2
  153. package/esm/models/subscriptionOperationsMappers.d.ts.map +0 -1
  154. package/esm/models/subscriptionOperationsMappers.js +0 -9
  155. package/esm/models/subscriptionOperationsMappers.js.map +0 -1
  156. package/esm/models/subscriptionsMappers.d.ts +0 -2
  157. package/esm/models/subscriptionsMappers.d.ts.map +0 -1
  158. package/esm/models/subscriptionsMappers.js +0 -9
  159. package/esm/models/subscriptionsMappers.js.map +0 -1
  160. package/esm/models/tenantsMappers.d.ts +0 -2
  161. package/esm/models/tenantsMappers.d.ts.map +0 -1
  162. package/esm/models/tenantsMappers.js +0 -9
  163. package/esm/models/tenantsMappers.js.map +0 -1
  164. package/esm/operations/alias.d.ts +0 -81
  165. package/esm/operations/alias.d.ts.map +0 -1
  166. package/esm/operations/alias.js +0 -161
  167. package/esm/operations/alias.js.map +0 -1
  168. package/esm/operations/index.d.ts.map +0 -1
  169. package/esm/operations/index.js.map +0 -1
  170. package/esm/operations/operations.d.ts +0 -28
  171. package/esm/operations/operations.d.ts.map +0 -1
  172. package/esm/operations/operations.js +0 -51
  173. package/esm/operations/operations.js.map +0 -1
  174. package/esm/operations/subscriptionOperations.d.ts +0 -70
  175. package/esm/operations/subscriptionOperations.d.ts.map +0 -1
  176. package/esm/operations/subscriptionOperations.js +0 -117
  177. package/esm/operations/subscriptionOperations.js.map +0 -1
  178. package/esm/operations/subscriptions.d.ts +0 -84
  179. package/esm/operations/subscriptions.d.ts.map +0 -1
  180. package/esm/operations/subscriptions.js +0 -133
  181. package/esm/operations/subscriptions.js.map +0 -1
  182. package/esm/operations/tenants.d.ts +0 -46
  183. package/esm/operations/tenants.d.ts.map +0 -1
  184. package/esm/operations/tenants.js +0 -77
  185. package/esm/operations/tenants.js.map +0 -1
  186. package/esm/subscriptionClient.d.ts +0 -27
  187. package/esm/subscriptionClient.d.ts.map +0 -1
  188. package/esm/subscriptionClient.js +0 -41
  189. package/esm/subscriptionClient.js.map +0 -1
  190. package/esm/subscriptionClientContext.d.ts +0 -19
  191. package/esm/subscriptionClientContext.d.ts.map +0 -1
  192. package/esm/subscriptionClientContext.js +0 -55
  193. package/esm/subscriptionClientContext.js.map +0 -1
  194. package/src/models/aliasMappers.ts +0 -18
  195. package/src/models/operationsMappers.ts +0 -14
  196. package/src/models/subscriptionOperationsMappers.ts +0 -15
  197. package/src/models/subscriptionsMappers.ts +0 -16
  198. package/src/models/tenantsMappers.ts +0 -13
  199. package/src/subscriptionClientContext.ts +0 -60
package/CHANGELOG.md ADDED
@@ -0,0 +1,58 @@
1
+ # Release History
2
+
3
+ ## 5.0.0 (2022-01-17)
4
+
5
+ **Features**
6
+
7
+ - Added operation group SubscriptionOperations
8
+ - Added operation group Subscriptions
9
+ - Added operation group Tenants
10
+ - Added Interface Location_2
11
+ - Added Interface LocationListResult
12
+ - Added Interface Subscription
13
+ - Added Interface SubscriptionListResult
14
+ - Added Interface SubscriptionPolicies
15
+ - Added Interface SubscriptionsGetOptionalParams
16
+ - Added Interface SubscriptionsListLocationsOptionalParams
17
+ - Added Interface SubscriptionsListNextOptionalParams
18
+ - Added Interface SubscriptionsListOptionalParams
19
+ - Added Interface TenantIdDescription
20
+ - Added Interface TenantListResult
21
+ - Added Interface TenantsListNextOptionalParams
22
+ - Added Interface TenantsListOptionalParams
23
+ - Added Type Alias SpendingLimit
24
+ - Added Type Alias SubscriptionsGetResponse
25
+ - Added Type Alias SubscriptionsListLocationsResponse
26
+ - Added Type Alias SubscriptionsListNextResponse
27
+ - Added Type Alias SubscriptionsListResponse
28
+ - Added Type Alias SubscriptionState
29
+ - Added Type Alias TenantsListNextResponse
30
+ - Added Type Alias TenantsListResponse
31
+ - Interface CanceledSubscriptionId has a new optional parameter subscriptionId
32
+ - Interface EnabledSubscriptionId has a new optional parameter subscriptionId
33
+ - Interface RenamedSubscriptionId has a new optional parameter subscriptionId
34
+ - Interface SubscriptionAliasResponseProperties has a new optional parameter createdTime
35
+ - Class SubscriptionClient has a new parameter subscriptionOperations
36
+ - Class SubscriptionClient has a new parameter subscriptions
37
+ - Class SubscriptionClient has a new parameter tenants
38
+
39
+ **Breaking Changes**
40
+
41
+ - Removed operation group Subscription
42
+ - Interface CanceledSubscriptionId no longer has parameter value
43
+ - Interface EnabledSubscriptionId no longer has parameter value
44
+ - Interface RenamedSubscriptionId no longer has parameter value
45
+ - Interface SubscriptionClientOptionalParams no longer has parameter apiVersion
46
+ - Class SubscriptionClient no longer has parameter apiVersion
47
+ - Class SubscriptionClient no longer has parameter subscription
48
+
49
+
50
+ ## 4.0.0 (2021-12-22)
51
+
52
+ The package of @azure/arm-subscriptions is using our next generation design principles since version 4.0.0, which contains breaking changes.
53
+
54
+ To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
55
+
56
+ To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).
57
+
58
+ To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Microsoft
3
+ Copyright (c) 2022 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
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,108 +1,98 @@
1
- ## Azure SubscriptionClient SDK for JavaScript
1
+ # Azure Subscription client library for JavaScript
2
2
 
3
- This package contains an isomorphic SDK (runs both in Node.js and in browsers) for SubscriptionClient.
3
+ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Subscription client.
4
+
5
+ The subscription client
6
+
7
+ [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/subscription/arm-subscriptions) |
8
+ [Package (NPM)](https://www.npmjs.com/package/@azure/arm-subscriptions) |
9
+ [API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-subscriptions) |
10
+ [Samples](https://github.com/Azure-Samples/azure-samples-js-management)
11
+
12
+ ## Getting started
4
13
 
5
14
  ### Currently supported environments
6
15
 
7
16
  - [LTS versions of Node.js](https://nodejs.org/about/releases/)
8
- - Latest versions of Safari, Chrome, Edge, and Firefox.
17
+ - Latest versions of Safari, Chrome, Edge and Firefox.
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-subscriptions` package
15
24
 
16
- To use this SDK in your project, you will need to install two packages.
17
- - `@azure/arm-subscriptions` 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 Subscription 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-subscriptions @azure/identity
28
+ npm install @azure/arm-subscriptions
23
29
  ```
24
30
 
25
- > **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.
26
- 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.
31
+ ### Create and authenticate a `SubscriptionClient`
27
32
 
28
- ### How to use
33
+ 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.
34
+ You can find the endpoint for your Azure Subscription resource in the [Azure Portal][azure_portal].
29
35
 
30
- - If you are writing a client side browser application,
31
- - 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.
32
- - 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.
33
- - If you are writing a server side application,
34
- - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples)
35
- - Complete the set up steps required by the credential if any.
36
- - 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).
37
37
 
38
- In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
39
- 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.
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
- #### nodejs - Authentication, client creation, and listLocations subscriptions as an example written in JavaScript.
44
+ 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).
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`.
42
46
 
43
- ##### Sample code
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).
44
48
 
45
49
  ```javascript
46
- const { DefaultAzureCredential } = require("@azure/identity");
47
50
  const { SubscriptionClient } = require("@azure/arm-subscriptions");
48
- const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
49
-
50
- // Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples
51
- // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
52
- const creds = new DefaultAzureCredential();
53
- const client = new SubscriptionClient(creds);
54
- client.subscriptions.listLocations(subscriptionId).then((result) => {
55
- console.log("The result is:");
56
- console.log(result);
57
- }).catch((err) => {
58
- console.log("An error occurred:");
59
- console.error(err);
60
- });
51
+ const { DefaultAzureCredential } = require("@azure/identity");
52
+ const subscriptionId = "00000000-0000-0000-0000-000000000000";
53
+ const client = new SubscriptionClient(new DefaultAzureCredential(), subscriptionId);
61
54
  ```
62
55
 
63
- #### browser - Authentication, client creation, and listLocations subscriptions as an example written in JavaScript.
64
-
65
- In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
66
- - 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.
67
- - Note down the client Id from the previous step and use it in the browser sample below.
68
-
69
- ##### Sample code
70
-
71
- - index.html
72
-
73
- ```html
74
- <!DOCTYPE html>
75
- <html lang="en">
76
- <head>
77
- <title>@azure/arm-subscriptions sample</title>
78
- <script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
79
- <script src="node_modules/@azure/identity/dist/index.js"></script>
80
- <script src="node_modules/@azure/arm-subscriptions/dist/arm-subscriptions.js"></script>
81
- <script type="text/javascript">
82
- const subscriptionId = "<Subscription_Id>";
83
- // Create credentials using the `@azure/identity` package.
84
- // Please note that you can also use credentials from the `@azure/ms-rest-browserauth` package instead.
85
- const credential = new InteractiveBrowserCredential(
86
- {
87
- clientId: "<client id for your Azure AD app>",
88
- tenantId: "<optional tenant for your organization>"
89
- });
90
- const client = new Azure.ArmSubscriptions.SubscriptionClient(creds);
91
- client.subscriptions.listLocations(subscriptionId).then((result) => {
92
- console.log("The result is:");
93
- console.log(result);
94
- }).catch((err) => {
95
- console.log("An error occurred:");
96
- console.error(err);
97
- });
98
- </script>
99
- </head>
100
- <body></body>
101
- </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
+ ### SubscriptionClient
63
+
64
+ `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.
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");
102
75
  ```
103
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
+
104
87
  ## Related projects
105
88
 
106
- - [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%2Fsubscription%2Farm-subscriptions%2FREADME.png)
107
92
 
108
- ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/subscription/arm-subscriptions/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