You could make an HTTP request to the action's route URL from the worker role.
using (var httpClinet = new HttpClient())
{
var result = httpClient.DownloadString("http://www.site.com/path/to/action");
}
Update
...how I can get the current url inside worker role? Because the url would change depending on where it is being deployed...
One way would be to store the variable URL segments in your worker role's ConfigurationSettings
.
<Role name="My.WorkerRole">
...
<ConfigurationSettings>
<Setting name="UrlScheme" value="https" />
<Setting name="UrlHost" value="www.site.com" />
<Setting name="UrlPath" value="path/to/action?param1=value1" />
</ConfigurationSettings>
...
</Role>
using (var httpClinet = new HttpClient())
{
var url = string.Format("{0}://{1}/{2}",
RoleEnvironment.GetConfigurationSettingValue("UrlScheme"),
RoleEnvironment.GetConfigurationSettingValue("UrlHost"),
RoleEnvironment.GetConfigurationSettingValue("UrlPath"));
var result = httpClient.DownloadString(url);
}
You can then change the values in your ServiceConfiguration.Cloud.cscfg
file before deploying.