Solvedazure quickstart templates resourceId() support for multi-segment sub-resources?

Seems like it is more difficult that it should be to reference a subnet using the resourceId() function.

Attempting to specify

[resourceId('test-group','Microsoft.Network/virtualNetworks','test-vnet','subnets/default')]

Fails with 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 'test-group,Microsoft.Network/virtualNetworks,test-vnet,subnets/default'. Please see
http://aka.ms/arm-template-expressions/#resourceid for usage details.

Am I missing something? Obviously I can get the resource ID of the vnet, then use concat to add on the subnet, but it seems like resourceId() should support this. I am guessing subnets are not the only resource type like this. Can't the first multi-segment parameter be identified as the resource type, and then allow either sub-resources to be multi-part (or allow more than two resourceName trailing parameters which are concatentated with separating slashes)?

14 Answers

✔️Accepted Answer

I think I figured this out:

[resourceId('resource-group','Microsoft.Network/virtualNetworks/subnets','test-vnet','default')]

funny how none of the quick-start examples do this

Related Issues:

33
azure quickstart templates resourceId() support for multi-segment sub-resources?
I think I figured this out: funny how none of the quick-start examples do this ...
50
Open3D ImportError: /lib64/libm.so.6: version 'GLIBC_2.27' not found
I met the same question after pip install and I solved it by specifying a version python -m pip inst...
16
azure powershell 'az account get-access-token' equivalent in Azure PowerShell
Get-AzAccessToken is available in Az.Accounts 2.2.0 which will be released on Nov 17 please have a t...
16
Open3D JVisualizer python27 AttributeError: 'module' object has no attribute 'PointCloud'
pip install open3d-python fixes the no attribute 'PointCloud' problem for me I'm using Ubuntu 16.04 ...
5
Open3D Open 3D package for Apple silicon M1
Hi @DikZoo you may try this experimental build let me know if it works for you ...
5
platformio core Debug by CLion
Hi all There is a piece of good news here We are so happy to present the first MVP of the PlatformIO...
3
build Re-enable XR819 radio for orange pi zero
I am performing some WiFi testing on Orange Pi Zero with default installations of various distributi...
3
Open3D Convert Realsense poincloud in Open3D pointcloud
To test te most efficient way to show in realtime the pointcloud from Realsense ...
6
bicep Scope Issue on Microsoft.Authorization/roleAssignments
I can confirm that using this works great: However this was never part of my problem ...
96
sops Cannot decrypt with GPG 2.2.5 and SOPS 3.0.0
The problem suddenly re-occured.. I think it has to do with the gpg-agent For the moment this solved...
42
azure cli az aks list - No module named '_cffi_backend'
Same here Update: python3 -m pip install cffi fixed it for me. Command Ran: az aks list Fixed issue ...
38
azure cli zsh autocompletion on OSX/macOS
I also just encountered this Every time I launch my terminal I get the following error: /Users/blake...
27
azure cli 'az aks browse' doesn't work. Error listening on port 8001
Found a workaround Describe the bug This command used to work for me but not recently even after I r...
18
terraform provider azurerm key vault soft-delete causing failure when updating secrets or certificates
I'm seeing exactly the same issue key vault soft-delete causing failure when updating secrets and ce...
14
terraform provider azurerm Azurerm_frontdoor with v2.24.0 breaks when azure frontdoor is edited in portal.
Same issue here but on another level: Error: flattening frontend_endpoint: ID was missing the frontD...
13
acs engine Pods are uanble to resolve DNS for any of Azure service or other external sites.
Here is a quick status update: There are two problems happening concurrently Is this a request for h...
13
terraform provider azurerm r/application_insights: support for the Workspace model
Until this is supported natively by terraform This issue was originally opened by @klainn as hashico...
13
azuredatastudio Connecting to remote SQL Server from Ubuntu 20.04
hello i am so happy to tell you that i have a solution i tested and works perfectly is a downgrade o...
13
pulumi Resource Adoption
I have a workaround until this feature is shipped While pondering #1654 ...
12
azure cli az ad app permission grant not working or usable as expected
az ad app permission admin-consent is the old way of granting all Application Permissions and Delega...
12
azure cli unable to update cli using homebrew
I ran brew reinstall python3 to fix this I tried to install the latest CLI from the docs: https://do...
12
azure sdk for net ClientServerCredential equivalent for simple apiKey authentication?
Here is my version of the ServiceClientCredentials for apiKey Is there support for swagger's concept...
11
azure cli DLL load failed while importing win32file: The specified module could not be found.
I was able to solve it by reinstalling pywin32 with a terminal Run as Administrator: Though the root...
11
terraform provider azurerm TF apply/plan have different constraints for "Consumption" tier for API Management
Looks like there's a bit more to this than just the capacity tier of zero Community Note Please vote...
10
terraform provider azurerm multi-tenant deployment using Azure shared image gallery via terraform
@nicethomaslearngit I was having the same issue as you and seem to have figured it out ...
7
azure cli az container create fails with AttributeError: 'ResourcesOperations' object has no attribute 'create_or_update'
Ubuntu hosted agents were updated to azure-cli 2.24.0 today Describe the bug Command Name az contain...
6
terraform provider azurerm Failed to destroy azurerm_key_vault and associated azurerm_key_vault_access_policy (30 minute timeout)
@katbyte given that you've just updated the CHANGELOG.md for the v2.50.0 release (b74f30f) and there...
6
terraform provider azurerm conflict between azurerm_subnet_route_table_association and azurerm_subnet route_table_id
hey @steve-hawkins As a workaround I use a lifecycle in azurerm_subnet : I don't know if this is the...
6
terraform provider azurerm Terraform loses access token and requires az login
At least update the error message from terraform to include the workaround using az account get-acce...
5
spark [BUG]: Trying to follow the "Getting Started" guide step by step
One temporary work-around to avoid seeing the spark temporary files error is to add the following tw...
3
acs engine The cluster-internal DNS server cannot be used from Windows containers
The DNS issue does not seem unique to Windows (#2999 #2880) as of a few days ago ...
3
azure sdk for net [BUG] Enabling VisualStudioCodeCredential on macOS crashes dotnet
Why is this bug closed? This workaround breaks on Windows it feels a bit crispy to add this to every...
3
caprover 502 Bad Gateway error with REST API
If you can reproduce the issue with an open source project I can look into it Hello! I really enjoy ...
3
terraform provider azurerm v1.0.0 checksum mismatch error
Hey @aoggz Thanks for opening this issue - apologies about this This was due to a re-release ...
3
pulumi Python Outputs to string do not work as documented
Thanks for the clarifications and feedback I agree we can definitely work toward making the document...
3
pulumi Grpc.Core.RpcException: "Failed to deserialize response message." when using "cert-manager.crds.yaml" for ConfigFile
Here is the draft of the forking plan: Fork protocolbuffers/protobuf to Pulumi org (done): https://g...
27
ant design landing ValidationError: Invalid options object. Less Loader has been initialized using an options object that does not match the API schema.
temporary way to fix this problem:ant-design/ant-design#23624 😢 remove less-loader@6.0.6 and instal...
22
eleventy Slug filter doesn't create url safe slugs.
yup @zachleat it does replace the slug so I just do remove some chars to make it little bit prettier...
20
eleventy Official Asset Pipeline
I've been using a stylesheet.11ty.js template file to compile CSS (via postcss in my case) I have an...
19
Sourcery Failed to build project with xcode 11.4
I was able to find a temporary workaround by calling unset SDKROOT in the build phase script before ...
15
eleventy How to create sitemap.xml?
Hi @rolandtoth I’ve created one for my (yet un-launched) site You can use the following template (th...
14
eleventy Eleventy reusable components shortcode
Thanks for thinking out loud here this is super helpful feedback to see what you’re trying to do May...
7
eleventy getting data from a .json file in node_modules
Thanks @robb0wen Your example made to try and swap styles.colors.properties to styles.colour.propert...
3
eleventy Is it possible to paginate collection data?
To answer your second question @paulrobertlloyd the permalink front matter key can use template synt...
3
assemble yfm in partials doesn't work
Since you're using the built-in Handlebars syntax for the partial: {{> foo }} assemble does not merg...