-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
npm install -g @hso/d365-cli
- Install Node. Select the LTS Version (Long Term Support). Read more
- Install ESLint plugin. Read more
- Install Fiddler. Read more
- Configure Visual Studio Code
- Configure Application Registration
Node is the Node Package Manager used by the projects to install JavaScript/TypeScript packages
When using Visual Studio Code as IDE, have Visual Studio Code ESLint plugin installed. The projects have an ESLint Configuration to lint/validate the code build and compile time. The ESLint plugin is for build time.
Fiddler Classic is recommended for debugging. It is a proxy and will serve local files instead of server files. Fiddler needs some settings in general and rules for every project. See Debugging for adding rules.
Installing Fiddler Classic may be hard, since you need to pass some registration. To easy this, you can use Chocolately.
choco install fiddler
Fiddler settings:
-
Start Fiddler and click 'Tools' and 'Options...'
-
Click 'HTTPS' tab
- Select 'Capture HTTPS CONNECTs', 'Decrypt HTTPS traffic', 'Ignore server certificate errors (unsafe)
- Select '...from browsers only' in dropdown
- In 'Skip descryption for the following hosts:' add *.microsoft.com; *.microsoftonline.com; *.live.com; *.office.net;
-
Click 'Connections' tab
- Select 'Reuse client connections', 'Reuse server connections', 'Act as system proxy on startup', 'Monitor all connections', 'DefaultLAN'
- In 'Bypass Fiddler for URLs that start with:' add <-loopback>; *office.net; *office365.com; *live.com; *.microsoft.com; *.microsoftonline.com;
Running the CLI commands in Visual Studio Code will give an error, since PowerShell by default restricts running scripts unless the execution policy is changed. This can be done by following steps:
- Open Visual Studio Code
- Press ctrl + shift + p)
- Type "settings.json" and select option 'Preferences: Open Settings (JSON)' to edit the settings.json
- Add following part inside the brackets
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": ["-ExecutionPolicy", "Bypass"]
}
},
"terminal.integrated.defaultProfile.windows": "PowerShell",
Make sure you make this change in the Global and not in your own workspace.
By default the project uses an Application Registration provided by HSO, which is multi-tenant and will be fine for most projects. If an IT department does not allow that, they have to create an Application Registration in their own tenant and the project needs the clientId and Redirect url:
- In Azure Active Directory create an Application Registration
- In API Permissions assign Dynamics CRM (user_imporsonate)
- In Authentication switch on both 'Access tokens (used for implicit flows)' and 'ID tokens (used for implicit and hybrid flows)'
- Set Redirect url equal to the project tools/crm.json/adal/redirectUri
- Copy client Id and put in the project tools/crm.json (adal/clientId)