Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run --publish-local-settings when doing a right click deploy?

When performing a right click --> deploy on a function app, how do we provide the --publish-local-settings switch?

enter image description here

The documentation states:

By default, these settings are not migrated automatically when the project is published to Azure. Use the --publish-local-settings switch when you publish to make sure these settings are added to the function app in Azure.

like image 247
Alex Gordon Avatar asked Feb 06 '19 16:02

Alex Gordon


People also ask

How do you use publish settings?

Navigate to the location of the publish settings file that you created in the previous section. In the Import Publish Settings File dialog, navigate to and select the profile that you created in the previous section, and click Open. Click Finish to save the publishing profile, and then click Publish.

How do I publish a Visual Studio project locally?

Right-click on the project (not the solution) in Solution Explorer and select Publish. In the Publish tab, select Publish. Visual Studio writes the files that comprise your application to the local file system. The Publish tab now shows a single profile, FolderProfile.

How do I add local settings JSON to my project?

In your project, open the local. settings. json file and set the value of the AzureWebJobsStorage key to the connection string you copied. Repeat the previous step to add unique keys to the Values array for any other connections required by your functions.


1 Answers

Short answer? You can't. That flag is for the func.exe command line tool, not visual studio right-click publish.

Long answer: From the screenshot, it looks like you are using Visual Studio, yes? By default, Visual Studio doesn't publish your local.settings.json file to Azure. The expectation there is that your local development settings probably aren't the same settings you want published. They are nudging you into the pit of success.

To publish settings from inside Visual Studio, follow the documentation here ...

The easiest way to upload the required settings to your function app in Azure is to select the Manage Azure App Service settings link that appears after you successfully publish your project.

enter image description here

Selecting this link displays the Application settings dialog for the function app, where you can add new application settings or modify existing ones.

enter image description here

If you are truly looking to use the --publish-local-settings flag you are referencing, then that can be achieved using the azure functions core tools command line tool, func.exe

More info here.

Example command: func azure functionapp publish Function_App_Name --publish-local-settings

like image 195
Troy Witthoeft Avatar answered Sep 24 '22 06:09

Troy Witthoeft