When performing a right click --> deploy on a function app, how do we provide the --publish-local-settings
switch?
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.
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.
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.
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.
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.
Selecting this link displays the Application settings dialog for the function app, where you can add new application settings or modify existing ones.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With