I have created an application using java spring boot. I want to deploy it in the azure function app and im deploying it in the azure function app via vs code by using the below commands
- ./mvnw clean package
- ./mvnw azure-functions:deploy
when i run the second command im getting "device code consumer is not configured." error and the build is failing.
Can any one answer my question please.
i tried both the commands by configuring the pom.xml file with the required azure function app details and deployed it in the function app.
2
Answers
To resolve this issue, login to Azure by running the below commands in Terminal:
You can also specify the function to use Azure CLI credential explicitly with below configuration under
azure-functions-maven-plugin
inpom.xml
:Run the function locally using the commands:
pom.xml:
Deploy the function to Azure function app using the command
mvn azure-functions:deploy
:Deployed the function to Azure successfully:
Portal:
Seems the problem is with the authentication to Azure while deploying the code. Before you deploy make sure you login to the Azure subscription using the az cli
az login
you can also refer my articles, it has tested sample code:
https://www.baeldung.com/java-azure-functions
https://www.baeldung.com/spring-cloud-function-microsoft-azure