Skip to content

Commit fe306bc

Browse files
authored
[mgmt] migrate mgmt package to esm 25 (#33081)
#32184 @azure/arm-security @azure/arm-search @azure/arm-scvmm @azure/arm-resourcesdeploymentstacks @azure/arm-arm-resources-subscriptions
1 parent 5e2a290 commit fe306bc

File tree

969 files changed

+4462
-5235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

969 files changed

+4462
-5235
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 140 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/resources-subscriptions/arm-resources-subscriptions/README.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,28 @@ Set the values of the client ID, tenant ID, and client secret of the AAD applica
4848

4949
For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
5050

51-
```javascript
52-
const { SubscriptionClient } = require("@azure/arm-resources-subscriptions");
53-
const { DefaultAzureCredential } = require("@azure/identity");
54-
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
51+
Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client.
52+
53+
```ts snippet:ReadmeSampleCreateClient_Node
54+
import { SubscriptionClient } from "@azure/arm-resources-subscriptions";
55+
import { DefaultAzureCredential } from "@azure/identity";
5556

5657
const subscriptionId = "00000000-0000-0000-0000-000000000000";
5758
const client = new SubscriptionClient(new DefaultAzureCredential(), subscriptionId);
59+
```
60+
61+
For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate.
5862

59-
// For client-side applications running in the browser, use this code instead:
60-
// const credential = new InteractiveBrowserCredential({
61-
// tenantId: "<YOUR_TENANT_ID>",
62-
// clientId: "<YOUR_CLIENT_ID>"
63-
// });
64-
// const client = new SubscriptionClient(credential, subscriptionId);
63+
```ts snippet:ReadmeSampleCreateClient_Browser
64+
import { InteractiveBrowserCredential } from "@azure/identity";
65+
import { SubscriptionClient } from "@azure/arm-resources-subscriptions";
66+
67+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
68+
const credential = new InteractiveBrowserCredential({
69+
tenantId: "<YOUR_TENANT_ID>",
70+
clientId: "<YOUR_CLIENT_ID>",
71+
});
72+
const client = new SubscriptionClient(credential, subscriptionId);
6573
```
6674

6775
### JavaScript Bundle
@@ -80,8 +88,9 @@ To use this client library in the browser, first you need to use a bundler. For
8088

8189
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`:
8290

83-
```javascript
84-
const { setLogLevel } = require("@azure/logger");
91+
```ts snippet:SetLogLevel
92+
import { setLogLevel } from "@azure/logger";
93+
8594
setLogLevel("info");
8695
```
8796

sdk/resources-subscriptions/arm-resources-subscriptions/api-extractor.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3-
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
3+
"mainEntryPointFilePath": "dist/esm/index.d.ts",
44
"docModel": {
55
"enabled": true
66
},
@@ -11,7 +11,7 @@
1111
"dtsRollup": {
1212
"enabled": true,
1313
"untrimmedFilePath": "",
14-
"publicTrimmedFilePath": "./types/arm-resources-subscriptions.d.ts"
14+
"publicTrimmedFilePath": "dist/arm-resources-subscriptions.d.ts"
1515
},
1616
"messages": {
1717
"tsdocMessageReporting": {
@@ -28,4 +28,4 @@
2828
}
2929
}
3030
}
31-
}
31+
}

0 commit comments

Comments
 (0)