-
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
Refactor and remove use of ArmSnippits.jsonc #844
Comments
Thanks for opening this issue @Cairn23. Are you suggesting that instead of using the static armsnippets.jsonc for providing snippet services we use something that dynamically creates snippets fro arm schemas? We are considering what to do next with snippets, which may include a refactoring of the snippet source. Details / dicssion can be found in this issue: #748 |
That's correct. It should be possible to create the required code from the schema's. |
We've discussed automatically generating snippets from schema, but it's not as simple as it sounds. It would work in many cases but will probably yield poor results in many others. It would still be nice to have the option available for ones we don't have more specific snippets for. @alexgav How much work do you think that would be? And how successful do you think it would be? |
The schema should be the definition of whats is possible, so would be good to understand why you think it will yield poor results, unless you are indicating there are problems with the schemas |
Adding some notes / thoughts for discussion. Template reference documentation is created using autorest and the azureresourceschema plugin. Perhaps we can investigate this method for auto-generating snippets. That said, some considerations: TersenessConsider is the verbosity / terseness of auto-generated snippets. For example, take a look at the auto-generated snippet in this doc vs. the current snippet.
I have spoken with many customers about this and preference is to start terse and layer on optional properties as desired. However on the flip side, we have received significant feedback on snippet coverage, autogenerated / verbose snippets may be a compromise. Tab stopsWould we be able to intelligently add tab stops ideally with potential values? I do not use them much myself but they do add a nice polish. Resource generalizationOne of the things I'm keen on doing is adding some resource generalization. For example, if I add a storage account .via a snippet would I also add and reference a parameter for the name. This may be the same discussion as tab stops, but want to point out the specific feature. |
Other considerations: Best practicesJust filling in the available properties may not yield a resource with best practices Multiple-resource snippetsQuite a few of our snippets create multiple resources That said, I've never liked being in the business of owning snippets for other teams. |
We're tracking this as part of a larger Snippets effort, #748 |
The current working rely on the armsnippits.jsonc in order to formulate the basic template for the user to populate. The problem I see with this is that it's possible to then get out of sync with the scheme's. Would it not be better to only utilise the schema and the resource definitions. from my reading to date the convention to date is that if the definition name does not include and underscore its a piece of Azure compute that can be deployed. Those with the underscore are sub components .
eg in the Microsoft.web.json you have a Sites definition, than all the sub components are names sites_***.
Therefore from this you should be able to build as required, and also remove the dependency on the code snippets
The text was updated successfully, but these errors were encountered: