optscale icon indicating copy to clipboard operation
optscale copied to clipboard

Azure Enterprise Agreement

Open jakelima18 opened this issue 1 year ago • 5 comments

Optscale can't read data billing from subscription Azure Enterprise Agreement. I'm suspicious that the Azure Enterprise Agreement subscription api is another API.

jakelima18 avatar Jun 21 '23 02:06 jakelima18

Hi! Azure EA subscriptions don't provide expenses data in usual way, so you need to connect such accounts with import_scheme: "raw_usage" parameter.

You can refer to https://github.com/hystax/optscale/blob/be70d943019d88a5c4ae778765a74ef66e6dca7d/diworker/diworker/importers/azure.py#LL139C2-L139C2 for the details.

maxb-hystax avatar Jun 21 '23 06:06 maxb-hystax

But how do I load this information since the console does not appear to change the schema option. It would be through https://github.com/hystax/optscale/blob/integration/optscale-deploy/overlay/user_template.yml

jakelima18 avatar Jun 21 '23 13:06 jakelima18

It should be set when calling cloud account creation or patch API. Further version which we plan to publish includes autodetection of necessary import scheme, but for now it is a manual change.

maxb-hystax avatar Jun 21 '23 13:06 maxb-hystax

by the opensource version it is not possible to make this schema configuration. Do you have any documentation of doing this creation via API?

jakelima18 avatar Jun 21 '23 17:06 jakelima18

Any documentation about how use the API?

jakelima18 avatar Jun 21 '23 23:06 jakelima18

You can update your existing cloud account configuration with the correct import scheme by calling PATCH <optscale_ip>/restapi/v2/cloud_accounts/<cloud_account_id> with body:

{
   "config":{
      "client_id":"<client (app) id>",
      "tenant":"<tenant>",
      "subscription_id":"<subscription_id>",
      "secret":"<secret>",
      "expense_import_scheme":"raw_usage"
   }
}

or disconnect the old cloud account and create the new one: POST <optscale_ip>/restapi/v2/organizations/<organization_id>/cloud_accounts

{
  "name": "<your cloud name>",
  "type": "azure_cnr",
  "config": {
      "client_id":"<client (app) id>",
      "tenant":"<tenant>",
      "subscription_id":"<subscription_id>",
      "secret":"<secret>",
      "expense_import_scheme":"raw_usage"
  }
}

nk-hystax avatar Sep 02 '24 12:09 nk-hystax