MODS server SDK library
Notice:
MODS server SDK
Usage
run npm install mods-server-sdk
at your project
;
API samples:
// Initialize the mods server SDK; // Get basic user info from SSO token; // Get App Identity Access Token; // Get App Identity Access graph client; // Call App Identity Access Function; // Get User Identity Access Token; // Get User Identity Access graph client;; // Call User Identity Access Function;
Azure SQL samples:
// Initialize the mods server SDK.; // Get conn. Make sure identityId, SqlEndpoint, database in modsConfig is configed // // user costumized code to use connection to query// conn.close
Before using the Azure SQL samples, user should operate following steps.
- provision Functions.
- provision Azure SQL server.
- config Azure SQL with Active Directory admin.
- provision Azure SQL database.
- set firewall policy to allow function access database (Allow Azure services and resources to access)
- provision a user-assigned managed identity.
- add identity name to database (use T-SQL command in database
CREATE USER [identity name] FROM EXTERNAL PROVIDER;
). - assign user-assigned managerd identity to the function.