Kenny_I
Kenny_I

Reputation: 2503

How to deploy code from Visual Studio Code to Azure Function App in private endpoint and VNet?

I have Azure Function Premium (Python) with private network and Vnet in Azure.

I cannot currently deploy to Azure with Visual Studio Code from workstation.

11.09.57 func-App-2-171221: Starting deployment...
11.09.57 func-App-2-171221: Creating zip package...
11.09.57 func-App-2-171221: Zip package size: 10 kB
11.09.58: Error:  Error 403 - Forbidden
The web app you have attempted to reach has blocked your access.

What is easiest way to build access to network access from my laptop to Function app?

Upvotes: 1

Views: 2251

Answers (2)

shivappa
shivappa

Reputation: 153

  1. Create a zip of your function app which must contain all the files. For example in python the zip file should contain
  • host.json
  • local.settings.json
  • requirements.txt
  • your api folder
  • .python_packages
  1. Upload this zip file to storage account's container of which your function app is using.
  2. Create a SAS token for this blob. (make sure the blob is private)
  3. Copy the blob URL.
  4. Go to Function app -> configuration and add new application settings.
    key is WEBSITE_RUN_FROM_PACKAGE and value is <blob SAS URL you copied>.
  5. Save and restart your function app.

Upvotes: 2

SaiSakethGuduru
SaiSakethGuduru

Reputation: 2440

This sample shows how Azure Functions can connect to other Azure resources via a private endpoint connection. The sample uses an Azure Functions Premium plan with regional VNet Integration to interact with Azure resources confined to a virtual network.

Below is the sample code for deploying the azure function code.

func azure functionapp publish [YOUR-FUNCTION-APP-NAME]

For complete information check the Private end points document.

Upvotes: 0

Related Questions