Developing Apps within an Organization

Last Updated: 27 February 2015

Table of Contents

Developing and deploying applications within an organization account is largely the same experience as doing so in your personal account. Git-based deploys, command line scaling, add-ons etc… are all the same. However, just as with account administration, there are a few additions to the experience you should be aware of when working within an org.

This feature is currently available in Heroku Enterprise

Joining an org

Org accounts centralize the management of users and roles. If you wish to join an org, an admin user must add you directly.

Once you have been added to an org you will be able to see the list of apps included in that org using the CLI. Use the familiar heroku list command, but now include the --org flag to specify which apps to show, and the -all flag to list all org apps.

$ heroku apps --org acme-widgets --all
=== Apps joined in organization acme-widgets

=== Apps available to join in organization acme-widgets

You can also pick an org in the dashboard to view its applications. All orgs that you have some role in, are displayed in the sidebar:

Developing apps

As an admin or member user in an org you have the ability to access all applications in the org. However, most development groups are working on several projects simultaneously while each individual developer is only working on one or two projects simultaneously. Within an org account you indicate the apps you’re working on right now by “joining” them.

Joining apps

Most of the Dashboard and CLI views automatically filter to the apps you’ve explicitly joined, so as not to overwhelm you with apps that may be part of your org but are not ones you’re directly involved with.

To join an app so you can begin developing against it use the heroku join command.

$ heroku join --app acme-website
Joining application acme-website... done

Once an app is joined, it will be in your list of org apps.

$ heroku apps --org acme-widgets
=== Apps joined in organization acme-widgets

You can also join an app from the dashboard. After you pick an org from the sidebar, all the apps you have currently joined are listed in the top section of the list of apps. The bottom section shows the rest of the organization’s applications (“Unjoined apps”). To join an app, click on the app that you wish to work on:

Leaving an app

Once you are no longer working with an application on a regular basis, you can leave the app. This will remove it from your list of joined apps, though you can always rejoin it yourself at a later time.

From the CLI, use the leave command.

$ heroku leave --app acme-website
Leaving application acme-website... done

Or, in the org dashboard, go to the Access tab of the app and remove yourself from the list of members.

Adding apps to an org

If you have existing apps you’ve been developing under your personal account, you will need to transfer them to your org in order for them to be consider a part of the org and billed against the org.

You can use the CLI to transfer apps to your org (where acme-widgets is your org name and deep-spring-4274 is the app):

$ heroku sharing:transfer acme-widgets --app deep-spring-4274
Transferring deep-spring-4274 to acme-widgets... done

You can also use the Dashboard to drag-and-drop personal apps.

Apps can also be created directly in the org:

$ heroku create --org acme-widgets
Creating frozen-wave-4030 in organization acme-inc...done, stack is cedar-14 |
Git remote heroku added

Default org

The Heroku CLI defaults to your personal account and requires the --org flag when performing org actions. If you generally work under an organization, you can set the HEROKU_ORGANIZATION environment variable in order to default to that organization.

$ export HEROKU_ORGANIZATION=acme-widgets
$ heroku apps
=== Apps joined in organization acme-widgets

This won’t persist when you open a new shell, however. For that you can add this setting to your profile file. For Unix machines using bash, this will likely be ~/.bashrc. For Windows you can set environment variables on the Advanced tab of System in Control Panel.

Next steps

This guide gives you a high-level overview of developing applications within an organization account. To learn how to manage an org as an administrator more see one of the articles on creating and managing an org or managing org users and app access.