Work 365 supports Azure billing by importing Microsoft reported Azure consumption into a Storage mechanism. If you are using Classing Azure billing (using Dynamics as a storage) this article applies to you.
NOTE: Classic Azure Where the data is stored in CRM is deprecated and will out of support shortly.
There may be times when attempting to delete an Azure invoice in Work 365 get’s stuck due to a Dynamics 365 time out error appearing like this.
or an Offline error message like this
When an Azure invoice is deleted all the Usage Summary records, and all usage detail records for legacy Azure subscriptions, linked to the invoice have to be unlinked and updated as “Active” or billable again. Dynamics has to complete this action within a 2 minute time period or it errors out. Essentially, if there are too many usage summary records which have to be updated but cannot be processed in the 2 minute time period an invoice would fail to delete. Subsequently, any additional attempts at deleting an Azure invoice will results in the same error.
Here are the steps to take to resolve this issue.
- Create an advanced find view looking for Usage Summary.
- Add Status Reason as an additional column to the view
- Save the view
- Go to the invoice which needs to be deleted
- Within the invoice go to Related > Usage Summary
- Change the usage summary view drop down (on the left above the usage data) to the view which was saved from the first step
- On the right side hit the three dots above the Usage Summary table
- Select Export to Excel
- Then select Export usage Summary in Excel online
- Update the Status Reason of the records to Active and delete the invoice lines from the invoice column.
- Updating the status reason from Archived to Active will enable this usage data to be invoice again.
- Deleting the invoice from the invoice column will remove the link between the usage summary records and the invoice itself.
- Hit Save for CRM to automatically update the records. Depending on the number of records being updated, this could take several minutes.
- Select Export to Excel
- Within the invoice go to Related > Usage Summary
- The invoice should show no usage summary records after they have been updated.
- Complete the same steps 1-3 for any usage detail records linked to the invoice (applicable for legacy Azure subscriptions).
- Then in CRM go to Advanced Settings > System Jobs
- Under System Jobs change the view to Cascade Operations
- Select the Cascade Delete job for the item in waiting status. Also make sure the System Job Name selected has Invoice in the name.
- Hit the drop down for More Actions > Select Cancel
- Go back to the invoice record which needs to be deleted. Hit delete.