

Make sure you are in your Project’s directory and run the following command in your terminal: func azure functionapp fetch-app-settings '' -output-file Now we can fetch our app settings from our Function App in Azure. s being the shorthand parameter for subscription. To set the subscription that your Function is hosted in, run this command: az account set -s "" Once you’re logged in, you should see a list of subscriptions to which you have access to. Open up the command line or PowerShell on your machine and log into your Azure Account by running the following command: az login If you work with multiple Azure Subscriptions, we’ll need to set it using AZ CLI to ensure that when we run our Function Core Tools, it’s looking in the right place. Create a JavaScript JSON Configuration File and give it the name Step 1: Set our Azure Subscription To do this, right-click your Functions Project and create a new file. We’ll need to create a JSON file to write our App settings to. Just to verify that the local settings file isn’t in my project directory, here’s a screen shot: To help me with local debugging, I’m going to use the Function Core tools to help fetch my app settings from Azure. gitignore file excludes the file that was generated when I created the project. I’ve deployed this Function to Azure already and my. Let’s beginįor this tutorial, I’ve cloned one of my existing projects from GitHub. If you haven’t installed the tools yet, check out this documentation to get started. While we’ll just be focusing on fetching our app settings, Functions Core Tools come with commands that allow us to create Functions, deploy our Functions and more! Azure Functions Core Tools include a version of the same runtime that powers Azure Functions Runtime that we can run on our machine. You’ll need to make sure that the Azure Function Core Tools have been installed on your machine. We wouldn’t want to waste our time copying and pasting all those settings! Before we start Especially for Functions that have a lot of settings. Say if we have multiple environments (DEV, Test, UAT etc) and we wanted to locally debug a Function using that environments settings, we can use Azure Function Core Tools to simplify the retrieval of those settings. Thankfully, we can use Azure Function Core Tools to create a file and import our Function settings to that file so we can run our Functions locally as if we were running it against that environment! Why would we do this? It’s good practice not to commit this file to your repo since it has application secrets!). However, if we clone a Function app from a repository, this file won’t be cloned! ( Hopefully it won’t be cloned. When we first create a Function in Visual Studio, a file is generated for us. Running our Functions locally requires a file to store our application settings. With Azure Function Core Tools, we can retrieve settings from our Functions to simplify our local development and debugging efforts!īefore deploying our Azure Functions, it’s good to debug our Functions locally to ensure that it works as expected.
