Example #1
0
        public static JObject PrepareParameters(DeploymentInput deploymentInput, DeploymentOutput deploymentOutput, string path)
        {
            deploymentInput.AssertNotNull(nameof(deploymentInput));
            deploymentOutput.AssertNotNull(nameof(deploymentOutput));
            path.AssertNotEmpty(nameof(path));

            var parameterFileContents = TemplateHelper.GetJsonFileContents(path);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.AdminUserName][TemplateConstants.ValueSection] = new JValue(deploymentInput.VirtualMachineAdminUserName);
            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.AdminPassword][TemplateConstants.ValueSection] = new JValue(deploymentInput.VirtualMachineAdminUserNamePassword);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.UserName][TemplateConstants.ValueSection]     = new JValue(deploymentInput.VirtualMachineUserName);
            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.UserPassword][TemplateConstants.ValueSection] = new JValue(deploymentInput.VirtualMachineUserNamePassword);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.DomainNameLabel][TemplateConstants.ValueSection]    = new JValue(deploymentOutput.VirtualMachineDomainName);
            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.VirtualMachineName][TemplateConstants.ValueSection] = new JValue(deploymentOutput.VirtualMachineName);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.TagClassName][TemplateConstants.ValueSection] = new JValue(deploymentOutput.ClassName);
            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.TagClassId][TemplateConstants.ValueSection]   = new JValue(deploymentOutput.ClassId);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.TagStudentEmail][TemplateConstants.ValueSection] = new JValue(deploymentOutput.StudentEmailAddress);

            parameterFileContents[TemplateConstants.ParametersSection][TemplateConstants.TagStudentName][TemplateConstants.ValueSection] = new JValue(deploymentOutput.StudentName);

            return(parameterFileContents);
        }