If you use single quotes (') then the shell variables will not be expanded. So at the point where you have '$1 == $id' the shell has not expanded the shell variable "id", and awk has no idea what "id" is.
Unfortunately if you try to use double quotes (") then the shell will expand the "id" variable, but it will have no clue what the $1 should be expanded to.
One solution is to explicitly pass the variable to awk:
The double-quote and single-quote rules work for all shell commands as long as you're using one of the main shell programs such as bash, csh or ksh.
The shell "compiles" your command-line text before starting awk. Among other things, this means expanding globs, substituting shell variables (unless escaped or suppressed, as for example in single-quotes) and executing "backtick" commands. So what awk sees is the results of all this, rather than what you actually typed on the command line.
An IDE is no substitute for an Intelligent Developer.