Hi @Dmytro Dronov ,
Did you see the code sample add the bottom of the article?
The best practice is to store the API key in a key vault and get the API key using the key vault commands.
Other option is to save it as a variable in your code. For the first you will need to manually retrieve it from the API portal.
However, this is regrading to our classic account. The preferred way is to use ARM-based account, using ARM based account will resolve the use of API key. the auth will be in two steps:
az login
get access token
Code sample
Itai