liatrio / billing-alert-function-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Billing Alert Function App

This repo is an Azure 3.0 Function app with two functions bundled inside. The two functions are slack-budget-alert and teams-budget-alert. With these two functions, a function app can call on these two functions with an HTTP trigger to send budget alerts through Slack and Teams.

This repo was created alongside Liatrio's Cloud Adoption Framework (CAF) for Azure by Austin White, Christian Hodges, and Micah Perez

Usage

  • Fork repo so that you can create GitHub Action secrets
  • Create a shared-access-token through your cli
sas=`az storage blob generate-sas \ 
	--account-name <account-name> \
	# ex: stbillingalertfunc \ 
	--container-name <container> \ 
	# ex: stc-billing-alert-func-core-centralus \
 	--name <blob> \ 
	# ex: stb-billing-alert-func-core-centralus \
 	--permissions rw \
 	--https-only \
 	--expiry <expiry-time> \ 
	# ex: 2022-05-01T00:00:00Z \
 	-o tsv`
echo $sas
  • Create repo secret named SAS_TOKEN with the token you just made
  • Create repo secrets for BLOB, CONTAINER, and ACCOUNT_NAME that match the ones used in the above command
  • Run the workflow dispatch on the publish-to-azure.yaml GitHub Action to upload the function code to your blob storage

About


Languages

Language:JavaScript 100.0%