Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Read Only mode in Azure Function App?

I create a new Function App (v2) from Azure portal. Then I initiate a new app on my local computer with help of Azure Functions Core Tools v2.3, and publish it to my new app on portal:

func init
func new
func azure functionapp publish my-app-name

This puts my app in Read Only mode. But I need to be able to change the app from portal, because I need to create proxies (Core Tools isn't able to create proxies, please correct me if I'm wrong). How can I disable the Read only mode?

Following is content of my local.settings.json:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "AzureWebJobsStorage": "{AzureWebJobsStorage}"
  }
}

FYI, I'm developing on macOS High Sierra.

like image 794
Mahdi Avatar asked Dec 05 '18 11:12

Mahdi


People also ask

How do I turn off read only mode in Azure app?

In the Azure portal, refresh your function application and run it now from the code+Test menu. Step 2: Go to Azure Portal > Your Function App > Configuration (in the left index pane) > in the Application Setting, change the value of WEBSITE RUN FROM PACKAGE to 0 and click Ok and Save.

How do I edit an azure function?

The Azure Portal allows you to create and edit Functions and their source code via an online editor. For a short test go to the portal, click the "New" button and search for "Function App". Click through the wizard to create a new Function App. Open the app when it's created and add a new function.

How do I disable Azure function?

The recommended way to disable a function is with an app setting in the format AzureWebJobs. <FUNCTION_NAME>. Disabled set to true . You can create and modify this application setting in a number of ways, including by using the Azure CLI and from your function's Overview tab in the Azure portal.

Where is Website_run_from_package app setting?

In your function app, select Configurations under Settings. Enter the value WEBSITE_RUN_FROM_PACKAGE for the Name, and paste the URL of your package in Blob Storage as the Value. Select OK. Then select Save > Continue to save the setting and restart the app.


1 Answers

Part 1 - Disabling read-only mode

You'll likely find if you're using the latest tools that your function app is in run-from-package mode, which means it's reading the files directly from the uploaded ZIP and so there's no way to edit it. You can turn that off by deleting the WEBSITE_RUN_FROM_ZIP or WEBSITE_RUN_FROM_PACKAGE application setting in the portal. Note this will clear your function app until the next time you publish.

If your tools are a little older, or if you've deployed using the latest tools but with func azure functionapp publish my-app-name --nozip then you can use the App Service Editor in Platform Features in the portal to edit the function.json files and remove the "generatedBy" setting, which will stop them being read-only.

Part 2 - Creating proxies

You can add proxies to your local project by populating a proxies.json file in the app root (alongside host.json). More information is at https://docs.microsoft.com/en-us/azure/azure-functions/functions-proxies, and a few examples are at https://docs.microsoft.com/en-us/sandbox/functions-recipes/proxies. You can also create proxies in the portal (when not read-only!) and then use the advanced editor to get the source to add to your project.

like image 160
MarkXA Avatar answered Sep 20 '22 13:09

MarkXA