in SamplesV1/ADFSecurePublish/AdfKeyVaultDeployment/AdfFileHelper.cs [100:127]
public DeployConfigInfo GetDeployConfigInfo(string filePath)
{
try
{
string fileContents = File.ReadAllText(filePath);
JObject jObject = JObject.Parse(fileContents);
if (jObject.IsValid(jsonConfigSchema))
{
var deploymentDict = jObject.Properties()
.ToDictionary(x => x.Name,
y => y.Value.ToDictionary(z => z["name"].ToString(), z => z["value"].ToString()));
return new DeployConfigInfo
{
FilePath = filePath,
FileName = Path.GetFileName(filePath),
DeploymentDictionary = deploymentDict
};
}
return null;
}
catch
{
return null;
}
}