Storefront

Citrix Storefront – Adventures in customization – Add a help button to your Storefront UI

2017-12-27
/ /
in Blog
/

This customization is pretty easy.  Add the following to your custom.js file:

Replace “http://www.google.ca” with the URL you want your help screen to be.

Read More

Citrix Storefront – Adventures in customization – Default to “Store” view if you have no favourited app’s

2017-12-22
/ /
in Blog
/

We are in the process of migrating users from Web Interface to Storefront.  We have identified a potential issue; new users are directed to the “Favourites” view which doesn’t have any applications be default, instead it has instructions on how to add apps to the favourites view.

New users might say, “Where did my apps go?!”

The concern is users may become confused because Web Interface shows all your applications, and this new view shows none.  What we want to do to solve this is default to the “Store” view if you have no favourite apps, and default to the favourites view if you have at least 1 app favourite.

 

We can do this.

 

Just add the code above to your custom.js file and the default view will be changed to the store if you have no favorited apps.  Done!

Read More

Citrix Storefront – Adventures in customization – Define a custom resolution for a specific application

2017-11-14
/ /
in Blog
/

Currently, Storefront does not grant the ability to define applications with specific resolutions.  In order to configure the resolution, Citrix recommends you modify the default.ica file.  This is terrible!  If you had specific applications that required specific resolutions, what are you to do?  Direct users to a variety of stores depending on the resolution required?!

Fortunately, again, we can extend StoreFront to make it so we can configure custom resolutions for different applications on the same store.  The solution is a Storefront extension I’ve already written.

The steps to set this up:

  1. Download the Storefront_CustomizationLaunch.dll.
  2. Copy the file to C:\inetpub\wwwroot\Citrix\Store\bin
  3. Edit the web.config in the Store directory and enable the extension
  4. We need to enable Header pass-through for DesiredHRES, DesiredVRES, and TWIMode in the “C:\inetpub\wwwroot\Citrix\StoreWeb\web.config” file:
  5. Lastly, add the following to the custom.js file in your StoreWeb/custom folder:
  6. And enjoy the results!  🙂

Read More

Citrix Storefront – Adventures in customization – Prepopulate Explicit Logon Credentials

2017-10-31
/ /
in Blog
/

Citrix Storefront allows you to prepopulate the credentials for your Explicit Logon.  The explicit logon screen is generally seen here:

And you can prepopulate the Username/Password fields.  If you don’t want to prepopulate the password, that’s fine too.  There are 3 properties and none are required.  Username, Password and Domain.  In order to prepopulate you must pass your credentials through to Storefront somehow, either as a cookie, header or as a URL search query.  I will demo it in the URL search query since I already have that code for pulling the parameters.  You must have “Explicit Authentication” enabled, aka, “User name and Password”:

Put the following code into your custom.js file:

The url to query is:

And the result:

Read More

Citrix Storefront – Adventures in customization – Login via credentials in URL search query

2017-10-30
/ /
in Blog
/

If you use a 3rd party service to connect to your Citrix Storefront environment, you may want to “pass-through” credentials without using domain authentication or whatever.  This post illustrates how you can login to your Storefront environment using nothing more than a URL with your credentials embedded in them.  To enable this functionality, this code must be in your custom.js file.

You MUST have HTTP Basic enabled as an authentication method on your Citrix Storefront Store.

The URL to login would look like this:

Put it all together:

Read More

Citrix Storefront – Adventures in customization – Change any ICA parameter

2017-07-31
/ /
in Blog
/

When I was originally exploring using the Citrix SDK to manipulate some ICA parameters, I found I couldn’t do it.  Using Powershell and passing a header parameter I could manipulate the ICA file to how I wanted, but when I attempted to do so with Internet Explorer, I found it wasn’t passing the header parameter.  I assumed this was because of how browsers were launching the ICA file.  However, I attempted to use Sam Jacob’s Citrix Storefront clientname manipulation extension, I discovered I had the same problem.  I originally thought I was doing something wrong, but on a whim I tried Chrome and it worked…  Perfectly!

When I investigated further I found it appears that when Storefront detects IE it doesn’t use the GetLaunchStatus API, which passes the headers to Storefront for ICA manipulation.  I found a way to fix this was the add the IE detection to the script.js and add the missing call to the GetLaunchStatus API.

But now that I have headers being passed properly, I thought I should revisit my ICA parameter manipulation.  Sam’s customization works great for manipulating the client name, but we have a few applications with various different requirements:

  1. Pass parameters to some specific applications
  2. Modify clientname based on the specific application that is launched

Can we replace Sam’s customization with one that can manipulate any ICA parameter we so choose?

Yes.  Yes we can.  Storefront is very nice, flexible and powerful 🙂

I’ve designed this customization to look for an additional app setting tag.  This needs to be added to the web.config at the “”C:\inetpub\wwwroot\Citrix\Store\web.config”” level:

Any parameter you want passed through needs to be enabled as a forwarded header in the “”C:\inetpub\wwwroot\Citrix\StoreWeb\web.config”” file:

 

Lastly, you need to edit your \custom\script.js file to include your application and whatever parameters you want passed to it:

One of the cool things about this is you can still use tags to change the behaviour of these applications.  For instance, if you want a certain subset of your applications to be 8bit you can do set check for that tag on app launch and add the header to set the desired color.  You can set certain applications to keep their ICA file by setting “RemoveICAFile” to Off.  You can individually modify any setting for a specific application or subset of applications.

Here is the StoreCustomization_Launch.dll and source code.

Here is the source code for prosperity:

 

 

Read More

Citrix Storefront – Adventures in customization – Customization breaks in internet explorer

2017-07-14
/ /
in Blog
/

I ran into a frustrating issue with my last post (changing the clientname based on the application).  The issue was, it wasn’t working!  Sometimes!  On some versions of IE!  On some Operating Systems!

WTF.

On Windows 10, IE11 or Edge it worked fine.  On Windows 7 or Server 2008 R2 with IE11 it worked…  SOMETIMES.

I started to dig into what was happening.  Why wasn’t the ClientName being set consistently?

It turns out that the code path for the “StoreFront Customization SDK” (at least the ICA file modification portion) operates when a request is made to “GetLaunchStatus”.  A working application launch from StoreFront looks like this:

Notice when I click the application icon, TWO requests are made.  The first one, GetLaunchStatus contains the headers that is passed to the SDK customization plugin, the second is a hidden iFrame to pull the ICA file.

Now, if I login to a server or PC that I’ve never logged into before (so that I have a fresh profile) and launch IE and immediately go to Storefront, this is the result:

Notice it only goes to “LaunchIca”.  Because of this my ClientName is not modified.

To validate the theory a bit further that something in Storefront maybe causing my issue, I opened up Chrome and changed it’s UserAgent to be identical of IE11 on Server 2008 R2:

And what happened?

Only LaunchIca is called.  We have a reproducible failure.

As I was digging into the Citrix code to launch the “GetLaunchStatus” URL I found it would “skip” going to URL under a series of conditions, one of them relates to checking for the presence of IE (CTXS.Device.isIE).  I found two candidate functions that maybe causing this failure, and I think this one is the most likely:

Specifically, this line under the switch statement:

CTXS.Device.isIE() && CTXS.ClientManager.usingNativeClientInInternetZone() ? (g(a, CTXS.LAUNCH_SUCCESS), g(a, CTXS.LAUNCH_READY), a.isLaunchReady = !0) : (CTXS.ClientManager.getLaunchMethod() == CTXS.LaunchMethod.PROTOCOL_HANDLER && (e.ticket = f.fileFetchTicket, e.staTicket = f.fileFetchStaTicket, e.fileFetchUrl = f.fileFetchUrl, e.serverProtocolVersion = f.serverProtocolVersion), d(a, c, e));

I found if I modified the UserAgent at that exact point so CTXS.Device.isIE() did not return TRUE that it would execute the GetLaunchStatus.

Now that I suspect I have my culprit I examined the code that calls GetLaunchStatus URL and added it to my custom.js file:

The end result now looks like this:

And now my customizations are called correctly and work with IE11.  I haven’t done extensive testing so “your mileage may vary” with this fix, but if you are finding your customizations aren’t operating correctly you may want to try this fix.

 

Read More

Citrix Storefront – Adventures in customization – Assign a custom clientname to an application

2017-07-13
/ /
in Blog
/

I have set a personal goal to avoid creating more than a single store for Storefront.  With that, I’ve been working on customizing Storefront for our organization and occasionally a problem comes up that requires a unwieldy solution…  Like creating multiple stores.

An example of this is we have an application that configures itself based on the CLIENTNAME variable.  The current solution for  this problem is to provide ICA files with CLIENTNAME preconfigured.  The application is launched, detects the client name variable then displays the relevant data.

Really, this is a pretty terrible way for the app to configure itself.

You would hope the application would have been coded to accept a switch or something for configuring it and then just publish out the application(s) instead.

But, I’m not the developer of this application and have to come up with a solution that works within this framework.  The initial thought was we can enable ‘overrideicaclientname’ and then modify the default.ica files with the hard coded client name.  Then we’d create as many stores as is required to support the different configurations…  Then direct users to the different URL based on their needed configuration…

If this is starting to sound ugly, it’s because it is.

Citrix provides some guidance for manipulating the CLIENTNAME.  Unfortunately, the manipulation of the CLIENTNAME in the example would not be sufficient.  We need to configure it to be a specific string and all the examples within are dynamically generated.

Fortunately, Citrix CTP Sam Jacobs has come to the rescue and extended the work of Simon Frost. Sam’s addition was to accept a custom HEADER and configure the CLIENTNAME on that value.  This sounds perfect.  I think I can configure a custom header during the launch of a specific application, and StoreFront will take that name, configure the CLIENTNAME and voila!

So how would you do this?  Jason Samuel goes over the configuration of the necessary steps (it’s in both Sam and Simon’s posts as well, but I found Jason’s post more clean and clear).  The exception is (step 6 in Jason’s post) the clientNameRewriteRule needs to be set with the custom header we are going to look for.

My instructions are:

  1. Edit “C:\inetpub\wwwroot\Citrix\Store\web.config” (note: this is the “STORE” web.config and not the STOREWEB)
    Configure a section “appSettings” to be like so:

  2. Find the “overrideIcaClientName” and ensure it’s set to “on”:

  3. Edit “C:\inetpub\wwwroot\Citrix\StoreWeb\web.config”  (note: this is the “STOREWEB” web.config)
    Add a ‘forwardedHeaders’ section under “communication”

  4. Edit the “C:\inetpub\wwwroot\Citrix\StoreWeb\custom\script.js” file and add the following:
  5. Download Sam’s “StoreCustomization_Input.dll” from here and overwrite the placeholder located here:
    “C:\inetpub\wwwroot\Citrix\Store\bin”

And?  Did it work?!

Look at that!  It works!  Splendid!

And now I can configure ClientName based on the application that is launched!  So now we do not need to create multiple stores, we can keep this to a single store and it’s more dynamic and cleaner (IMHO).  The only caveat is upgrading Storefront these steps may need to be done again as the web.config files may be cleaned or reset.

UDPATE! I found that customizations were being inconsistently applied!  Check this post for further details and a possible fix!

Read More

Citrix Storefront – Performance Testing and Tuning – Part 6 – Testing Peak Load

2017-06-13
/ /
in Blog
/

In part 5 I figured out our peak load against our existing infrastructure.  In this part I’m going to test against a Storefront server to see if it can handle the baseline load.

This is the counters used for PNA launches:

The loads to test are:

Peak Rates (in per second)
PNA Logon PNA App Launches Web Logon Web LaunchICA Connections per second
7.531 17.94 1.02 1.78 28.271

I am going to use WCAT to test PNA as WCAT is fairly easy to configure.  From the counters we can easily target “ICA Launches Calls / second” and “Find all resources Calls / second” (and divide by ~2.5) to get to our PNA load count.

Now, I can test the PNA portion with WCAT, which is good because it can maintain a nice, steady rate.  Web Logon’s and launches though, require a PowerShell script because of some cookie manipulation.

Testing a single Web Interface server, I tested just PNA app launches (20 per second) and our Web Interface server was unable to maintain that rate.  The maxmium number a single Web Interface server (4vCPU 12GB RAM) was ~15 application launches per second.  At that point my Powershell script was getting errors during its requests.

Since we load balance we could sustain ~30 PNA app launches per second with Web Interface.  How does Storefront do?  Can a single server maintain our peak load?

 


Ok, first off, I have to say I love it when the math adds up.

I was hoping for an average of 8 PNA app launches (ICA Launch Calls / second) and I got 8.6, and I was hoping for ~19 “Find All resources Calls / second” and I got 17.7.  So I believe I’m pretty close to simulating my real peak load traffic.

So we can see the load testing definitely put an impact on Storefront server.  We had some peaks, which varied between requesting icons and requesting the ICA file.  Getting the Config.xml file didn’t move the needle neither did find PRELAUNCH applications.  I’m not entirely sure why we have some spikes but overall I think I’m pretty satisfied with this performance.

When does Storefront break (in my environment)?

I set WCAT to do 1000 connections. At 32 connections per second my response time was starting to increase dramatically.  This was with a 4vCPU system.

Monitoring my XML brokers showed they were not breaking a sweat.  So the bottle neck has to be Storefront.  Looking at my CPU graphs showed this to be a CPU bottle neck.

So what happens if I up the vCPU to 8?  When does the bottleneck push to the brokers or no longer become the CPU?

 

At 8vCPU StoreFront scaled nearly linearly.  At 32 connections per second It was handling requests at around 7 seconds.  At 38 connections per second though, it was starting to choke, going at about 10 seconds per request.

 

And this is the last up I can do.  I moved the StoreFront up to 16 vCPU with a whole host for itself to prevent CPU oversubscription.

This configuration enabled us to handle 64 connections per second before consistently breaking the 10 second limit.

 

 

If we set a target of a “fail” when the response time exceeds 10 seconds this is what my maximum number of requests can be per vCPU:

So Storefront seems to scale pretty well with CPU, with the biggest gain going from 4vCPU to 8vCPU.  At 4vCPU a single StoreFront server should be able to handle our entire peak load, albeit barely.  At 8vCPU a single server should have more than enough capacity to handle almost double our peak loading.

Read More

Citrix Storefront – Performance Testing and Tuning – Part 5 – Establishing a Peak Load

2017-06-06
/ /
in Blog
/

In part 1 I setup a script to load test our Citrix Storefront server, as a user logging in through the website.  Part 2 was users connecting via PNA.  In this part I’m going to examine our existing load.  In order to do so, I only want to count the following users:

  1. Users must have logged into Web Interface.  This ensures that we count users who have actually logged in to launch an application.  Some of our users may have the Web Interface set as their homepage so this way we can avoid idle user counts.
  2. Users who have launched an application.  I’m interested in the users who have actually launched an application via Web Interface.
  3. PNA connections
  4. PNA launches

I want to get these user counts sorted via time in order to determine our peak load.

To get these counts I decided to key into some unique web URL’s or resources.  For #1, I decided to search the IIS logs for the “Logoff.png”.

This icon will only be pulled down for a user who has logged into the Web Interface.

For #2, I decided to look at the IIS logs and search for “launch.ica”.  This will get us the application launches via the sites.

For #3, I decided to look at the IIS logs and search for “config.xml”.  This file is pulled each time PNA is launched or a user logs onto the machine.

For #4, I decided to look at the IIS logs and search for “launch.aspx”.

Users must have logged into Web Interface.

For #1 I created a powershell script to parse the IIS log file and export my data:

I then opened it in Excel and created time ranges per-hour and then counted how many of each item was found in that range.  For the Logoff.PNG it was accessed like this:

The peak count was 2775 logons over a course of an hour.  This equals ~45 logons per minute or 1 logon every 1.29 seconds.

In order to get even more precise, I broke down the hour that had the 2775 logons and looked at how many logons occurred over 15 minute time spans.

The peak rate over a 15 min span was:

1 logon every 0.974 second. (1.02 logons per second)


Users who have launched an application

 

For users who launch an application we are at 7593 launches as a peak over an hour.

The peak access to Web Interface is 2.10 launches per second.

If we do a failover strategy to ensure , say in the future, we unified our architecture to a single location (or single cloud?) what would our combined rate be?

1 launch every 0.561 second. (1.78 launches per second)

Citrix has Storefront guidance that says it can handle connections/users in the ten’s of thousands.  I thought we were a large organization, but apparently Storefront has been designed for something even bigger! (Or web-based front ends are rarely the bottle neck…)

So these numbers are purely for logons through the web site.  But previous testing for PNA functionality showed that it’s a *much* heavier traffic to Web Interface.  Why is the traffic heavier for PNA?  Because each time a user logs on to a workstation it kicks in.  Whereas accessing the web interface requires some work the user must do, PNA is automatic.  It’s also more convenient for users as they prefer to launch desktop/start menu icons.


PNA connections

How am I going to determine our concurrent connection rate for PNA?  This is what a PNA connection looks like:

What I’m going to do is query the IIS logs for ‘config.xml‘, as that file gets called only once when Receiver is launched or upon login.  Once I get that I can search for ‘enum.aspx’ command that has been called and divide by the number of config.xml’s.  This should get me the number of icon requests per user.

After doing the math I found Receiver makes 2.63 enum.aspx request for every config.xml requests.

Lastly,

My thought process here is once we get our peak ‘Receiver’ connection rate to the Storefront server we can create another script to simulate it.  I know WCAT can do this as no funny cookie business occurs for Receiver.

So what does the PNA Receiver numbers look like?

We have a peak PNA connection rate of 7.531 config.xml connections per second.  Multiplying by the additional 2.63 enum.aspx requests give us a total of 19.806 connections per second for a peak rate.

For PNA application launches, our peak rate is 30,075 launches in a single hour.  This was measured by parsing for “launch.aspx”.  Breaking this hour down to 15 minute intervals and a single 15min window contained 53% of the launches.  For our peak 15 minute window this is 16148 launches.  This gives us a total of 17.94 application launches per second.

Peak Rates (in per second)
PNA Logons PNA App Launches Web Logons Web LaunchICA Connections per second
7.531 17.94 1.02 1.78 28.271

 

 

Read More
Page 1 of 3123