Installation and deployment
Version 7.x > Installation and deployment > Azure Logo View modes: 
User avatar
Member
Member
bryanallott - 5/24/2013 6:22:55 AM
   
Azure Logo
Hi, Maybe an odd question but I've noticed the Windows Azure logo isn't showing up on the CMSDesk? I triple checked the "Show Windows Azure logo" is true on global and for the site, but it's still not showing up.

Maybe this isn't a biggie, but then again, maybe it's a subtle clue that there's something *missing* ?

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 5/24/2013 6:38:14 AM
   
RE:Azure Logo
Hello,

Could you please check the HTML of the site and see if there is the following image?
<img id="m_c_h_Header_imgWindowsAzure" src="/CMSPages/GetResource.ashx?image=%5bImages.zip%5d%2fGeneral%2fIconWindowsAzure.png" alt=" " style="border-width:0px;" />

Have you changed the settings recently? It may be necessary to clear site and browser cache, restart application and re-login to the CMS Desk to see the effect. Can you see any errors in the Event Log? Also, may I ask which version and hotfix are you using?

Regards,
Josef Dvorak

User avatar
Member
Member
bryanallott - 7/22/2013 4:16:54 AM
   
RE:Azure Logo
Hi Josef,
I've cleared browser cache, restarted app, recycled app and redeployed several times, and I'm still not getting the logo, even in the HTML.
Currently running 7.0.12.
I've changed a number of settings over time.. but what i have related to the azure deploy are:

CMSAzureProject/true
CMSAzureAccountName/nn
CMSAzureSharedKey/nn
CMSAzureRootContainer/nn
CMSAzurePublicContainer/true

The app is otherwise running fine inside the azure cloud service. The one thing I have noticed though is that I can't get media files to deploy on a container...

Do I need to configure: CMSExternalStorageName ? The documentation says this shouldn't be necessary though...?

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 7/22/2013 10:37:19 AM
   
RE:Azure Logo
Hi,

The fact the image is not generated in the HTML suggests that Kentico had failed to detect it is running on an Azure Cloud instance. Did you install and develop this project from an "Azure Project" install, or did you convert an existing project to Azure project? Thank you for additional information.

Regards,
Josef Dvorak

User avatar
Member
Member
bryanallott - 7/22/2013 11:33:51 AM
   
RE:Azure Logo
Hi Josef, This was an existing project conversion so I suspect I have missed *something*. There were quite a few steps to complete sooo.. :)
Is there a specific class/setting I could start troubleshooting with.. failing that, I'll need to revisit *all* the steps in the solution again... Thanks!

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 7/23/2013 7:26:02 AM
   
RE:Azure Logo
Hi,

The Azure logo is placed in the form control ~\CMSAdminControls\UI\Header.ascx, with ID imgWindowsAzure. It is not visible by default and is only set visible if the related Kentico setting and the Azure Application Setting CMSAzureProject are both set to true. Could you test what this code returns?
SettingsHelper.AppSettings["CMSAzureProject"];

Check that the setting CMSAzureProject is set to true in both ServiceConfiguration.Cloud.cscfg and ServiceConfiguration.Local.cscfg? Also, verify that the ServiceDefinition.csdef contains a definition of this this setting. It should look like this:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="CMSAzure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-05.1.7">
<WebRole name="CMSApp" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="HttpIn" endpointName="HttpIn" />
<Binding endpointName="InternalHttpIn" name="InternalHttpIn" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" />
<Setting name="CMSConnectionString" />
<Setting name="CMSAzureProject" />
<Setting name="CMSUrlPort" />
<Setting name="CMSAzureAccountName" />
<Setting name="CMSAzureSharedKey" />
<Setting name="CMSAzureQueueEndPoint" />
<Setting name="CMSAzureTableEndPoint" />
<Setting name="CMSAzureBlobEndPoint" />
<Setting name="CMSAzureCDNEndpoint" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />
<InternalEndpoint name="InternalHttpIn" protocol="http" port="8080" />
</Endpoints>
<LocalResources>
<LocalStorage name="CMSTemp" cleanOnRoleRecycle="true" />
<LocalStorage name="CMSCache" cleanOnRoleRecycle="false" />
</LocalResources>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
</WebRole>
</ServiceDefinition>

Regards,
Josef Dvorak

User avatar
Member
Member
bryanallott - 7/23/2013 8:26:56 AM
   
RE:Azure Logo
Interestingly, my service definition is pretty much identical and confirming the settings through Azure's web interface, I have
CMSAzureProject = true.

At runtime though, SettingsHelper.AppSettings["CMSAzureProject"] returns an empty value.

You mentioned however:
It is not visible by default and is only set visible if the related Kentico setting and the Azure Application Setting CMSAzureProject are both set to true.

Both? Would I need to set this in the service definition AND the .config file? (I don't have this value in the .config file based on my interpretation of pp58-60 of the Azure guide)

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 7/24/2013 3:55:26 AM
   
RE:Azure Logo
Hello,

The Kentico setting I mentioned is the same you did in your first post:

CMS Site Manager -> Settings -> Cloud Services -> Show Windows Azure logo

Since you confirmed that it is set to true, and since SettingsHelper.AppSettings["CMSAzureProject"] returns an empty value, the issue seems to be with the Azure settings, not Kentico settings.

It is strange that the value is true in Azure UI, but empty when retrieving it from code. Could you also try retrieving some other settings key, using the same code? For example: CMSAzureAccountName? Do you also receive empty value?

If so, could you test placing the CMSAzureProject key in the web.config and see if you can get it then?


Finally, have you made any changes to the project code files? Could you check that this particular file looks like this?

~\Old_App_Code\CMSModules\WindowsAzure\AzureInit.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using CMS.SettingsProvider;

using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.StorageClient;

/// <summary>
/// Intitializes Windows Azure web role when its running using full IIS.
/// </summary>
public class AzureInit
{
#region "Variables"

private static AzureInit mCurrent = null;
private static object objLock = new object();

#endregion


#region "Properties"

/// <summary>
/// Returns Azure init object.
/// </summary>
public static AzureInit Current
{
get
{
if (mCurrent == null)
{
lock (objLock)
{
if (mCurrent == null)
{
mCurrent = new AzureInit();
}
}
}

return mCurrent;
}
}

#endregion


#region "Methods"

/// <summary>
/// Code executed on application starts.
/// </summary>
public void ApplicationStartInit()
{
AzureHelper.OnGetApplicationSettings += AzureHelper_GetApplicationSettings;

AzureHelper.CurrentInstanceID = RoleEnvironment.CurrentRoleInstance.Id;
AzureHelper.OnRestartRequired += AzureHelper_OnRestartRequired;

// Get path for Temp
LocalResource temp = RoleEnvironment.GetLocalResource("CMSTemp");
AzureHelper.TempPath = temp.RootPath;

// Get path for Cache
LocalResource cache = RoleEnvironment.GetLocalResource("CMSCache");
AzureHelper.CachePath = cache.RootPath;

// Get internal instance endpoints
foreach (var instance in RoleEnvironment.Roles["CMSApp"].Instances)
{
// Current instance id
if (instance.Id == RoleEnvironment.CurrentRoleInstance.Id)
{
// Set current internal endpoint
RoleInstanceEndpoint endpoint = instance.InstanceEndpoints["InternalHttpIn"];
AzureHelper.CurrentInternalEndpoint = "http://" + endpoint.IPEndpoint.ToString();
}
}

// Set Azure deployment
AzureHelper.DeploymentID = RoleEnvironment.DeploymentId;

// Set number of instances
AzureHelper.NumberOfInstances = RoleEnvironment.Roles["CMSApp"].Instances.Count;
}


/// <summary>
/// Code executed on BeginRequest event.
/// </summary>
public void BeginRequestInit()
{
}


/// <summary>
/// Reads settings from service configuration file.
/// </summary>
/// <param name="key">Setting key.</param>
string AzureHelper_GetApplicationSettings(string key)
{
try
{
return RoleEnvironment.GetConfigurationSettingValue(key);
}
catch
{
// Setting key was not found
return null;
}
}


/// <summary>
/// Restarts azure application.
/// </summary>
void AzureHelper_OnRestartRequired(object sender, EventArgs e)
{
RoleEnvironment.RequestRecycle();
}

#endregion
}

User avatar
Member
Member
bryanallott - 7/24/2013 6:36:24 AM
   
RE:Azure Logo
Thanks, Josef
I'll try those suggestions on the next maintenance build- prepping and getting an Azure build takes a bit of time, but I'll be sure to feed back to you as soon as.. probably within the week? Your help is much appreciated!

User avatar
Member
Member
bryanallott - 10/30/2013 3:37:08 AM
   
RE:Azure Logo
Thanks, Josef. It turns out it was as a coding change on AzureInit my side which wasn't being compiled in on the release build configuration. Application a lot more stable with the "out the box" code :)

I appreciate your assistance on this, much obliged!