0
votes

I m a little new to Azure.

Issue is I m developing Azure Functions and some times I have to work locally (code/ test etc) and other times on Azure. Every time I switch I have to compare and change app settings manually.

Is there a way I can avoid it ? Something where if I run locally I may get latest from server without manual and when I go to server Azure may be aware of my changes ?

Thanks

1

1 Answers

2
votes

Yes, use the Azure Functions Core Tools

Usage: func azure functionapp <action> [-/--options]

fetch-app-settings  Retrieve App Settings from your Azure-hosted
                    Function App and store locally Aliases:
                    fetch-app-settings, fetch

and

Usage: func azure functionapp <action> [-/--options]

publish             Publish the current directory contents to an
                    Azure Function App. Locally deleted files
                    are not removed from destination.

    <FunctionAppName> Function App name

    --publish-local-settings [-i] Updates App Settings for the
                                  function app in Azure during deployment.

    --publish-settings-only [-o]  Only publish settings and skip the
                                  content. Default is prompt.

    --overwrite-settings [-y]     Only to be used in conjunction with -i or -o.
                                  Overwrites AppSettings in Azure with local
                                  value if different. Default is prompt.

There's also encryption for the local file if you feel a little adventurous —
run func settings to get usage.