Extension resource functions always trigger the error `The template function 'invokeResourceMethod' is not valid`
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Bicep version**
Bicep CLI version 0.36.90 (a8510cf601)
**Describe the bug**
When populating the ` functions` property of a `ResourceType` and attempting to use the function in a `local-deploy` deployment, the error `The template function 'invokeResourceMethod' is not valid. Please see https://aka.ms/arm-functions for usage details.` is triggered. Preventing the use of any resource function.
**To Reproduce**
1. Clone the following repository https://github.com/GABRIELNGBTUC/bicep-ext-local
2. Run the script `./scripts/publish.sh ./bin/bicep-ext-local`
3. Start a local deployment with `~/.azure/bin/bicep local-deploy ./samples/basic/main.bicepparam`
The deployment should fail with the following output:
```
Error: DeploymentOutputEvaluationFailed - The template output 'data' is not valid: The template function 'invokeResourceMethod' is not valid. Please see https://aka.ms/arm-functions for usage details..
Resource wait (Create): Succeeded
Result: Failed
```
**Additional context**
It would be interesting to know if resource functions will be supported for local deployments or is an exclusivity of Azure extensions that can run through standard Azure ARM deployments (first party extensions).
If this is supported, it would also be interesting to know what is the usage `resourceFunctions` inside the `index.json` since there does not seems to have any obvious change when this property is populated.
Contributor guide
Research direction
Reproduce the failure by running scripts/publish.sh and the local-deploy command against samples/basic/main.bicepparam. Inspect the resourceFunctions entry in index.json and the local-deploy handling of the generated resource function; done means establishing whether local deployments support this function and documenting or correcting the observed behavior.
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