public SiteWithConfig()
 {
     Site = new Site();
     SiteConfig = new SiteConfig();
     AppSettings = new Hashtable();
     DiagnosticsSettings = new DiagnosticsSettings();
 }
Example #2
0
 public SiteWithConfig()
 {
     Site = new Site();
     SiteConfig = new SiteConfig();
     AppSettings = new Hashtable();
     DiagnosticsSettings = new DiagnosticsSettings();
     Instances = new WebsiteInstance[0];
 }
 public SiteWithConfig(Site site, SiteConfig siteConfig)
 {
     Site = site;
     SiteConfig = siteConfig;
     AppSettings = new Hashtable();
     DiagnosticsSettings = new DiagnosticsSettings();
     
     if (SiteConfig.AppSettings != null)
     {
         foreach (var setting in SiteConfig.AppSettings)
         {
             AppSettings[setting.Name] = setting.Value;
         }
     }
 }
        public override void ExecuteCmdlet()
        {
            // Get current config
            website = WebsitesClient.GetWebsite(Name, Slot);
            siteConfig = WebsitesClient.GetWebsiteConfiguration(Name, Slot);

            // Update the configuration
            if (siteConfig.RemoteDebuggingEnabled.Value)
            {
                siteConfig.RemoteDebuggingEnabled = false;
                WebsitesClient.UpdateWebsiteConfiguration(Name, siteConfig, Slot);
            }

            if (PassThru.IsPresent)
            {
                WriteObject(true);
            }
        }
 public SiteWithConfig(Site site, SiteConfig siteConfig, DiagnosticsSettings diagnosticsSettings) :
     this(site, siteConfig)
 {
     DiagnosticsSettings = diagnosticsSettings;
 }
 public static void UpdateSiteConfig(this IWebsitesServiceManagement proxy, string subscriptionId, string webspaceName, string name, SiteConfig siteConfig)
 {
     proxy.EndUpdateSiteConfig(proxy.BeginUpdateSiteConfig(subscriptionId, webspaceName, name, siteConfig, null, null));
 }
Example #7
0
 public SiteWithConfig(Site site, SiteConfig siteConfig, DiagnosticsSettings diagnosticsSettings, WebsiteInstance[] instances) :
     this(site, siteConfig)
 {
     DiagnosticsSettings = diagnosticsSettings;
     Instances = instances;
 }
 private void GetCurrentSiteState()
 {
     website = WebsitesClient.GetWebsite(Name, Slot);
     currentSiteConfig = WebsitesClient.GetWebsiteConfiguration(Name, Slot);
 }
 public IAsyncResult BeginUpdateSiteConfig(string subscriptionName, string webspaceName, string name, SiteConfig siteConfig, AsyncCallback callback, object state)
 {
     SimpleServiceManagementAsyncResult result = new SimpleServiceManagementAsyncResult();
     result.Values["subscriptionName"] = subscriptionName;
     result.Values["webspaceName"] = webspaceName;
     result.Values["name"] = name;
     result.Values["siteConfig"] = siteConfig;
     result.Values["callback"] = callback;
     result.Values["state"] = state;
     return result;
 }
 /// <summary>
 /// Update the website slot configuration
 /// </summary>
 /// <param name="name">The website name</param>
 /// <param name="newConfiguration">The website configuration object containing updates.</param>
 /// <param name="slot">The website slot name</param>
 public void UpdateWebsiteConfiguration(string name, SiteConfig newConfiguration, string slot)
 {
     name = SetWebsiteName(name, slot);
     UpdateWebsiteConfiguration(name, newConfiguration);
 }
 /// <summary>
 /// Update the website configuration
 /// </summary>
 /// <param name="name">The website name</param>
 /// <param name="newConfiguration">The website configuration object containing updates.</param>
 public void UpdateWebsiteConfiguration(string name, SiteConfig newConfiguration)
 {
     Site website = GetWebsite(name);
     WebsiteManagementClient.WebSites.UpdateConfiguration(website.WebSpace, name,
         newConfiguration.ToConfigUpdateParameters());
 }
 internal static SiteConfig ToSiteConfig(this WebSiteGetConfigurationResponse getConfigResponse)
 {
     var config = new SiteConfig
     {
         NumberOfWorkers = getConfigResponse.NumberOfWorkers,
         DefaultDocuments = getConfigResponse.DefaultDocuments.ToArray(),
         NetFrameworkVersion = getConfigResponse.NetFrameworkVersion,
         PhpVersion = getConfigResponse.PhpVersion,
         RequestTracingEnabled = getConfigResponse.RequestTracingEnabled,
         HttpLoggingEnabled = getConfigResponse.HttpLoggingEnabled,
         DetailedErrorLoggingEnabled = getConfigResponse.DetailedErrorLoggingEnabled,
         PublishingUsername = getConfigResponse.PublishingUserName,
         PublishingPassword = getConfigResponse.PublishingPassword,
         AppSettings = getConfigResponse.AppSettings.Select(ToNameValuePair).ToList(),
         Metadata = getConfigResponse.Metadata.Select(ToNameValuePair).ToList(),
         ConnectionStrings = new ConnStringPropertyBag(
             getConfigResponse.ConnectionStrings.Select(cs => new ConnStringInfo
             {
                 ConnectionString = cs.ConnectionString,
                 Name = cs.Name,
                 Type = (DatabaseType)Enum.Parse(typeof(DatabaseType), cs.Type.ToString())
             }).ToList()),
         HandlerMappings = getConfigResponse.HandlerMappings.Select(hm => new HandlerMapping
         {
             Arguments = hm.Arguments,
             Extension = hm.Extension,
             ScriptProcessor = hm.ScriptProcessor
         }).ToArray(),
         ManagedPipelineMode = getConfigResponse.ManagedPipelineMode,
         WebSocketsEnabled = getConfigResponse.WebSocketsEnabled,
         RemoteDebuggingEnabled = getConfigResponse.RemoteDebuggingEnabled,
         RemoteDebuggingVersion = getConfigResponse.RemoteDebuggingVersion.GetValueOrDefault(),
         RoutingRules = getConfigResponse.RoutingRules.Select(r => r.ToRoutingRule()).ToList()
     };
     return config;
 }