This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import azure.functions as func | |
def main(req: func.HttpRequest) -> func.HttpResponse: | |
return func.HttpResponse( | |
"\nThis message is from our Secret API in the Backend Function.", | |
status_code=200 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import azure.functions as func | |
import requests | |
def main(req: func.HttpRequest) -> func.HttpResponse: | |
#Replace the URL with the URL from your Backend Function. | |
response = requests.get('https://azureblogging-backend.azurewebsites.net/api/SecretAPI').text | |
return func.HttpResponse( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import azure.functions as func | |
import requests | |
import os | |
def get_bearer_token(resource_uri): | |
identity_endpoint = os.environ["IDENTITY_ENDPOINT"] | |
identity_header = os.environ["IDENTITY_HEADER"] | |
token_auth_uri = f"{identity_endpoint}?resource={resource_uri}&api-version=2019-08-01" | |
head_msi = {'X-IDENTITY-HEADER':identity_header} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"appRoles": [ | |
{ | |
"allowedMemberTypes": [ | |
"Application" | |
], | |
"displayName": "Allow Frontend Function access to Backend Function", | |
"id": "e8771cad-cfde-4f6b-b6f4-e246f9b468d2", | |
"isEnabled": true, | |
"description": "Allow Managed Identity of Frontend Function to authenticate to Backend Function", | |
"value": "Things.Read.All" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@type": "MessageCard", | |
"@context": "https://schema.org/extensions", | |
"summary": "ADF Alert", | |
"themeColor": "eb3434", | |
"title": "Azure DataFactory notification alert!", | |
"sections": [ | |
{ | |
"activityTitle": "Pipeline failed", | |
"activitySubtitle": "UTC: $timestamp_of_failure$", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@concat('{ | |
"','@','type": "MessageCard", | |
"','@','context": "https://schema.org/extensions", | |
"summary": "Issue 176715375", | |
"themeColor": "eb3434", | |
"title": "Azure DataFactory notification alert!", | |
"sections": [ | |
{ | |
"activityTitle": "Pipeline failed", | |
"activitySubtitle": "UTC: ', utcnow() ,'", |