resourceGroups('RGtoLock').location
is not a valid ARM template function. I think you meant to have resourceGroup().location
.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@DrEsteban Can you confirm you tried the example and it didn't work? The function provided resourceGroups('RGtoLock').location
is correct. You are right that it isn't an Azure Resource Manager template function, but it is a blueprint function. I have an action to document these (there are a few others), but they are useful in templates where resourceGroup().location
might not have any context since it was created outside the template. The parameter, in this case RGtoLock, is the placeholder name of the created resource group that you want to point to. Let me know if this is not working for you and we can adjust, but it should work. Thanks!
@MicrosoftDocs/azure-cxp-triage Please assign to me, label 'product-question', and #in-progress
Hey @DCtheGeek, yes I followed the instructions of the article, including setting all expected values, and the issue remains:
Artifact '901b3087-0451-438b-9bbe-823cd8379236' of type 'Template' failed to deploy. {"error":{"code":"InvalidTemplate","message":"Deployment template validation failed: 'The template resource 'store3psm3ojzc442e' at line '27' and column '9' is not valid: The template function 'resourceGroups' is not valid. Please see https://aka.ms/arm-template-expressions for usage details.. Please see https://aka.ms/arm-template-expressions for usage details.'."}}
Here is a screenshot of my blueprint assignment:
@DrEsteban Thanks for the additional details. I'll look at this with the team and will get back to you.
@DrEsteban Just as a quick follow-up, I can repro this. We are looking at the details now.
@DCtheGeek Sounds good! Glad it's not one of those "works on my machine" situations :)
Just to clarify, this is not blocking me in any way. Just wanted to submit as a heads up.
@DrEsteban So, turns out it was my mistake. :)
The [resourceGroups('RGPlaceholder').location]
function only works when used in a blueprint level parameter (that could then be passed to the template). Since the template above is a resource group template, it does have context to the resource group, so [resourceGroup().location]
will work. If it was a subscription level template, that function wouldn't work as it wouldn't have context to the resource group. I'm correcting the sample and updating the article. When it merges, this issue will automatically close. Really appreciate your pointing it out!
All of the blueprint functions have now been doc'ed: https://docs.microsoft.com/azure/governance/blueprints/reference/blueprint-functions