Git Product home page Git Product logo

azure-resume's Introduction

azure-resume

Structure

  • Frontend folder contains the website
  • main.js contains the visitor counter code

High Level Steps

Create a blank project called azure-resume in GitHub.

Clone it into /repo/azure

Clone the source starter project into /repo/azure - Link to Starter project

Copy both backend and frontend projects from the cloned starter project into your azure-resume project

Edit the index.html in the frontend folder in the azure-resume project

Create main.js in the frontend folder of your project

Create the Azure Function using the steps outlined in the video

Add the AzureResumeConnectionString variable to local.settings.json

Create the Counter.cs file

Update GetResumeCounter.cs

Issues and updates

  1. Functions Core Tools - you will need to install the core tools from here Functions Core Tools. I used the v4 the self-contained platform image on my Mac, and it worked just fine.

  2. Dotnet SDK v6 - updates required to the CosmosDB HTTP trigger Note the update to containerName and Connection

  3. Function Core Tools flaky behaviour - I experienced some intermittent behaviour on my Mac when running the function locally using Functions Core Tools. It would, on occaision not work, reporting a host configuration change error, usually because a file change had been detected. Even when it hadn't. Example error If this happens to you, try running dotnet restore, followed by dotnet build. And here is an example of the function running OK locally, you should see something similar Locally running function With the browser showing.. function running locally in browser

And if you are still having trouble, try the following..

Uninstall and reinstall Azure Functions Core Tools

# Uninstall Azure Functions Core Tools
npm uninstall -g azure-functions-core-tools@4

#Clear the NPM cache
npm cache clean --force

#Install Azure Functions Core Tools
npm i -g azure-functions-core-tools@4 --unsafe-perm true

# Install dependencies
npm install

# Start function with verbose logging

func start --verbose
Note your version of azure-functions-core-tools may be different to the latest at the time of writing *@4

Setting up CI/CD with GitHub

Steps are as follows

  1. In the root folder of your project, create a .github directory
  2. cd into it
  3. make a directory called workflows
  4. cd into it
  5. create a frontend.main.yml file
    touch frontend.main.yml
  6. create a backend.main.yml file
  7. create the SP used for deployment
    az ad sp create-for-rbac --name <yourspname>-sp --role contributor --scopes /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azureresumedr --sdk-auth
  8. Follow the steps in this article

azure-resume's People

Contributors

realworldazure avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.