Charge back Function app has three Functions:
- build-db
- get-tags-timer
- get-tags-http
Upon HTTP call to build-db function, with Query parameter Action set to "build", this function will connect to the SQL Managed instance that you want to use, use the SQL files to create usage_history database, the tables, stored procedures and views.
Based on cron setting, this function runs constantly and will query the SQL Managed Instance environment in Azure, gather tags for each DB in SQL MI, and execute a SQL Proceduer in the usage_history db to save data into dbo.environment_info table.
Will query the SQL Managed Instance environment in Azure, gather tags for each DB in SQL MI, and execute a SQL Proceduer in the usage_history db to save data into dbo.environment_info table.
If the SQL User supplied has ability to, this command will truncate the dbo.environment_info table. This is meant to clear the table to gather new tags.
- build-db further development
- keeping history of tags