It is simple way to use below SQL query to extract Azure SQL Database usage metrics.
SELECT DB_NAME() as DatabaseName,
(max_size/128.0) / 1024 AS DBMaxSizeInGB ,
(size/128.0) / 1024 AS DBAllocatedSpaceInGB ,
(CAST(FILEPROPERTY(name, 'SpaceUsed') AS bigint) * 8192.) / 1024 / 1024 / 1024 AS DBUsedSpaceInGB,
(size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0)/ 1024 AS FreeSpaceInGB ,
Getdate() as Created_Date
FROM sys.database_files
WHERE name in ('data_0' ) and DB_NAME() = 'MyDatabase';