AppHarbor integration


Cloudinary is a cloud service that offers a solution to a web application's entire image management pipeline. Cloudinary can be used as an add-on to the powerful platform of AppHarbor. This page gives a general overview for AppHarbor users of how to use Cloudinary and how to integrate with the .NET engine provided by AppHarbor.

With Cloudinary you can easily upload images to the cloud. Automatically perform smart image resizing, cropping and conversion without installing any complex software. Integrate Facebook or Twitter profile image extraction in a snap, in any dimension and style to match your website’s graphics requirements. Images are seamlessly delivered through a fast CDN, and much much more. Check out of our Features page for more details.

Cloudinary offers comprehensive APIs and administration capabilities and is easy to integrate with any web application, existing or new. Cloudinary provides URL and HTTP based APIs that can be easily integrated with any Web development framework.

Cloudinary provides an open-source .NET library for simplifying the integration even further.

Sample transformations

Cloudinary provides a variety of transformations to uploaded images - all available simply by modifying the image URL at runtime. For instance, this sample image is automatically available via a CDN at the following URL:

Generating a 150x100 version of the sample image and downloading it through a CDN:

Converting to a 150x100 PNG with rounded corners of 20 pixels:

For plenty more transformation options, see our Image transformations documentation

Generating a 120x90 thumbnail based on automatic face detection of the Facebook profile picture of Bill Clinton:

For more details, see our documentation for embedding Facebook and Twitter profile pictures.

For a more advanced example, take a look at the following Cloudinary URL that generates the image below:

What happened here? Simply accessing the above URL told Cloudinary to remotely fetch Arriana Huffington’s Facebook profile picture, created a 150x150px thumbnail using face detection based cropping, rounded the image’s corners, added a sepia effect, converted it to a transparent PNG format, added a watermark layer on the bottom-left corner, rotated the image by 10 degrees clock-wise and ultimately delivered the resulting image through a fast CDN using smart caching techniques. Isn’t that great?

Note: Replace demo in all examples above with your Cloudinary's cloud name you get after installing the add-on.

Install the add-on

To install the Cloudinary add-on, login to the AppHarbor Web console of your account.

Select the relevant application from the list of Applications on the left menu, click on the Add-ons link from the left menu and select Cloudinary from the list of add-ons.

The following page will be displayed. Select the plan that matches your requirements and click Install.

After the add-on is installed, it is listed in your application's page:

Using with .NET

.NET installation

Download Cloudinary's .NET library from GitHub and add it to your .NET project.

The .NET library is also available as a NuGet package at:

Please see NuGet Documentation at for instructions of how to work with NuGet packages.

Using Visual Studio

  • Download NuGet Package Manager at
  • Use Visual Studio to create a new project and choose .NET 3.5 as the target framework.
  • Right click on the project in Solution Explorer and click on Manage NuGet packages...
  • Type CloudinaryDotNet in the search box at the upper right corner.
  • When CloudinaryDotNet package appears, click on the Install button.
  • After the package is installed click on the Close button.
  • Setup is done and you can now use CloudinaryDotNet.

Manual setup

  • Go to and download NuGet package.
  • NuGet package is a ZIP archive that could be extracted using any unzip tool.
  • NuGet package contains CloudinaryDotNet.dll, xml documentation and the readme file.

Cloudinary's credentials and settings are automatically defined in AppHarbor's platform using CLOUDINARY_URL, which is defined in AppSettings.

You should initialize the Cloudinary class by reading the CLOUDINARY_URL value from AppSettings:

Cloudinary cloudinary = 
  new Cloudinary(ConfigurationManager.AppSettings.Get("CLOUDINARY_URL"));

See our usage notes for your local environment.

.NET configuration

Setting the cloud_name, api_key and api_secret parameters can be done either directly in each call to a Cloudinary method, by when initializing the Cloudinary object, or by using the CLOUDINARY_URL environment variable / system property.

The main entry point of the library is the Cloudinary object.

CloudinaryDotNet.Cloudinary cloudinary = new CloudinaryDotNet.Cloudinary();

NOTE: This call assumes that CLOUDINARY_URL environment variable is set. If not, please use parameterized constructor:

CloudinaryDotNet.Account account =
    new CloudinaryDotNet.Account("my_cloud_name", "my_api_key", "my_api_secret");

CloudinaryDotNet.Cloudinary cloudinary = new CloudinaryDotNet.Cloudinary(account);

.NET upload

Assuming you have your Cloudinary configuration parameters defined (cloud_name, api_key, api_secret), uploading to Cloudinary is very simple.

The following example uploads a local JPG to the cloud:

CloudinaryDotNet.Actions.ImageUploadParams uploadParams = new CloudinaryDotNet.Actions.ImageUploadParams()
    File = new CloudinaryDotNet.Actions.FileDescription(@"c:\mypicture.jpg")

CloudinaryDotNet.Actions.ImageUploadResult uploadResult = cloudinary.Upload(uploadParams);

The uploaded image is assigned a randomly generated public ID. The image is immediately available for download through a CDN:

string url = cloudinary.Api.UrlImgUp.BuildUrl(String.Format("{0}.{1}", uploadResult.PublicId, uploadResult.Format));        

You can also specify your own public ID:

CloudinaryDotNet.Actions.ImageUploadParams uploadParams = new CloudinaryDotNet.Actions.ImageUploadParams()
    File = new CloudinaryDotNet.Actions.FileDescription(@"c:\mypicture.jpg"),
    PublicId = "sample_remote_file"

CloudinaryDotNet.Actions.ImageUploadResult uploadResult = cloudinary.Upload(uploadParams);

string url = cloudinary.Api.UrlImgUp.BuildUrl("sample_remote_file.jpg");      

Embedding and transforming images in .NET

Any image uploaded to Cloudinary can be transformed and embedded using powerful view helper methods:

The following example generates the url for accessing an uploaded sample image while transforming it to fill a 100x150 rectangle:

string url = cloudinary.Api.UrlImgUp.Transform(new CloudinaryDotNet.Transformation().Width(100).Height(150).Crop("fill")).BuildUrl("sample.jpg");

Another example, emedding a smaller version of an uploaded image while generating a 90x90 face detection based thumbnail:

string url = cloudinary.Api.UrlImgUp.Transform(new CloudinaryDotNet.Transformation().Width(90).Height(90).Crop("thumb").Gravity("face")).BuildUrl("woman.jpg");

Embedding a Facebook profile to match your graphic design is very simple. You can provide either a Facebook name or a numeric ID of a Facebook profile or a fan page.

string url = cloudinary.Api.UrlImgUp.Action("facebook").Transform(new CloudinaryDotNet.Transformation().Width(130).Height(130).Crop("fill").Gravity("north_west")).BuildUrl("billclinton.jpg");

Same goes for Twitter:

string url = cloudinary.Api.UrlImgUp.Action("twitter_name").BuildUrl("billclinton.jpg");

imageTag returns an HTML image tag pointing to a Cloudinary URL. For example:

string tag = cloudinary.Api.UrlImgUp.Format("png").Transform(new CloudinaryDotNet.Transformation().Width(100).Height(100).Crop("fill")).BuildImageTag("sample");

// <img src=',h_100,w_100/sample.png' width='100' height='100'/>

Local environment setup

After provisioning the add-on it’s necessary to locally replicate the configuration variables so your development environment can operate against the service.

Login to AppHarbor Web interface and click on the Configuration variables link of the Installed add-ons.

You can view and copy the value with the key of CLOUDINARY_URL in the list of Add-on variables.

You can then set local environment variables using CLOUDINARY_URL=value. Your local application would be configured to use your Cloudinary account.

Management console

The Management Console allows you to browse through uploaded images and generated transformations. You can also view your usage reports and cloud settings. Comprehensive documentation is also available.

The dashboard can be accessed by visiting the AppHarbor Web interface and selecting Cloudinary from the list of Installed add-ons. Then click on 'Go to Cloudinary' in the following page:


All support and runtime issues should be logged with AppHarbor Support at

You can also search Cloudinary's support forums & knowledge base or open a support ticket:

Any non-support related issues or product feedback is welcome at

Additional resources

Additional resources are available at:

Our open-source client libraries can be found at: