Invalid data in monthly cost data export

Erik Post 25 Reputation points


Maybe someone here can help me out. I'm generating a monthly cost export via the Export function in Cost Management in Azure Portal. This export generates a CSV containing last month's cost data.

The file is in UTF-8 format, which is good. This can be verified by the fact that the file starts with the U+FEFF character, which is EF BB BF encoded in UTF-8 bytes.

However, this same character (and UTF-8 encoded bytes) is present at the start of the first row of data (ie second line of the file).

This has the effect that the first invoice ID in the file becomes invalid: 11 characters and starting with a for users invisible ZERO WIDTH NON-BREAK SPACE.

Is this a bug in the Cost Export functionality, or is there some setting I need to change? I asked Microsoft Azure Support but they are blaming it on the tooling I'm using to process the CSV.

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
1,196 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 27,606 Reputation points Microsoft Employee

    Hello @Erik Post Thank you for your post and I apologize for the delayed response.

    The characters (ZERO WIDTH NON-BREAK SPACE ) you see at the beginning of the file are BOM characters. Although BOM characters are not required for UTF-8 encoding, the exported CSV files has them to aid interoperability with tools such as Excel etc. This is by design. 

    If you want to get rid of BOM characters, you can open the file in Notepad and save it as UTF-8 only. Notepad supports saving text files in both UTF-8 and UTF-8 with BOM.  Excel requires CSV files to have the BOM character to be able to open it.
    User's image

    Hope this helps. If you have any questions, please write back to us!

    If the response helped, do "Accept Answer" and up-vote it