Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR @azure/arm-signalr] Revert "signalr only track2" #4469

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 15 additions & 24 deletions sdk/signalr/arm-signalr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,27 @@ npm install @azure/arm-signalr
##### Install @azure/ms-rest-nodeauth

- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.

```bash
npm install @azure/ms-rest-nodeauth@"^3.0.0"
```

##### Sample code

While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package

```typescript
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
const { SignalRManagementClient } = require("@azure/arm-signalr");
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth
.interactiveLogin()
.then((creds) => {
const client = new SignalRManagementClient(creds, subscriptionId);
client.operations.list().then((result) => {
console.log("The result is:");
console.log(result);
});
})
.catch((err) => {
console.error(err);
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new SignalRManagementClient(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.
Expand All @@ -61,7 +56,6 @@ npm install @azure/ms-rest-browserauth
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

- index.html

```html
<!DOCTYPE html>
<html lang="en">
Expand All @@ -83,16 +77,13 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
authManager.login();
}
const client = new Azure.ArmSignalr.SignalRManagementClient(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);
});
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>
Expand Down
10 changes: 8 additions & 2 deletions sdk/signalr/arm-signalr/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import sourcemaps from "rollup-plugin-sourcemaps";
*/
const config = {
input: "./esm/signalRManagementClient.js",
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
external: [
"@azure/ms-rest-js",
"@azure/ms-rest-azure-js"
],
output: {
file: "./dist/arm-signalr.js",
format: "umd",
Expand All @@ -25,7 +28,10 @@ const config = {
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/`
},
plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()]
plugins: [
nodeResolve({ mainFields: ['module', 'main'] }),
sourcemaps()
]
};

export default config;
Loading