Azure / Azure/azure-quickstart-templates
resourceId multi-segmented argument
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
I need to get the resourced id for an azure file share.
`resourceId('Microsoft.Storage/storageAccounts/fileServices/shares', parameters('storageAccounts_mystorage_name'), 'default', parameters('myfileshare_name'))`
As far as I can see from the resource explorer, this should be correct.
```
"resourceType": "Microsoft.Storage/storageAccounts/fileServices/shares",
"resourceName": "mystorage/default/myfileshare"
```
However, I keep getting the error:
```
Unable to evaluate template language function 'resourceId': function requires exactly one multi-segmented argument which must be resource type including resource provider namespace. Current function arguments 'Microsoft.Storage/storageAccounts/fileServices/shares,mystorage,/default/,mysfileshare'.
http://aka.ms/arm-template-expressions/#resourceid for usage details.
```
I got to the link it references: https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-resource#resourceid
And the parameters it takes are:
Parameter | Required | Type | Description
-- | -- | -- | --
subscriptionId | No | string (In GUID format) | Default value is the current subscription. Specify this value when you need to retrieve a resource in another subscription.
resourceGroupName | No | string | Default value is current resource group. Specify this value when you need to retrieve a resource in another resource group.
resourceType | Yes | string | Type of resource including resource provider namespace.
resourceName1 | Yes | string | Name of resource.
resourceName2 | No | string | Next resource name segment, if needed.
Which seems to be consistent with the ones I provide. Can anyone help? Thanks.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the resourceId documentation linked in the issue and compare its parameter forms with the Azure resource explorer resourceType and resourceName values shown. Reproduce the evaluation error using the exact expression; done means the supported multi-segment resource ID behavior and required correction are established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100