Agent skill
run-bicep-in-console
Validates Bicep functions using bicep console with piped input. Use when user asks to test, validate, or run Bicep functions, or wants to verify function behavior with test cases.
Install this agent skill to your Project
npx add-skill https://github.com/johnlokerse/azure-bicep-github-copilot/tree/main/.github/skills/run-bicep-in-console
SKILL.md
Run Bicep in the Bicep Console
Quickly validate Bicep functions by piping test cases to bicep console.
Workflow
- Analyze the function: Understand inputs and outputs
- Generate test cases: Create at least 2 test cases
- Detect shell type: Check the user's active terminal to determine if they're using PowerShell or bash
- Look at terminal context for
pwsh,PowerShell, orbash - Check
$SHELLenvironment variable or terminal name
- Look at terminal context for
- Run in bicep console: Pipe function + test expressions using the appropriate shell syntax
PowerShell Command
CRITICAL: Use single-quoted here-string (@'...'@) to prevent $ interpolation:
@'
func myFunction(input string) string => ...
myFunction('test1')
myFunction('test2')
'@ | bicep console
Bash Command
Use a heredoc with cat:
cat <<'EOF' | bicep console
func myFunction(input string) string => ...
myFunction('test1')
myFunction('test2')
EOF
Note: Quote 'EOF' to prevent $ expansion (same principle as PowerShell).
Test Case Guidelines
- Normal case: Typical expected input
- Edge case: Empty strings, special characters, boundary values
- Return value validation: Include expected output as comment
Example
For a reverse function:
@'
func reverse(input string) string =>
reduce(range(0, length(input)), '', (acc, i) => '${acc}${substring(input, length(input) - 1 - i, 1)}')
reverse('hello') // Expected: 'olleh'
reverse('world!') // Expected: '!dlrow'
'@ | bicep console
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
convert-bicep-to-avm
Converts Bicep resource definitions to Azure Verified Modules (AVM). Use when user asks to convert to AVM, replace resources with modules, use verified modules, or modernize bicep templates.
convert-loose-to-strong-type
Converts loosely typed Bicep parameters using object or array to strongly typed alternatives like string[], user-defined types, or resource-derived types. Use when user mentions type safety, weak typing, object parameters, array parameters, resourceInput, resourceOutput, or asks to improve parameter definitions.
format-bicep
Format Bicep code for readability and consistency.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
Didn't find tool you were looking for?