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
function Download-FileFromWebApp($resourceGroupName, $webAppName, $slotName = "", $kuduPath, $localPath){ | |
$kuduApiAuthorisationToken = Get-KuduApiAuthorisationHeaderValue $resourceGroupName $webAppName $slotName | |
if ($slotName -eq ""){ | |
$kuduApiUrl = "https://$webAppName.scm.azurewebsites.net/api/vfs/site/wwwroot/$kuduPath" | |
} | |
else{ | |
$kuduApiUrl = "https://$webAppName`-$slotName.scm.azurewebsites.net/api/vfs/site/wwwroot/$kuduPath" | |
} | |
$virtualPath = $kuduApiUrl.Replace(".scm.azurewebsites.", ".azurewebsites.").Replace("/api/vfs/site/wwwroot", "") |
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
{ | |
"id": "9ac0d31ac1234567890d685e57164f08", | |
"functionTimeout": "00:05:00", | |
"http": { | |
"routePrefix": "api" | |
}, | |
"watchDirectories": [ "Shared" ], | |
"tracing": { | |
"consoleLevel": "info", | |
"fileLoggingMode": "debugOnly" |
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
{ | |
"IsEncrypted": false, | |
"Values": { | |
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=pacopollingconsumerstrg;AccountKey=[key];EndpointSuffix=core.windows.net", | |
"AzureWebJobsDashboard": "DefaultEndpointsProtocol=https;AccountName=pacopollingconsumerstrg;AccountKey=[key];EndpointSuffix=core.windows.net", | |
"PollingWatermarkStorage": "DefaultEndpointsProtocol=https;AccountName=pacopollingconsumerstrg;AccountKey=[key];EndpointSuffix=core.windows.net" | |
} | |
} |
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
{ | |
"disabled": false, | |
"scriptFile": "..\\bin\\PacodelaCruz.PollingConsumer.FunctionApp.dll", | |
"entryPoint": "PacodelaCruz.PollingConsumer.FunctionApp.GetPollingWatermark.Run", | |
"bindings": [ | |
{ | |
"name": "req", | |
"type": "httpTrigger", | |
"direction": "in", | |
"methods": [ "get" ], |
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
{ | |
"disabled": false, | |
"scriptFile": "..\\bin\\PacodelaCruz.PollingConsumer.FunctionApp.dll", | |
"entryPoint": "PacodelaCruz.PollingConsumer.FunctionApp.UpdatePollingWatermark.Run", | |
"bindings": [ | |
{ | |
"name": "req", | |
"type": "httpTrigger", | |
"direction": "in", | |
"methods": [ "patch" ], |
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
using System; | |
using Microsoft.WindowsAzure.Storage.Table; | |
namespace PacodelaCruz.PollingConsumer.FunctionApp | |
{ | |
/// <summary> | |
/// Class to handle the entities on the Azure Table Storage called ‘PollingWatermark'. | |
/// If you want to learn more about using Azure Storage Tables with C# have a look at this documentation | |
/// https://docs.microsoft.com/en-us/azure/storage/storage-dotnet-how-to-use-tables | |
/// </summary> |
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
using System; | |
namespace PacodelaCruz.PollingConsumer.FunctionApp | |
{ | |
/// <summary> | |
/// This class will help us to wrap the PollingWatermarkEntity and make it more user friendly. By using the constructor, we are naming the PartitionKey as SourceSystem, and the RowKey as Entity. Additionally, we are returning another property called NextWatermark that is to be used as the upper bound when querying the source system and when updating the Polling Watermark after we have successfully polled the source system | |
/// </summary> | |
public class PollingWatermark | |
{ | |
public string SourceSystem { get; set; } |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Formatting; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.WebJobs.Host; | |
using Microsoft.Azure; |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": {}, | |
"variables": {}, | |
"resources": [ | |
{ | |
"properties": { | |
"state": "Disabled", | |
"definition": { |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Formatting; | |
using System.Threading.Tasks; | |
using Microsoft.Azure.WebJobs.Host; | |
using Microsoft.Azure; |