finops-toolkit icon indicating copy to clipboard operation
finops-toolkit copied to clipboard

Template deployment error when upgrading existing hubs instance to 0.4

Open helderpinto opened this issue 1 year ago • 5 comments

🐛 Problem

I tried deploying 0.4 as a new instance and it went well. Connected new CostSummary PBI to it and all seems fine. However, when trying to upgrade 0.3, by deploying the newest 0.4 template on top of it, I am getting the following deployment error, associated with the uploadSettings deployment script:

System.Management.Automation.RuntimeException: The property 'days' cannot be found on this object. Verify that the property exists and can be set.

👣 Repro steps

Deploy the newest hubs template by following the "Deploy to Azure" button available here and choose an existing resource group and existing hubs name on top of which you deploy the hubs template. The existing hubs instance must be version 0.2 or 0.3.

🤔 Expected

A successful deployment and working hubs instance after the upgrade.

helderpinto avatar Jul 15 '24 07:07 helderpinto

I am still getting "System.Management.Automation.RuntimeException: The property 'days' cannot be found on this object. Verify that the property exists and can be set." error while trying to upgrade from 0.3 to 0.4

AmanuelAZ avatar Jul 16 '24 16:07 AmanuelAZ

@AmanuelAZ, the fix was not published to the main branch yet. We mistakenly closed this issue. I am reopening it. Thanks for letting us know.

@arthurclares, when is this fix expected to merge into main? If we can't publish a new release in the upcoming days, I can share the (very complex) work-around steps here.

helderpinto avatar Jul 16 '24 17:07 helderpinto

@AmanuelAZ, there is actually a simpler work-around, if you need to upgrade to 0.4 before the fix is released. You just need to edit the config/settings.json blob in the hubs Storage account (it's as easy as navigating into the config container and edit the blob) and make sure it has a retention block, as follows;

{
  "$schema": "https://aka.ms/finops/hubs/settings-schema",
  "type": "HubInstance",
  "version": "0.3",
  "learnMore": "https://aka.ms/finops/hubs",
  "scopes": {
    "scope": ""
  },
  "retention": {
    "msexports": {
      "days": 0
    },
    "ingestion": {
      "months": 13
    }
  }
}

You don't need to replace the other JSON properties. Just add the retention block and save the blob. After that, redeploying the v0.4 template should work as expected.

helderpinto avatar Jul 16 '24 21:07 helderpinto

@helderpinto, thank you for the quick response. I applied the fix, and it resolved the issue for me.

AmanuelAZ avatar Jul 17 '24 05:07 AmanuelAZ

Hello, the solution that gave @helderpinto works for me , Muchas Gracias !!

vrondan1983 avatar Aug 01 '24 20:08 vrondan1983