26 Jan 2017

Deploying Forge ASP.NET samples to Appharbor

Default blog image

Follow for more @augustomaia

Appharbor: Where .NET apps grow and prosper.  That's their slogan, but I like to think them as a "Heroku for ASP.NET". And they are that easy and have a free tier!

This post shows some basic steps on how to deploy a Github code (one of our samples, for instance), but can also be directly connected to another git. The very first step is to create an account. When properly registered, go to "Your applications" on the top menu, then "Create new application".


Next, on getting started, select Github deploy. The next page will show a list of all your repositories. You should select a .NET sample, if you don't have one, fork one of our ASP.NET samples.


Finally, we need to setup the Forge Client ID & Secret (assuming you already have a Forge Developer account with an app created). Go to "Configuration variables" section, then click on "New configuration variable" and add both FORGE_CLIENT_ID and FORGE_CLIENT_SECRET values. The image below show how it should look like when both variables are created.


Many of our samples will handle with upload of files, which needs to be uploaded to the app server (in this case, Appharbor) before the app can upload again to Autodesk servers. For that, go to "Settings" section and "Enable File System Write Access". Best practice is to upload files to /App_Data folder. Note: an app should not allow end-user to upload directly to Autodesk as this requires an access token with write capabilities, and if the end-user have such a token, this is a security breach. 


As a result, under your Github account settings, you should see Appharbor as an "Authorized application".


That's it. Now when you commit changes to the repository the Appharbor app will deploy and rebuild.

Related Article