Azure Cloud Service and Persistent Configuration Settings

I'm building a Node.js app to be deployed as an Azure Cloud Service Worker Role.

As a good practice, I like keep all sensitive info (API keys, etc) out of my repos. My usual solution for this is to add sensitive info as environment variables, and have my app access those.

In the (relatively new) Azure Websites, this is easily done through the "app settings" section of the "Configure" tab. Add new settings and grab them in Node.js with process.env.<setting key>. These settings persist across updates and deployments.

In Azure Cloud Services, however, this doesn't seem to be the case. I've added "Configuration Settings" to my ServiceConfiguration.Cloud.cscfg:

<ConfigurationSettings>
  <Setting name="API_KEY_1" value="" />
  <Setting name="API_KEY_2" value="" />
</ConfigurationSettings>

...and my ServiceDefinition.csdef:

<ConfigurationSettings>
  <Setting name="API_KEY_1" />
  <Setting name="API_KEY_2" />
</ConfigurationSettings>

When I deployed, these settings became editable through the web portal, and I added their values.

When I redeploy, however, the settings are overwritten. The only way I can see to keep their appropriate values is to add the values to the .cscfg. But that would mean committing this info into my repo.

Is there a solution I'm missing?

General approach I would use it to put the settings into a storage account and then have a cscfg setting that targets the storage account. On startup, you can read the values out of the storage account and keep them locally in whatever manner you need them.

That aside, if you wish to continue using the cscfg file, you can keep multiple copies of that file and just deploy with the correct version.