Represents public settings. Serialized representation of this object stored as a plain text string on the VM. Part of the protocol between Set-AzureVMDscExtension cmdlet and DSC Extension handler.
        private void CreateConfiguration()
        {
            var publicSettings = new DscExtensionPublicSettings();
            var privateSettings = new DscExtensionPrivateSettings();

            

            if (!string.IsNullOrEmpty(ConfigurationArchive))
            {
                ConfigurationUris configurationUris = UploadConfigurationDataToBlob();

                publicSettings.SasToken = configurationUris.SasToken;
                publicSettings.ModulesUrl = configurationUris.ModulesUrl;
                
                Hashtable privacySetting = new Hashtable();
                privacySetting.Add("DataCollection",DataCollection);
                publicSettings.Privacy = privacySetting;

                publicSettings.ConfigurationFunction = string.Format(
                    CultureInfo.InvariantCulture,
                    "{0}\\{1}",
                    Path.GetFileNameWithoutExtension(ConfigurationArchive),
                    ConfigurationName);
                Tuple<DscExtensionPublicSettings.Property[], Hashtable> settings =
                    DscExtensionSettingsSerializer.SeparatePrivateItems(ConfigurationArgument);
                publicSettings.Properties = settings.Item1;
                privateSettings.Items = settings.Item2;

                privateSettings.DataBlobUri = configurationUris.DataBlobUri;

                if (!string.IsNullOrEmpty(WmfVersion))
                {
                    publicSettings.WmfVersion = WmfVersion;        
                }
            }

            //
            // Define the public and private property bags that will be passed to the extension.
            //
            PublicConfiguration = DscExtensionSettingsSerializer.SerializePublicSettings(publicSettings);
            //
            // PrivateConfuguration contains sensitive data in a plain text.
            //
            PrivateConfiguration = DscExtensionSettingsSerializer.SerializePrivateSettings(privateSettings);
        }
        /// <summary>
        /// Helper function for tests.
        /// </summary>
        /// <param name="configurationArguments"></param>
        /// <param name="privateSettings"></param>
        /// <returns></returns>
        private static DscExtensionPublicSettings GetPublicPrivateAfterDeseriazlization(
            Hashtable configurationArguments,
            out DscExtensionPrivateSettings privateSettings)
        {
            Tuple<DscExtensionPublicSettings.Property[], Hashtable> separatedSettings =
                DscExtensionSettingsSerializer.SeparatePrivateItems(configurationArguments);
            DscExtensionPublicSettings extensionPublicSettings = new DscExtensionPublicSettings();
            privateSettings = new DscExtensionPrivateSettings();
            extensionPublicSettings.Properties = separatedSettings.Item1;
            privateSettings.Items = separatedSettings.Item2;

            string serializedPublic = DscExtensionSettingsSerializer.SerializePublicSettings(extensionPublicSettings);
            string serializedPrivate = DscExtensionSettingsSerializer.SerializePrivateSettings(privateSettings);

            extensionPublicSettings = DscExtensionSettingsSerializer.DeserializePublicSettings(serializedPublic);
            privateSettings = DeserializePrivateSettings(serializedPrivate);
            return extensionPublicSettings;
        }
 /// <summary>
 /// Serialize DscExtensionPublicSettings to string.
 /// </summary>
 /// <param name="extensionPublicSettings"></param>
 /// <returns></returns>
 public static string SerializePublicSettings(DscExtensionPublicSettings extensionPublicSettings)
 {
     return JsonConvert.SerializeObject(extensionPublicSettings);
 }
 /// <summary>
 /// Serialize DscExtensionPublicSettings to string.
 /// </summary>
 /// <param name="extensionPublicSettings"></param>
 /// <returns></returns>
 public static string SerializePublicSettings(DscExtensionPublicSettings extensionPublicSettings)
 {
     return(JsonConvert.SerializeObject(extensionPublicSettings));
 }