Thursday, June 3, 2021

AEM Cloud Service | Set up Adobe I/O CLI for log tailing

Perquisites- Node.js >=10.22.0 must be installed in system. Check this by executing below command:

node --version

Upgrade to higher node version if needed, using below command:

nvm install 12.18.3

Run following commands:

  1. npm install -g @adobe/aio-cli
  2. aio plugins:install @adobe/aio-cli-plugin-cloudmanager
  3. aio plugins:install @adobe/aio-cli-plugin-asset-compute

Set up the Adobe I/O CLI authentication

  1. Log in to console.adobe.io
  2. Ensure your Organization that includes the Cloud Manager product to connect to is active in the Adobe Org switcher
  3. Create a new or open an existing Adobe I/O program
    • Adobe I/O Console programs are simply organizational groupings of integrations, create or use and existing program based on how you want to manage your integrations
    • If creating a new project, select “Empty Project” if prompted (vs. “Create from Template”)
    • Adobe I/O Console programs are different concepts to Cloud Manager programs
  4. Create a new Cloud Manager API integration with the “Developer - Cloud Service” profile
  5. Obtain the Service Account (JWT) credentials needs to populate Adobe I/O CLI’s config.json
  6. Load the config.json file into the Adobe I/O CLI
    • $ aio config:set ims.contexts.aio-cli-plugin-cloudmanager PATH_TO_CONFIG_JSON_FILE --file --json
  7. Load the private.key file into the Adobe I/O CLI
    • $ aio config:set ims.contexts.aio-cli-plugin-cloudmanager.private_key PATH_TO_PRIVATE_KEY_FILE --file

Once setup is done use below command(s) to tail logs-

  • aio cloudmanager:environment:tail-log ENVIRONMENTID SERVICE NAME 
    ARGUMENTS 
     ENVIRONMENTID the environment id 
     SERVICE the service 
     NAME the log name
  • aio cloudmanager:execution:tail-step-log PIPELINEID ACTION 
     ARGUMENTS 
     PIPELINEID the pipeline id 
     ACTION (build) [default: build] the step action

No comments:

Post a Comment

CDN | Clearing Cloudflare cache

In order to clear Cloudflare cache automatically via code, follow below steps: 1. Develop Custom TransportHandler Develop a custom Trans...