-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Support validation and parameter intellisense for linked templates #588
Comments
Will relative URIs support this? https://feedback.azure.com/forums/281804-azure-resource-manager/suggestions/17275646-enable-using-local-filesystem-for-linked-templates (🤞 🤞 🤞 🤞 ) |
We are going to support a new property for nested deployments called The first place we are going to support For generic deployments, in the short term, we are going to treat VS code will understand and support the relativePath property as part of this work, but it won't be in the first phase. |
@StephenWeatherford some notes on the relative path implementation. ImplementationAdding support for a relativePath field to the TemplateLink object of the Microsoft.Resources/deployments resource type.
Relative Path fields should always use the local file as the starting point (rather than the root template). The customer can specify this implicitly, or with a prefix like ‘.\’ or ‘\’. The relative path will also support / and \ as folder delimiters. ExamplesExample directory / file structure:
From entryTempalte.json, commonTemplate.json can be deployed in the following ways:
From entryTempalte.json, nestedTemplate.json can be deployed in the following ways:
From nestedTemplate.json, the other two files can be deployed like this:
Finally, inaccessibleTemplate.json will not deploy properly, as it is outside the directory of the parent template. Other considerationsOne of the following will be required in the TemplateLink object, however due to expressiveness limitation of JSON schems, this will not be enforced by a schema.
If for example, both The validation API will catch this on pre-flight. We will need to consider how / where to put a similar check for the extension. We need to considering bringing this code into the extensions validation code. |
This will be extremely helpful considering GitHub Actions allows the repo to be checked out as is and execute the ARM Templates as a local resource within the Runner. Thanks for your efforts, please let me know if you'd like testing done. |
@jdelforno Great to know, thanks! Probably starting on this next wek. |
Just released 0.13.0, starting to look at this. Will probably come in phases, the intention is for this to be milestone 0.15.0, but there is a 0.14.0 release planned which will be some minor features and some bug fixes, with 0.15.0 starting in parallel. Are there any public repos with examples of how you guys have things set up? The intention was to start with only supporting relative paths (the new relativePath), which is not in public preview yet, but obviously you guys are not using that yet. |
It makes sence that when using devops u publish your arm scripts to a dropfolder as an artifact and deploy them from there without having to upload to a blobstorage first |
Hello, "Error Reason: Error: Code=InvalidDeployment; Message=The deployment definition is invalid; TemplateLink RelativePath can only be used with api-version '2020-06-01' or later." Here is the resource I am trying to deploy (I removed the parameters for privacy):
I am using the correct version of the API, shouldn't this work? |
@mkulisic The new relative path property isn't available publicly yet, it's still in private preview. cc @alex-frankel |
@StephenWeatherford has there been any update on this? I'm waiting desperately for this 😄 |
Been actively working on it (currently OOF). Hopefully will have something out by end of January. |
See #1116 for first phase. |
@StephenWeatherford do you have a link for applying to join the private preview? |
@DougalKennedy I'll be sure to let you know when we have something to test, thanks! |
@jdelforno @stefan-schweiger @DougalKennedy We have a new release of ARM Tools for VS Code, that now supports linked template validation. Want to take it for a test drive? You can find the new release here: https://github.com/microsoft/vscode-azurearmtools/releases/tag/v0.15.0-alpha1 We would love your feedback! |
@jdelforno @stefan-schweiger @DougalKennedy I've uploaded alpha2, which supports the "uri" property (alpha1 only supported relativePath). You can find the release and instructions here: https://github.com/microsoft/vscode-azurearmtools/releases/tag/v0.15.0-alpha2 Don't hesitate to post in our issues with comments or questions, thanks! I hope to release this next week. NOTE: This invitation is open to anyone. |
@jdelforno @stefan-schweiger @DougalKennedy |
Fixed in next release. Possibly Wednesday. |
This was released on Monday. Let us know if you have problems os suggestions, thanks! |
NOTE: The spec info in this bug is out of date, but the feature is mostly implemented.
Remaining work to consider for later has been moved to #1211
P2
Later
TODO: Update this section
Spec notes
In scope: literal URIs and relative URIs
Dependencies
Validation assembly
#745 Validation API changes to support linked template validation
Extension work
#1116 Linked Templates phase 1
Spec Issues
Template URI:
We will handle both relative and absolute URIs
Validation:
Download and buffer template (do we open in tab or not?)
If required parameters are defined in template A, or a parametersLink exist, provide full validation on buffered template (can we do the first part of this?).
Provide schema and expression validation on buffered template.
Error message with line and location from buffered template but provide no navigation to the location.
Authoring Experience:
Template A parameter completion for template B. Can we also identify required vs optional in the completion experience?
Template A output completion from template B
Relative Path:
Validation:
Open template B from specified path
If required parameters are defined in template A, or a parametersLink exist, provide full validation on template B (can we do the first part of this?).
Provide schema and expression validation on template B.
Error message with line and location from buffered template and potential to provide navigation to the location.
Authoring Experience:
Same as with Template URI.
Other thoughts:
Could we do an insert linked template feature which would take in URI / Path and scaffold out the deployment resource, target. and parameters?
Investigate how this will work when we have linked templates with a depth greater than 2 (A > B > C)
When working with relative / on disk templates is there anything to consider if template B has a parameter file mapping?
The text was updated successfully, but these errors were encountered: