-
Notifications
You must be signed in to change notification settings - Fork 98
Description
I am using the default parameter mapping whereby my parameter files for my deployment templates share the same name except they are suffixed with .parameters.json. E.g.:
CosmosDb-Connection.json
CosmosDb-Connection.parameters.json
The way that the deployment script works is it looks for a parameter file 3 ways: through the sentinel-deployment.config file, via a workspace parameter file or via a default parameter file. I am using the default parameter file method.
In the function GetParameterFile it gets the parameter file name by:
- Getting the path of the deployment
- Attempting to remove the
.jsonat the end of the file name - Fixing
.parameters.json
It then uses the Test-Path function to attempt to find the parameter file. If it returns true it gets the parameter file path, else it returns null.
I added a few lines to debug the code and I can see that it's not correctly getting path of the deployment, see the highlighted yellow sections in the image below:

The issue must be with the line: `$parameterFilePrefix = $path.TrimEnd(".json")
By changing the logic to use the split function (first thing i could think of doing, there might be a better way) and taking the first part it fixes the issue: $parameterFilePrefix = $path.Split('.')[0]
This fix is dependent on there not being any periods (full stops) in your file names.