azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

Should GetParameters be exposed on Construct?

Open JoshLove-msft opened this issue 2 years ago • 2 comments

public IEnumerable<Parameter> GetParameters(bool recursive = true);

Should this have the recursive parameter or even be on Construct? I think the return will always be empty if recursive is false.

JoshLove-msft avatar Feb 18 '24 00:02 JoshLove-msft

Yes it should. A parameter belongs to a construct NOT a resource therefore it is what needs the list and the ability to query.

m-nash avatar Feb 20 '24 01:02 m-nash

The construct that the parameter is added to by the user doesn't translate anymore to how parameter will be represented in the bicep. This is because the bicep is constructed into modules based on https://github.com/Azure/azure-sdk-for-net/issues/42017. For that reason, I wonder what value there is in letting a user add/query parameters via the user constructs.

JoshLove-msft avatar Feb 20 '24 06:02 JoshLove-msft

Based on the changes to always expose parameters added via AddConstruct even if they are not assigned to a resource, we should still have the GetParameters method. However, there is a bug in that it doesn't dedup parameters currently.

JoshLove-msft avatar Mar 09 '24 18:03 JoshLove-msft