Azure Resource Manager Template Language - resourceId(): Unable to evaluate template language function 'resource Id'
I stumbled upon the solution in a completely unrelated article, but you should be passing
[resourceId('Microsoft.SQL/servers/databases', parameters('sqlServerName'), 'TestDB')]