azure-node-essentials/README.md

2.9 KiB

Azure Node Essentials

This extension provides tools for NodeJs developers working with Azure SDKs.

Feature List

  1. Project and file scaffolding
    • yo azure-node to create
      • Javascript or Typescript project with package.json set up to target Azure SDKs
      • Empty .js or .ts files
      • pre populated .tsconfig or .jsconfig files
      • create a service principal
  2. Snippets for some common operations such as authentication, creating a service principal.
    • loginInt : generate code for interactive login
    • loginPwd : generate code for logging in with username and password
    • loginSp : generate code for logging in with a service principal
    • spCreate : generate code to create a service principal
  3. Search and Install Azure packages from NPM
    • command Azure-Node: Browse Azure-SDK Packages : type to filter by matching name, enter to npm-install it locally
  4. Code generation scenarios
    • command Azure-Node: Generate code for template deployment : generate code for template deployment

Demo

Project Scaffolding

Project Scaffolding

Snippets

Snippets

Package browsing

Package browsing

Code generation

1. template deployment

Code gen for template deployment

Sample workflow

  1. Open VS code with an empty workspace (empty folder)
  2. Bring up VS code command palette, invoke yo
  3. Choose azure-node generator and invoke it.
  4. Choose * app to invoke the main generator (the sub generators for files are listed at the root level)
  5. Choose a Javascript project and proceed.
  6. This should initialize your project and install npm dependencies
  7. Meanwhile, open the folder in VSCode and navigate to index.js
  8. Notice that package.json has been set up and index.js has boiler plate code for authentication.
  9. Place caret on the line after // TODO: Write your application logic here.
  10. From VS Code's command palette, invoke >Azure-Node: Generate code for template deployment
  11. The extension generates code for template deployment in the file currently active in the vscode editor and adds required dependencies to package.json.

Dependencies

The following package/extension dependencies are auto installed when you install this extension.

  1. vscode yo
  2. generator-azure-node

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.