Business Central Isolated Storage Generator
Overview
Generates AL objects that securely store secrets (passwords, API keys, tokens)
using the IsolatedStorage data type introduced in Business Central 15.0 as the
replacement for the deprecated Service Password table.
The generated code follows the pattern documented in:
- https://vld-bc.com/blog/how-to-use-isolated-storage
- https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-isolated-storage
- https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/datascope/datascope-option
Quick Start
Example requests:
- "Create isolated storage for an API key"
- "Generate secure password storage for an integration setup"
- "Store a secret token using IsolatedStorage with Company scope"
- "Add isolated storage to my existing setup table"
- "Create OAuth client secret storage"
- "Store a bearer token securely per user"
See also:
references/isolated-storage-examples.mdfor 6 full working examples covering single/multi-secret tables, codeunit-only patterns, user-scoped storage, and HttpClient integration.
Prerequisites
- Available table and codeunit object IDs (from
app.jsonidRanges) - Project affix (from
app.jsonaffixes) - The user must provide a secret key in GUID format to identify the stored value
Interview — Mandatory Questions
Before generating any code the skill MUST ask the user the following questions
using vscode/askQuestions. Do NOT proceed until every answer is collected.
Question 1 — Secret purpose
What secret will be stored? (e.g. "API Key", "Password", "Bearer Token", "Client Secret")
Used to derive object names, captions, and variable names.
Question 2 — DataScope
Which DataScope should the isolated storage use?
Present the four options with descriptions:
| Option | Description |
|---|---|
| Module | Available across the entire extension (all companies, all users). Recommended for shared integration credentials. |
| Company | Available within the current company context inside the extension. Use when each company has its own credential. |
| User | Available per user within the extension. Use for per-user tokens or personal API keys. |
| CompanyAndUser | Available per user within a specific company. Most restrictive scope. |
Default recommendation: Module (most common for integration secrets).
Question 3 — Secret key (GUID)
Provide a secret key in GUID format to identify this secret in isolated storage. You can generate one at https://www.guidgenerator.com/online-guid-generator.aspx
Validate the input matches GUID format:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
If the input does not match, ask again.
Question 4 — Existing setup table
Do you want to add the isolated storage procedures to an existing setup table, or create a new standalone setup table?
If adding to an existing table, ask for the table name / file path and skip new table creation.
Question 5 — Setup page
Do you want a setup page (Card page) to be generated where users can enter and clear the secret?
Default: Yes.
Code Generation Steps
Step 1 — Read project metadata
- Read
app.jsonto obtainidRanges,affixes,name, andpublisher. - Determine the affix to use (e.g.
ABC). - Allocate object IDs for the new table, codeunit, and page from the available range.