Unable to deploy to a Web app with private endpoint

Joost Meijles 1 Reputation point
2022-03-21T13:44:19.02+00:00

I have configured an Azure Web App with a private endpoint and want to deploy to it using Azure DevOps. I have found this possibility using Azure Blob storage and Azure CLI: https://azure.github.io/AppService/2021/03/01/deploying-to-network-secured-sites-2.html

The following Azure CLI webapp deploy command:

az webapp deploy --name $WEBAPP --resource-group $GROUP --type zip --src-url $ZIP_URL --async false
However gives the following Http 403 error: The web app you have attempted to reach has blocked your access.

I am using a service principal to login.

Any clues what I am missing here?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,956 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Joel Neukom 1 Reputation point
    2022-07-21T14:33:41.12+00:00

    Hi

    I had the same problem and opened a Microsoft Support ticket. There is a problem with "az webapp deploy --src-url": It actually doesn't go via ARM API, but directly to the scm endpoint of the web-app (which is blocked due to private endpoints).
    There is a bug open to fix this: https://github.com/Azure/azure-cli/issues/21168

    The solution is now not to use Azure cli command "az webapp deploy", but to call the ARM API directly with something like this:

    az rest --method PUT --uri https://management.azure.com/subscriptions/${SUBSCRIPTIONID}/resourceGroups/${RESOURCEGROUP}/providers/Microsoft.Web/sites/${WEBAPP}/extensions/onedeploy?api-version=2022-03-01 --body '{"properties": {"type": "zip", "packageUri": ${ARTIFACTURL} }}'  
    

    This call will go via ARM and will not be blocked by your Webapp.


  2. Vũ Nguyễn 0 Reputation points
    2023-05-29T08:46:57.59+00:00

    Create Linux VM (Ubuntu 20.04) in the same VNET as web app and use it as a Azure DevOps self-hosted agent.

    https://techcommunity.microsoft.com/t5/apps-on-azure-blog/deploy-app-service-with-private-endpoint-enabled-via-azure/ba-p/3789370

    0 comments No comments