// </snippet_CopyFileToBlob> // <snippet_CreateShareSnapshot> //------------------------------------------------- // Create a share snapshot //------------------------------------------------- public async Task CreateShareSnapshotAsync(string shareName) { // Get the connection string from app settings string connectionString = ConfigurationManager.AppSettings["StorageConnectionString"]; // Instatiate a ShareServiceClient ShareServiceClient shareServiceClient = new ShareServiceClient(connectionString); // Instantiate a ShareClient which will be used to access the file share ShareClient share = shareServiceClient.GetShareClient(shareName); // Ensure that the share exists if (await share.ExistsAsync()) { // Create a snapshot ShareSnapshotInfo snapshotInfo = await share.CreateSnapshotAsync(); Console.WriteLine($"Snapshot created: {snapshotInfo.Snapshot}"); } }