From the running instance, you can indicate whether you are in the production / production stage from the host URL for the web role. If you see your deployment ID, this will be the stage. However, this can be tricky if you are using CNAME or using a worker role. There is little you can do for the subscription id, as it is a pre-cursor to everything. You can't even use the Mgmt API if you don’t know your SubID (I don’t know how to get a subscription identifier other than the portal).
The management API seems to be your best bet (and only bid in some cases).
source share