Skip to content

Commit 5e2a290

Browse files
authored
[mgmt] migrate mgmt package to esm 24 (#33078)
#32184 @azure/arm-servicefabric @azure/arm-servicebus @azure/arm-serialconsole @azure/arm-selfhelp @azure/arm-securityinsight
1 parent a4109b7 commit 5e2a290

File tree

683 files changed

+3498
-3732
lines changed

Some content is hidden

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

683 files changed

+3498
-3732
lines changed

Diff for: common/config/rush/pnpm-lock.yaml

+140-65
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: sdk/securityinsight/arm-securityinsight/README.md

+19-12
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,26 @@ 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 { SecurityInsights } = require("@azure/arm-securityinsight");
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+
```ts snippet:ReadmeSampleCreateClient_Node
52+
import { SecurityInsights } from "@azure/arm-securityinsight";
53+
import { DefaultAzureCredential } from "@azure/identity";
5554

5655
const subscriptionId = "00000000-0000-0000-0000-000000000000";
5756
const client = new SecurityInsights(new DefaultAzureCredential(), subscriptionId);
57+
```
58+
59+
For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate.
60+
61+
```ts snippet:ReadmeSampleCreateClient_Browser
62+
import { InteractiveBrowserCredential } from "@azure/identity";
63+
import { SecurityInsights } from "@azure/arm-securityinsight";
5864

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 SecurityInsights(credential, subscriptionId);
65+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
66+
const credential = new InteractiveBrowserCredential({
67+
tenantId: "<YOUR_TENANT_ID>",
68+
clientId: "<YOUR_CLIENT_ID>",
69+
});
70+
const client = new SecurityInsights(credential, subscriptionId);
6571
```
6672

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

8187
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`:
8288

83-
```javascript
84-
const { setLogLevel } = require("@azure/logger");
89+
```ts snippet:SetLogLevel
90+
import { setLogLevel } from "@azure/logger";
91+
8592
setLogLevel("info");
8693
```
8794

Diff for: sdk/securityinsight/arm-securityinsight/api-extractor.json

+3-3
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-securityinsight.d.ts"
14+
"publicTrimmedFilePath": "dist/arm-securityinsight.d.ts"
1515
},
1616
"messages": {
1717
"tsdocMessageReporting": {
@@ -28,4 +28,4 @@
2828
}
2929
}
3030
}
31-
}
31+
}

0 commit comments

Comments
 (0)