Microsoft Azure SDK for Node.js - Power BI Embedded
This project provides a Node.js package for managing Azure Power BI Embedded.
Features
- Manage Power BI Embedded:
- Create new Workspace Collection
- Get workspace collections by subscription
- Get workspace collections by resource group
- Get workspace collection by resource group & name
- Get access keys for workspace collection
- Regenerate access key for workspace collection
- Get workspaces within workspace collection
How to Install
npm install azure-arm-powerbiembedded
How to Use
Authentication, client creation and listing workspaces within a workspace collection in a resource group as an example
var msRestAzure = require('ms-rest-azure');
var PowerBIEmbeddedManagementClient = require('azure-arm-powerbiembedded');
msRestAzure.interactiveLogin(function(err, credentials) {
var client = new PowerBIEmbeddedManagementClient(credentials, subscriptionId);
client.workspaces.list(resourceGroupName, workspaceCollectionName, function(err, result, request, response) {
if (err) console.log(err);
console.log(result);
});
});
Create new Workspace Collection
const creationOptions = {
location: "southcentral",
tags: {
key1: 'value1',
key2: 'value2'
},
sku: {
name: "S1",
teir: "Standard"
}
};
client.workspaceCollections.create(resourceGroupName, workspaceCollectionName, creationOptions, (error, result, request, response) => {
...
});
workspaceCollection
:
{
id: "...",
name: "...",
type: "...",
location: "...",
tags: { ... },
sku: {
name: "S1",
teir: "Standard"
},
properties: {
...
}
}
Update Workspace Collection
const updateBody = {
tags: {
newTag: 'newValue',
removeTag: ''
}
};
client.workspaceCollections.update(resourceGroupName, workspaceCollectionName, updateBody, (error, result, request, response) => {
...
});
Delete Workspace Collection
client.workspaceCollections.deleteMethod(resourceGroupName, workspaceCollectionName, (error, result, request, response) => {
...
});
Get workspace collections by subscription
client.workspaceCollections.listBySubscription((error, result, request, response) => {
...
});
Get workspace collections by resource group
client.workspaceCollections.listByResourceGroup(resourceGroupName, (error, result, request, response) => {
...
});
Get workspace collection by resource group & workspace collection name
client.workspaceCollections.getByName(resourceGroupName, workspaceCollectionName, (error, result, request, response) => {
...
});
Get access keys for workspace collection
client.workspaceCollections.getAccessKeys(resourceGroupName, workspaceCollectionName, (error, result, request, response) => {
...
});
accessKeys
:
{
key1: "...",
key2: "..."
}
Regenerate access key for workspace collection
const body = {
keyName: "key1"
};
client.workspaceCollections.regenerateKey(resourceGroupName, workspaceCollectionName, body, (error, result, request, response) => {
...
});
accessKeys
:
{
key1: "...",
key2: "..."
}
Get workspaces within workspace collection
client.workspaces.list(resourceGroupName, workspaceCollectionName, (error, result, request, response) => {
...
});
workspaces
:
[
{
id: "...",
name: "...",
type: "...",
properties: { ... }
},
{
id: "...",
name: "...",
type: "...",
properties: { ... }
},
...
]
Related projects