Exercise: Git Push Deployment of Azure Functions

Challenge

Make updates to Azure Functions code by pushing to a git repository. Use the code created in the previous exercise and modify it and deploy the changes with a git push.

Solution – Step 1: Set Up Git Credentials to Use With Azure Functions Code

  1. Log in to portal.azure.com and open the panel for your Functions app
  2. Set up a username and password for accessing the Functions code using the “Deployment credentials” section of “Platform features”
  3. Choose the “Deployment options” panel and set up a local git connector
  4. Now choose the “Properties” panel and find the “GIT URL”
  5. User the Git URL to clone the repository locally with git clone URL-just-created
  6. That created a local copy of the Functions App folder structure

Solution – Step 2: Link a Git Push to Updating the Azure Function

  1. First let’s try a simple change followed by a push to Azure. I’m going to change the “sleepsuntil” function that I had before to return “9999” regardless of input and push that to Azure

test_9999

…then git push…

commit_changes

Testing this change in the browser has no luck:

fail_update

  1. …and then I went down a rabbit hole of trying to figure out why the push didn’t update the function until…

HAVE YOU TRIED TURING IT OFF AND ON AGAIN?

…the fix was to disconnect the local git option in the Azure portal…

fixing_azure

…and then connect again. It all worked fine after that!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s