The problem ended up being terminology. All 3 of the code samples refer to a subscription key not an api key. Since there is no api key on the main Azure settings page for a web search, I used the subscription id. After I found and used one of the api keys on the Manage keys page things are now working fine.