Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.24k stars 748 forks source link

Intellisense for parameters (is slow to show) when constructing PS1/AzCLI commands that deploy a bicep file #10600

Open asdkant-bf opened 1 year ago

asdkant-bf commented 1 year ago

Is your feature request related to a problem? Please describe.

When constructing New-AzResourceGroupDeployment commands that deploy a bicep file, I have to go back to the bicep file to reference all the parameters that I need to pass.

Describe the solution you'd like

It would be very helpful to have the same IDE helpers that I get when writing a reference to a Bicep module (type, description, allowed values, maybe even the default value). Detection on when to show this may be a bit tricky if I'm construction the @{} object with the parameters and then passing it to the New-AzResourceGroupDeployment command, but there should be a way to indicate that manually (or some syntax in comments that could be used).

brwilkinson commented 1 year ago

Hi @asdkant-bf

Can you please assist us to understand the problem? Does below cover your ask, or was there something more?

For Powershell we do have the following auto complete on dynamic parameters. Notice storage and location come from the main. Bicep template. Notice these do come at the end of the normal parameters.

image

Powershell 7 also supports a Splatting feature, if you create the @param variable first, then you can auto complete inside of the hash table above, used for the splatting.

image

The main issue right now, is that this is extremely slow. This is likely something that we can track or look into improving, if there was some requests for this.

asdkant-bf commented 1 year ago

@brwilkinson Yes, that sounds like what I want, but I haven't seen it working on my machine. How do I enable this?

brwilkinson commented 1 year ago

@asdkant-bf a few questions:

It's recommended to use powershell 7, which is the Core edition.

image

https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3#install-powershell-using-winget-recommended

https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/vscode/using-vscode?view=powershell-7.3#choosing-a-version-of-powershell-to-use-with-the-extension

image

image

brwilkinson commented 1 year ago

something that came to mind:

brwilkinson commented 11 months ago

It appears that the request here is a standard configuration and should just work.