Node.JS Service for Microsoft Fabric supporting infrastructure as code
npm install fabias
Node.JS Module for providing Infrastructure as Code to Microsoft Fabric
Table of Contents
- About Fabias
- Built With
- Getting Started
- Implement the Service
- Authenticate the Service
- Elements
- Workspace
- Collections
- GIT
- setConnection
- status
- update
- Versioning
This node.js module hosts several SPN based API calls useful for controling the Microsoft Fabric Service
* ![NodeJS][NodeJS]
* ![Microsoft-Azure][Microsoft-Azure]
* ![GitHub-Actions][GitHub-Actions]
Utilization of this module is as simple as downloading from NPM
``console`
npm install Fabias `$3
js
const FabricIASService = require('Fabias');
// @param {string} options.tenant - Azure tenant ID.
// @param {string} options.client - Client application ID.
// @param {string} options.secret - Client secret.
const service = new FabricIASService({tenant: tenant_id, client: client_id, secret: client_secret});
`$3
Once the service has been instantiated, you need only call the authorization method of the embedded SPN based OAUTH.
`js`
await service.OAuth.authorization();
js
const myWorkspace = service.Workspace('db341d98-315d-46cc-9f47-eb68d53256cc')//in all subsequant calls you can reuse service.workspace(GUID) or myWorkspace
`
If this workspace has already been referenced within your code it will return the existing item from the collection, otherwise it instantiates a Workspace object$3
Each Workspace object contains a git object or interacting with the workspace's code versioning, and an Environment collection$3
#### setConnection
Implemented to assign an already existing Fabric Managed Connection for Github/AZ Devops and assign to the workspace
`js
await myWorkspace.git.setConnection('62529ee1-9821-4345-94be-ef31e0088253');
// alternatively use await service.Workspace(WORKSPACE GUID).setConnection(CONNECTION GUID)
`
#### status
Implemented to obtain the state of GIT in the workspace and determine if changes are pending. This is required before running an update in order to extract the commit head. This is captured in the background.
`js
const status = await myWorkspace.git.status();
`
#### update
Implemented to request and update from git using the head obtained from the status call. This call returns an operation object which can subsequantly be used to Poll the status until the longrunning job completes.
`js
const operation = await myWorkspace.git.update();
if(operation){
await operation.pollStatus(function(status, progress){
//Will request an update on the operation in 20 second intervals
//Only performs up to 90 requests (30 minutes)
//Fires this callback with the status and progress percent
//Exits once Status is successful or failed
});
}
`
Versioning
The
master branch will always contain the latest, validated releases. Please use master` as the version from this repository, except for testing purposes.For a complete list of changes, review the Change Log
[Microsoft-Azure]: https://custom-icon-badges.demolab.com/badge/Microsoft%20Azure-0089D6?logo=msazure&logoColor=white
[GitHub-Actions]: https://img.shields.io/badge/GitHub_Actions-2088FF?logo=github-actions&logoColor=white
[NodeJS]: https://img.shields.io/badge/Node.js-6DA55F?logo=node.js&logoColor=white