-
Notifications
You must be signed in to change notification settings - Fork 754
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 Request: Support a global Bicep config file (under ~/.bicep/bicepconfig.json) #9902
Comments
Hey folks, I feel like my memory is already deceiving me and I may forgot what the conclusion was with relation to the topic of the So the initial proposal was motivated by the need for a defined behavior in the case of a user authoring an unsaved file. Alan ('A' user :)) has heard about Bicep and he is interested in exploring a new Bicep experimental feature called 'kubernetes extensibility'. Alan reads about this feature in some blog. Alan installs the Bicep extension for VSCode and creates a new unsaved (scratch) file to go along with the content written in the blog. The blog says that he needs to setup his bicepconfig.json however Alan skips reading this because he is an eager user and moves on. He proceeds to paste the following content into his scratch file: @secure()
param kubeConfig string
import 'kubernetes@1.0.0' with {
namespace: 'default'
kubeConfig: kubeConfig
}
resource aks 'Microsoft.ContainerService/managedClusters@2022-05-02-preview' existing = {
name: 'demoAKSCluster'
}
module kubernetes './kubernetes.bicep' = {
name: 'buildbicep-deploy'
params: {
kubeConfig: aks.listClusterAdminCredential().kubeconfigs[0].value
}
} Alan notices the IDE is complaining about the code he just pasted (see image below). -- Silly Alan --, he forgot to setup the Now Alan follows the instructions to create his The IDE prompts him with a question: "Where would you like to save the Bicep configuration file?" ... Alan is faced with a question he can't really answer because the current behavior is not documented. The current behavior per our investigation is that the extension will look (in the windows case) in the However, he notices that he is still in a weird state, his IDE hasn't picked up on his newly created It turns out that Alan had a trailing comma in the However, because the file is unsaved, the changes aren't picked up by the IDE... Alan now tired from this experience, tries to cut and paste the contents of his scratch file to refresh the state of the extension: Except... seems like the tutorial is missing an alias for the kubernetes provider and is causing a naming collision between the provider and the resource (both named kubernetes) so he renames the resource kubernetes -> k8s and now hes done. |
Meeting minutes from bicep discussion held 03/08/23Notable comments
Issues to resolve
|
Some thoughts:
I hesitate on this because it's misleading if the docs get out of date. I'm thinking it would be sufficient if we simply had a way to display the current effective values, which is useful on its own. I know we discussed this in an issue recently but can't find it. Feel free to open a new one.
I personally feel this is more complexity than it's worth right now.
Makes sense. Would probably need to be added to each help message manually. Needs new issue.
I guess my suggestion above is subsumed by this.
Don't have a strong opinion, but it's more docs to keep up to date. Do people really have trouble finding them? Probably makes sense to open separate bugs for the open issues and consider closing this one. |
Created some issues as a result of this conversation and will handle those on a case by case basis |
Is your feature request related to a problem? Please describe.
Whenever I use the Bicep VSCode / VS extension on a scratch file (or a temporary file) I would like to configure a default behavior for the VSCode extension language server. As of now I am forced to create a
bicepconfig.json
in the directory where my scratch file is found so that the language server recognizes the features of the language I am using.For example, notice the file below, (found in
~/tmp/foo.bicep
)The linter complains that it doesn't know about imports. I want to be able to specify
~/.bicep/bicepconfig.json
as followsAnd have the language server pick this up in the absence of a
bicepconfig.json
inside~/tmp
.== NOTE: If a
bicepconfig.json
is specified in the folder structure it should take precedece ==For example: if the file below was specified under
~/tmp/
then I would expect the behavior of the language server to be the same as shown above (with the red squigglys)~/tmp/bicepconfig.json
The text was updated successfully, but these errors were encountered: