This repo contains solution for KPMG Technical Challenge on Azure Cloud
Below is the relevent files for each challenges
- infra_provision\azure\1-az-setup.ps1
- infra_provision\azure\Resources\1-create-ARG.ps1
- infra_provision\azure\Resources\2-create-AFS.ps1
- infra_provision\azure\Resources\3-create-AVM.ps1
- infra_provision\azure\Resources\4-create-APG.ps1
- infra_provision\azure\2-az-metadata.ps1
- infra_provision\azure\Operations\GetInstanceMatadataForWindowsVM.ps1
- infra_provision\azure\Operations\GetInstanceMatadataForLinuxVM.ps1
- scripts\js\retrieveValueUsingKey.js
- scripts\js\retrieveValueUsingKey_withKeyAndData.js
- You should have an Azure Account
- You should have module az version 2.32 and above installed on your local machine. You can check it by command "az --version"
- You should have nodejs v10.x or above installed.
- You should have pwsh installed. You can run "npm install pwsh" to install it.
- Run command
npm i
Procedure:
- Create a config file
#EnvName#.json
under folder ../config - Run npm command
npm run create:infra #EnvName#"
example:npm run create:infra kpmgtestenv
Procedure:
- To retrieve metadata for an instance, run npm command
npm run retrieve:metadata #EnvName# #VMRole# #VMProperty#
#EnvName# : Name of the env #VMRole# : can be 'front' or 'back' #VMProperty# : to specify a data key. Use '/' for nested key. Leave blank for complete metadata
example: 1. npm run retrieve:metadata kpmgtestenv front
2. npm run retrieve:metadata kpmgtestenv back compute/name
Procedure:
- run npm command
npm run retrievedata:key #dataobject# #key#
#dataobject# : nested object #key# : data key to retrieve
For Test, run npm command npm run test:retrievedata:key
To do:
- update .gitignore
- Add steps to pass retrieved metadata (retrieved in Challenge #2) and key to script retrieveValueUsingKey.js
- Add better tests for Challenge #3
- Create a template config file which can be used to create env config file