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
- task: RunARMTTKTests@1 | |
inputs: | |
templatelocation: '$(System.DefaultWorkingDirectory)\*' | |
resultLocation: '$(System.DefaultWorkingDirectory)' |
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
{ | |
"condition": "[equals(parameters('newOrExisting'),'new')]", | |
"type": "Microsoft.Storage/storageAccounts", | |
"apiVersion": "2017-06-01", | |
"name": "[variables('storageAccountName')]", | |
"location": "[parameters('location')]", | |
"sku": { | |
"name": "[variables('storageAccountType')]" | |
}, | |
"kind": "Storage", |
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/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"StorageAccountName": { | |
"type": "String", | |
"defaultValue": "storage2020" | |
} | |
}, | |
"variables": { |
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
"functions": [ | |
{ | |
"namespace": "finance", | |
"members": { | |
"prefixDepartment": { | |
"parameters": [ | |
{ | |
"name": "resourceName", | |
"type": "string" | |
} |
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
//Generate image | |
var memoryStream = GenerateBlogPostMetaCardWithDescription("{ " + metaCardDescription.PostMetaTagImageDescription + " }"); | |
//Create the image in Blob Storage | |
CloudBlockBlob blob = blobContainer.GetBlockBlobReference($"{metaCardDescription.PostTitle}.png"); | |
blob.Properties.ContentType = "image/png"; | |
blob.UploadFromStream(memoryStream); | |
log.LogInformation($"Post image card generation for post {metaCardDescription.PostTitle} was successful. Image was uploaded to Blob Storage"); |
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
private static MemoryStream GenerateBlogPostMetaCardWithDescription(string description) | |
{ | |
StringFormat format = new StringFormat(); | |
format.Alignment = StringAlignment.Center; | |
format.LineAlignment = StringAlignment.Center; | |
Bitmap newBitmap; | |
using (var bitmap = (Bitmap)LoadImageTemplate())//load the image file | |
{ |
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
private static async Task<PostMetaTagImage> GetBlogPostCardDescription(ILogger log) | |
{ | |
PostMetaTagImage cardDescription = new PostMetaTagImage(); | |
try | |
{ | |
string content = await MakeGitHubAPICall("https://api.github.com/repos/<website-repo>/commits"); | |
List<CommitsData> commits = JsonConvert.DeserializeObject<List<CommitsData>>(content); | |
CommitsData latestCommit = commits.OrderByDescending(x => x.commit.author.date).FirstOrDefault(); |
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
public static class OrderPlaceInvoiceGenerator | |
{ | |
[FunctionName("OrderPlaceInvoiceGenerator")] | |
public static void Run([RabbitMQTrigger("medpark.orderservice/basket-service.basket_checked_out_invoice_gen", ConnectionStringSetting = "connectionStringSetting")] BasicDeliverEventArgs args, | |
ILogger log) | |
{ | |
log.LogInformation($"Message received from RabbitMQ trigger: {message}"); | |
} | |
} |
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
public class RabbitMqExtensionConfigProvider : IExtensionConfigProvider | |
{ | |
private ILogger _logger; | |
public RabbitMqExtensionConfigProvider(ILogger logger) | |
{ | |
_logger = logger; | |
} | |
public void Initialize(ExtensionConfigContext context) |
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
public class RabbitMqTriggerBindingProvider : ITriggerBindingProvider | |
{ | |
private readonly ILogger _logger; | |
public RabbitMqTriggerBindingProvider(ILogger logger) | |
{ | |
_logger = logger; | |
} | |
public Task<ITriggerBinding> TryCreateAsync(TriggerBindingProviderContext context) |
NewerOlder