Failed to execute goal com.microsoft.azure:azure-functions-maven-plugin:1.8.0:deploy (default-cli) on project azure-function-examples: Cannot auth to azure: Failed to authenticate with Azure

Swapnil Narvekar 0 Reputation points
2024-02-20T08:28:35.44+00:00

Hello All, I am unable to deploy the simple Azure function on Azure Cloud because of following stack trace - User's image I am using following properties -

<properties>    
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>    <java.version>1.8</java.version>    <azure.functions.maven.plugin.version>1.8.0</azure.functions.maven.plugin.version>    

<azure.functions.java.library.version>2.0.1</azure.functions.java.library.version>    
<functionAppName>azure-function-examples-1708411605501</functionAppName></properties>

and this is the setting I have - User's image

Can anyone please let me know where I am making a mistake. I am stuck here.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,446 Reputation points Moderator
    2024-02-28T14:32:53.5666667+00:00

    Swapnil Narvekar Thanks for posting your question in Microsoft Q&A. From the description above, it seems like you are using version **azure-functions-maven-plugin-1.8.0 **in your function app and got error: "Failed to authenticate with Azure. Please check your configuration".

    Here are few things you can validate:

    1. Update to latest version azure-functions-maven-plugin-1.14.0 to avoid compatibility with Azure CLI version and try again.
    2. Validate files such as azureProfile.json` and accessTokens.json exists. If not, make sure you have Azure CLI installed (latest version) and login via az login command (similar issue). Otherwise, you will get the above error message.

    Also, you need to have the identity has access (Contributor role) to the subscription. After following the above steps, and if it doesn't help, then open start a new issue with https://github.com/microsoft/azure-maven-plugins/issues and experts from repo can assist you with the issue (similar discussion).

    I hope this helps and let me know if any questions.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.