Azure / Azure/PSRule.Rules.Azure
[FEATURE] Detect help links from exported policies
- Dominant language
- PowerShell
- Stars
- 447
- Forks
- 109
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 23
Description
### Your suggestion
When exporting policies as rules, currently there is no standard practise or property for providing a help link.
Currently many built-in policy initiatives provide a link to Azure docs as part of their `description`.
We should implement a pattern that makes it easy for customers to define their policies linking to documentation but also have built-in features just work where they are configured.
We should implement the logic find a help URL by:
1. If a policy definition has a `link` metadata property with a `https://` URL then include this as the help link.
2. If a policy definition has a `https://` URL at the end of the `description` property include this as the help link.
3. If a policy initiative has a `link` metadata property with a `https://` URL then include this as the help link.
4. If a policy initiative has a `https://` URL at the end of the `description` property include this as the help link.
5. If no links are found use configuration from the `AZURE_POLICY_DEFAULT_URL` option.
### Alternatives
None available.
### Additional context
Related to #2482
Contributor guide
Research direction
The issue does not name files or tests. Start by locating the policy export path and existing handling of policy definition and initiative metadata and descriptions, then check how the AZURE_POLICY_DEFAULT_URL option is configured. Done means exported rules expose the first applicable HTTPS help link, falling back to the configured default when none is present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- devops, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100