private async Task<string> GetBlobContainerSasUri(string rg1Name, string storageAccountName)
        {
            string sasUri = "foobar";

            if (Mode == RecordedTestMode.Record)
            {
                StorageAccount storageAccountOutput = await CreateStorageAccount(rg1Name, storageAccountName);
                var accountKeyResult = (await StorageAccountsOperations.ListKeysAsync(rg1Name, storageAccountName)).Value;
                //var accountKeyResult = await StorageAccountsClient.ListKeysWithHttpMessagesAsync(rg1Name, storageAccountName).Result;
                StorageAccount storageAccount = new StorageAccount(DefaultLocation);

                BlobContainer container = await BlobContainersOperations.GetAsync(rg1Name, storageAccountName, "sascontainer");
                //container.CreateIfNotExistsAsync();
                sasUri = GetContainerSasUri(container);
            }

            return sasUri;
        }
        private async Task <string> CreateApplicationMediaLink(string rgName, string fileName)
        {
            string         storageAccountName   = Recording.GenerateAssetName("saforgallery");
            string         asName               = Recording.GenerateAssetName("asforgallery");
            StorageAccount storageAccountOutput = await CreateStorageAccount(rgName, storageAccountName); // resource group is also created in this method.

            string applicationMediaLink = @"https://saforgallery1969.blob.core.windows.net/sascontainer/test.txt\";

            if (Mode == RecordedTestMode.Record)
            {
                var            accountKeyResult = await(StorageAccountsOperations.ListKeysAsync(rgName, storageAccountName));
                StorageAccount storageAccount   = new StorageAccount(DefaultLocation);
                //StorageAccount storageAccount = new StorageAccount(new StorageCredentials(storageAccountName, accountKeyResult.Body.Key1), useHttps: true);

                //var blobClient = storageAccount.CreateCloudBlobClient();
                BlobContainer container = await BlobContainersOperations.GetAsync(rgName, storageAccountName, "sascontainer");

                //byte[] blobContent = Encoding.UTF8.GetBytes("Application Package Test");
                //byte[] bytes = new byte[512]; // Page blob must be multiple of 512
                //System.Buffer.BlockCopy(blobContent, 0, bytes, 0, blobContent.Length);
                //var blobClient = storageAccount.CreateCloudBlobClient();
                //CloudBlobContainer container = blobClient.GetContainerReference("sascontainer");
                //bool created = container.CreateIfNotExistsAsync().Result;

                //CloudPageBlob pageBlob = container.GetPageBlobReference(fileName);
                //byte[] blobContent = Encoding.UTF8.GetBytes("Application Package Test");
                //byte[] bytes = new byte[512]; // Page blob must be multiple of 512
                //System.Buffer.BlockCopy(blobContent, 0, bytes, 0, blobContent.Length);
                //pageBlob.UploadFromByteArrayAsync(bytes, 0, bytes.Length);

                //SharedAccessBlobPolicy sasConstraints = new SharedAccessBlobPolicy();
                //sasConstraints.SharedAccessStartTime = Recording.UtcNow.AddDays(-1);
                //sasConstraints.SharedAccessExpiryTime = Recording.UtcNow.AddDays(2);
                //sasConstraints.Permissions = SharedAccessBlobPermissions.Read | SharedAccessBlobPermissions.Write;

                ////Generate the shared access signature on the blob, setting the constraints directly on the signature.
                //string sasContainerToken = pageBlob.GetSharedAccessSignature(sasConstraints);

                ////Return the URI string for the container, including the SAS token.
                //applicationMediaLink = pageBlob.Uri + sasContainerToken;
            }
            return(applicationMediaLink);
        }