Azure / Azure/bicep

Difference in handling case sensitivity on Windows between extension and CLI

Open
#16,672 2 comments 0 reactions 1 assignee Claimed by @shenglol View on GitHub
bug
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
Tested with both 33.93 (current release) and 34.3 (Nightly as of 20 MAR 2025)

**Describe the bug**
When setting a path to case sensitive in Windows systems the VS Code extension linting does not appear to honor the case sensitive nature when referencing file paths. This leads to strange behavior at deploy time. Bicep.exe does appear to properly honor the case sensitive settings.

**To Reproduce**
- Create a new empty folder
- Open a terminal as administrator
- Change to the new folder and enable case sensitivity for the folder with the command ```fsutil file setCaseSensitiveInfo . enable```
- Create a subfolder ```modules``` (all lower case)
- Within the modules folder create a file ```module.bicep``` with the contents
```
@export()
var hello = 'Hello, world!'
```
- In the root folder create a new file ```main.bicep``` with the contents
```
import * as mod_Module from './Module/Module.bicep'
output result string = mod_Module.hello
```
- Note that the linter does not flag the import with an error (notice the M in both the path and the file are capitalized whereas the actual folder / file on disk are lower case)
- Run the command ```bicep.exe lint main.bicep```
- Note that bicep.exe properly emits the error
```
C:\MinRepro\main.bicep(1,29) : Error BCP091: An error occurred reading file. Could not find a part of the path 'C:\MinRepro\Module\Module.bicep'. [https://aka.ms/bicep/core-diagnostics#BCP091]
C:\MinRepro\main.bicep(3,24) : Error BCP063: The name "mod_Module" is not a parameter, variable, resource or module. [https://aka.ms/bicep/core-diagnostics#BCP063]
```

**Additional context**
This can cause unpredictable results and rework when authoring templates on Windows systems but deploying from Linux hosts (hence why we enable case sensitivity via fsutil)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.