This repository contains Business Central page automation scripts and tools. Before using these scripts in your environment, please review and follow these security guidelines.
Files Affected: npx-run.ps1, PO Post Prep-3 PS Variants/npx-run.ps1
What to Update:
# Replace this placeholder:
$env:BC_AAD_USERNAME = "YOUR_TEST_ACCOUNT@yourdomain.onmicrosoft.com"
# With your actual test account:
$env:BC_AAD_USERNAME = "test.runner@yourcompany.onmicrosoft.com"Files Affected: npx-run.ps1, PO Post Prep-3 PS Variants/npx-run.ps1
What to Update:
# Replace this placeholder:
-StartAddress "https://businesscentral.dynamics.com/YOUR_TENANT.onmicrosoft.com/YOUR_ENVIRONMENT"
# With your actual BC environment:
-StartAddress "https://businesscentral.dynamics.com/contoso.onmicrosoft.com/Production"Files Affected: Generate-BC-Script-Variants.ps1
The script now uses relative paths (.\Script Prompts\Run Me). If your folder structure differs:
# Update the OutputFolder parameter when calling the script:
.\Generate-BC-Script-Variants.ps1 -BaseScriptPath ".\YourPath\Base.yml" -ProjectFolder ".\YourProject" -OutputFolder ".\YourOutput"-
Use Test Accounts Only
- Never use production credentials
- Create dedicated test accounts with minimal permissions
- Use accounts without MFA for automation (in isolated test environments only)
- OR use TOTP-based MFA with the included solution (see below)
-
Isolate Test Environments
- Run scripts only in sandbox/test environments
- Never point scripts at production BC instances
- Use separate tenants for testing when possible
-
Protect Local Copies
- Keep local copies of scripts with real credentials outside version control
- Use
.gitignorepatterns for personal configuration files - Consider using environment variables or secure credential stores
-
Before Committing:
- β Replace all credentials with placeholders
- β Replace tenant names with generic examples
- β Replace personal file paths with relative paths
- β Remove any company-specific data or references
-
Use Personal Config Files:
- Create
npx-run.local.ps1with your actual credentials (gitignored) - Keep
npx-run.ps1with placeholders in version control - Document this pattern for team members
- Create
-
Review Before Push:
- Use
git diffto review changes - Search for email addresses:
@.*\.com - Search for URLs:
https://businesscentral - Search for absolute paths:
C:\Users\
- Use
Before sharing this repository publicly or with colleagues:
- All authentication credentials replaced with placeholders
- All tenant/environment URLs replaced with generic examples
- All absolute file paths converted to relative paths
- No personal email addresses in files
- No company-specific internal data
-
.gitignoreincludes patterns for sensitive files - README includes security setup instructions
- Test data uses only demo/sample company data
- β Actual passwords or API keys
- β Production environment URLs
- β Personal email addresses
- β Company-internal server names or IP addresses
- β Customer data or real business information
- β Files ending in
.local.*,.personal.*, or.private.*
- β
Placeholder credentials (e.g.,
YOUR_TEST_ACCOUNT@yourdomain.onmicrosoft.com) - β Demo/sample data from standard BC demo company
- β Generic environment references
- β Relative file paths
- β Documentation and guides
Run these searches before committing:
# Search for email patterns
git grep -i "@.*\.onmicrosoft\.com"
# Search for specific domain (replace with your domain)
git grep -i "yourcompany"
# Search for absolute paths
git grep -i "C:\\Users\\"
# Search for URLs
git grep -i "https://businesscentral"If you're unsure whether something is safe to commit, ask yourself:
- Would I be comfortable with this information being public?
- Could this information be used to access our systems?
- Does this contain any customer or company-specific data?
When in doubt, use placeholders and document what users need to configure.
- Copy
npx-run.ps1tonpx-run.local.ps1 - Update credentials and URLs in the
.local.ps1file - Run your local version:
.\npx-run.local.ps1 - Never commit the
.local.ps1file (it's in.gitignore)
This way you maintain a clean version-controlled template while keeping your actual credentials safe and local.
If your organization requires MFA for test accounts, you can use the included TOTP solution instead of requesting MFA exceptions.
Quick Setup:
- Create a test account in Microsoft Entra ID (formerly Azure AD)
- Enable TOTP authentication (Authenticator app method)
β οΈ CRITICAL: Capture the TOTP seed during setup - it's ONLY shown ONCE! (see detailed instructions in README.md)- Store the seed securely for use with bc-replay MFA solution
Benefits:
- Comply with organizational MFA policies
- No need for security exceptions
- Test with production-like authentication flows
Full Documentation: See bc-replay/bc-replay-mfa-solution/ and README.md - TOTP Account Setup.
Last Updated: October 2025
Maintainer: Project Team