Permissions error when creating a Deploy Pipeline for my Azure Function

Jorge Lopez 51 Reputation points
2023-07-03T08:25:59.4366667+00:00

Hi,

I'm trying to create a Pipeline to automatically build and deploy my Python Azure Function from Azure Repos Git, but I am getting error when creating the pipeline. I am following these steps:

  1. In Azure DevOps Pipelines tab, click the button to create a New Pipeline
  2. In connect I choose Azure Repos Git
  3. Then I select the Repository
  4. In configure I choose Python Function App to Linux on Azure, then I select the appropriate Azure Subscription, and the Function App name and directory, and click on Validate and configure
  5. But then I get the following error:

error_msg

It seems to be a permissions related error, but I have the Owner role in the Function App IAM, and full permissions on DevOps Pipelines:

Screenshot 2023-07-03 101636

Does anyone know what the problem could be?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2023-07-05T10:56:19.73+00:00

    @Jorge Lopez Thanks for reaching out. The error message you are seeing indicates that the Azure DevOps service principal does not have the necessary permissions to deploy the Azure Function App. Here are a few things you can check to resolve this issue:

    • Verify that the Azure DevOps service principal has the necessary permissions. The service principal needs to have the Contributor role or higher on the Azure subscription that the Function App is deployed to. Make sure that the service principal has been granted this role.
    • Check the scope of the permission. The scope of the permission needs to match the scope of the resource. In this case, the scope is the Azure subscription that the Function App is deployed to. Make sure that the service principal has been granted the Contributor role on this scope.
    • Check the Azure Function App configuration. Make sure that the Function App is configured correctly and that it is accessible from the Azure DevOps pipeline. For example, make sure that the Function App is deployed to the correct region and that it is not behind a firewall or virtual network.
    • Check the Azure DevOps pipeline configuration. Make sure that the pipeline is configured correctly and that it is using the correct service principle. For example, make sure that the service principal has been added to the pipeline's service connections and that the correct service connection is being used in the pipeline.

    Alternatively you can ask any of your administrators to perform the operation and give the necessary permission.


0 additional answers

Sort by: Most helpful

Your answer

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