Azure / Azure/bicep

Dedicated function for parsing resource IDs

Open
#9,838 0 comments 6 reactions 0 assignees View on GitHub
enhancement good first issue
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.