Dedicated function for parsing resource IDs
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
A function like `parseResourceId()` could be used to return an object with each segment parsed out. For example:
Input:
```bicep
var resId = '/subscriptions/996a2f3f-ee01-4ffd-9765-d2c3fc98f30a/resourceGroups/alfranstackjan23/providers/Microsoft.Storage/storageAccounts/yopvrojijqowq0'
var segments = parseResourceId(resId)
```
Output:
```
segments: {
subscriptionId: '996a2f3f-ee01-4ffd-9765-d2c3fc98f30a'
resourceGroup: 'alfranstackjan23'
resourceProvider: 'Microsoft.Storage/storageAccounts'
name: 'yopvrojijqowq0'
children: []
extensions: []
}
```
`children` and `extensions` are to cover any extension or child resources in the ID. Not sure if this is the best schema to reresent this return type, but trying to account for evertyhing.
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by locating the existing resource-ID parsing or resource-reference implementation, then review Azure resource ID forms, including child and extension resources. Done means the function’s return schema is agreed and its parsing behavior is covered for the examples and resource variants described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100