Skip to content

mpowney/m365may-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M365 May API

This project is an Azure Functions runtime API used for the M365 May online event. It enables access to data stored in an Azure Table Storage instance for event attendees, and event co-ordinators.

Pre-requisites

This is one of three repo's used to deliver the M365 May session handling. The other two repo's are:

  • M365 May Client client side code for attendees to browse sessions via this API
  • M365 May Admin client side code to allow event co-ordinators to maintain sessions via this API

The solution requires the following:

  • An event registered with Sessionize to organise the sessions of the event

Additionally, the following API is used:

Development environment

This app can be developed in any environment supported by dotnet core function apps runtime. The development environment used by the author was:

Configuration

The following environment variables need to be present during runtime to point the solution to supporting resources. For local development, these can be added to a local.settings.json file to get a dev environment up and running:

Variable name Example Description
AzureWebJobsStorage DefaultEndpointsProtocol=https;AccountName=functionappstoragename;AccountKey=privatekeyremovedfordiscretion==;BlobEndpoint=https://functionappstoragename.blob.core.windows.net/;QueueEndpoint=https://functionappstoragename.queue.core.windows.net/;TableEndpoint=https://functionappstoragename.table.core.windows.net/;FileEndpoint=https://functionappstoragename.file.core.windows.net/; Connection string pointing to the Function App's storage account
AzureStaticSiteStorage DefaultEndpointsProtocol=https;AccountName=staticsitestoragename;AccountKey=privatekeyremovedfordiscretion==;BlobEndpoint=https://staticsitestoragename.blob.core.windows.net/;QueueEndpoint=https://staticsitestoragename.queue.core.windows.net/;TableEndpoint=https://staticsitestoragename.table.core.windows.net/;FileEndpoint=https://staticsitestoragename.file.core.windows.net/; Connection string pointing to the storage account hosting the m365may-client static site
SESSIONIZE_SESSIONS_URL https://sessionize.com/api/v2/kr0di5es/view/Sessions Use Sessionize to enable an API endpoint, enter the Sessionize API base url here
SESSIONIZE_SPEAKERS_URL https://sessionize.com/api/v2/kr0di5es/view/Speakers Use Sessionize to enable an API endpoint, enter the Sessionize API base url here
SESSIONIZE_CACHE_MINUTES 1440 Number of minutes the data obtained from Sessionize is cached in the Function's storage account for
REDIRECT_DESTINATION_HOST https://www.m365may.com When a session's live event URL is specified as a relative path, this host name will be pre-pended
HOLDPAGE_SESSION https://www.m365may.com/session-details/{id}/ When a session hasn't yet commenced, they will be redirected to this page instead of the live event URL
FREEGEOIP_HOST https://freegeoip.app The Free Geo IP base URL to use for looking up users' IP addresses for geo location information
ICAL_FORMAT_TITLE Microsoft 365 May: {title} When generating an calendar event for a session in iCal format, include this text in the title / subject line
ICAL_FORMAT_DESCRIPTION {speakers}\r\n\r\n{title}\r\n\r\n{description}\r\n\r\n{url} When generating an calendar event for a session in iCal format, include this text in the description
ICAL_FORMAT_UID {id}@m365may.com Use this as a unique identifier so updates to the session schedule will overwrite existing events in the attendee's calendar if they click on the iCal link again
FILE_EXPORT_SCHEDULE 0 50 * * * * An NCRONTAB expression specifying how often Session, Speaker, and Video Link data files should be exported to the static site (example specifies once per hour at 50 minutes past the hour)
FILE_EXPORT_CACHE_CONTROL Influences how the exported Session, Speaker, and Video Link data files are cached by the browser
NODE_SYNC_MASTER_CONN DefaultEndpointsProtocol=https;AccountName=functionappstoragename;AccountKey=privatekeyremovedfordiscretion==;BlobEndpoint=https://functionappstoragename.blob.core.windows.net/;QueueEndpoint=https://functionappstoragename.queue.core.windows.net/;TableEndpoint=https://functionappstoragename.table.core.windows.net/;FileEndpoint=https://functionappstoragename.file.core.windows.net/; For replica instances of the function app, this connection string is used to connect to the master function app's storage container, so all click counts and geo information are tracked centrally

Development

A local instance of this function app can be run with Visual Studio Code and the Azure Function app extensions.

Deployment

The built code can be deployed to an Azure Functions v3 environment.

This Azure DevOps build YAML file performs the pipeline steps in Azure DevOps to create build artefacts. Build artefacts can then be deployed by an Azure DevOps Release pipeline with the Deploy Azure Function App action.

Support

This repo can be used as a reference implementation. It currently exists as a stand-alone solution for M365 May's needs. Please contact the author to discuss ways to implement a solution for needs described in this YouTube video.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages