Azure / deployment-stacks

Contains Deployment Stacks CLI scripts and releases
MIT License
89 stars 7 forks source link

New-AzSubscriptionDeploymentStack Inline Parameters #122

Closed data-tangles closed 5 months ago

data-tangles commented 1 year ago

Is your feature request related to a problem? Please describe. Currently with New-AzSubscriptionDeploymentStack you can't (seemingly) provide inline parameters to bypass a Parameters file. If I try with the following code:

New-AzSubscriptionDeploymentStack -Name $(deploymentStackName) -Location $(Location) -TemplateFile ".\main.bicep" -deploymentLocation $(deploymentLocation) -tags $(tags) -vNetAddressSpace $(vNetAddressSpace) -vNetName $(vNetName) -nsgName $(nsgName) -rg_name $(rg_name)

I just get the below errors:

deploymentStackName: The term 'deploymentStackName' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. deploymentLocation: The term 'deploymentLocation' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. tags: The term 'tags' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. vNetAddressSpace: The term 'vNetAddressSpace' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. vNetName: The term 'vNetName' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. nsgName: The term 'nsgName' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. rg_name: The term 'rg_name' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Describe the solution you'd like I use Azure DevOps pipelines for deployment. I have a repo with public facing Bicep modules. I want the modules themselves to be public, but I want to pass the parameters using variable groups which is why I need the parameters to be specified inline.

For example, I have the following code which works for the standard New-AzSubscriptionDeployment cmdlet :

New-AzSubscriptionDeployment -Location $(Location) -TemplateFile ".\main.bicep" -WhatIf -deploymentLocation $(deploymentLocation) -tags $(tags) -vNetAddressSpace $(vNetAddressSpace) -vNetName $(vNetName) -nsgName $(nsgName) -rg_name $(rg_name)

Describe alternatives you've considered I've considered placing the parameters files inside a private repo and specifying this in the CLI but I want to avoid separate repo's if possible

Additional context Add any other context or screenshots about the feature request here.

dantedallag commented 1 year ago

This (Dynamic parameters) is a feature we are aware is missing in stacks and is planned for the future. We can use this issue to track progress.

quality-leftovers commented 5 months ago

Wanted to switch our dev environment deployment to stacks and stumbled over this issue. In the end we decided to pass on deployment stacks for now because we didn't want to change our existing setup too much for a public preview feature.

dantedallag commented 5 months ago

@quality-leftovers This feature is actually implemented in the newest version of stacks if you would like to try.

@data-tangles also wanted to notify you that this feature is available if you would like to verify.

quality-leftovers commented 5 months ago

Just as feedback: I upgraded Pwsh Module Az 11.4.0 to 11.5.0 and it worked. Thanks for the heads up 👍