0

I am trying to accomplish, that when I create a snapshot with an Azure function on create/modify, that it also sets the snapshot to the cool tier.

The storage account itself, needs to be the Hot tier, while snapshots should not.

How do i accomplish this? I have tried to look through the documentation, but are only able to see the GUI guide for doing it on single blobs manually.

Can I not accomplish this in the blobtrigger itself?

[FunctionName("CreateSnapshotAndCool")]
public static void Run([BlobTrigger("images/{name}", Connection = "AzureWebJobsStorage")]CloudBlockBlob myBlob, string name, ILogger log)
{
    log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name}");
    log.LogInformation("take snapshots for blob: " + name);
    myBlob.SnapshotAsync().Wait();

    // Change snapshot just created to cool tier.
}
andrelange91
  • 1,018
  • 3
  • 21
  • 48

1 Answers1

0

Yes, we can accomplish the same with blobtrigger. Coming to the pricing tier, if you have changed a blob or snapshot's tier, then you are billed for the entire object, regardless of whether the blob and snapshot are eventually in the same tier again. Hope it will helpful. Refer below link for more details Blob snapshots - Azure Storage | Microsoft Learn

Steps to create blobtrigger:

  1. Create / Add Function App into an App Services
  2. Create an Azure Blob Storage trigger into that. enter image description here
  3. We can add input / output parameters as required. enter image description here
Swarna Anipindi
  • 792
  • 2
  • 9
  • How does this change the tier of the snapshot? Is this something configured in the outputs? – andrelange91 Oct 31 '22 at 07:22
  • for changing tier of snapshot. refer already addressed thread. Hope this helps. https://stackoverflow.com/questions/49660278/c-sharp-azure-cannot-set-the-blob-tier – Swarna Anipindi Oct 31 '22 at 10:01