Skip to content

Instantly share code, notes, and snippets.

@petems
Created March 2, 2019 15:36
Show Gist options
  • Save petems/ec2a722f3bb7c8614c277958a759b420 to your computer and use it in GitHub Desktop.
Save petems/ec2a722f3bb7c8614c277958a759b420 to your computer and use it in GitHub Desktop.
Create snapshot from Azure blob url
createSnapshot, err := blockBlobURL.CreateSnapshot(ctx, azblob.Metadata{}, azblob.BlobAccessConditions{})
if err == nil {
createSnapshot.Snapshot()
snapshot := createSnapshot.Snapshot()
snapshotBlobURL := blockBlobURL.WithSnapshot(snapshot)
l.logger.Printf("Created Azure Blob Snapshot - %s", snapshotBlobURL)
} else {
l.logger.Printf("Attempt to create blob snapshot failed - %s - Skipping", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment