fabias
v1.0.10
Published
Node.JS Service for Microsoft Fabric supporting infrastructure as code
Maintainers
Readme
About Fabias
This node.js module hosts several SPN based API calls useful for controling the Microsoft Fabric Service
Built With
Getting Started
Utilization of this module is as simple as downloading from NPM
npm install Fabias Implement the Service
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});Authenticate the Service
Once the service has been instantiated, you need only call the authorization method of the embedded SPN based OAUTH.
await service.OAuth.authorization();Elements
Fabias takes a true OOP approach to the Microsoft Fabric Service. Once the service is established, referencing the various components of Fabric are just properties, collections, and methods.
Workspace
Workspace is the entrypoint for accessing workspaces from the service
const myWorkspace = service.Workspace('db341d98-315d-46cc-9f47-eb68d53256cc')
//in all subsequant calls you can reuse service.workspace(GUID) or myWorkspaceIf this workspace has already been referenced within your code it will return the existing item from the collection, otherwise it instantiates a Workspace object
Collections
Each Workspace object contains a git object or interacting with the workspace's code versioning, and an Environment collection
GIT
setConnection
Implemented to assign an already existing Fabric Managed Connection for Github/AZ Devops and assign to the workspace
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.
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.
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
