Created
March 2, 2019 15:36
-
-
Save petems/ec2a722f3bb7c8614c277958a759b420 to your computer and use it in GitHub Desktop.
Create snapshot from Azure blob url
This file contains hidden or 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
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