Azure / Azure/bicep

Auto-fix: Linter warning `no-hardcoded-env-urls` should just tell me what to write.

Open
#2,999 11 comments 4 reactions 0 assignees View on GitHub
devdiv enhancement story: linter rules
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Is your feature request related to a problem? Please describe.**

```
/workspaces/dbinfra/templates/rg-patient.bicep(35,43) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls
```

**Describe the solution you'd like**

Instead of telling me about the `environment()` functions it would be nice if it could tell me the exact expression, I have no idea what to write after `environment()`. (it turns out it seems to be `environment().suffixes.storage` it should be in my case :)

Contributor guide

Open the contributing guide

Research direction

Start with the no-hardcoded-env-urls linter rule and the diagnostic shown in this issue. Trace how the rule identifies disallowed hosts and formats its guidance, then define the exact environment() expression to suggest for the detected host. Done means the warning gives actionable replacement text for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
infrastructure, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.