File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/WebJobs.Script.WebHost/Security/KeyManagement
test/WebJobs.Script.Tests.Integration/Host Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,9 @@ private async Task CopyKeysFromFileSystemToBlobStorage(BlobStorageSecretsReposit
132
132
{
133
133
string blobName = Path . GetFileName ( file ) ;
134
134
CloudBlockBlob cloudBlockBlob = blobStorageSecretsRepository . BlobContainer . GetBlockBlobReference ( blobStorageSecretsRepository . SecretsBlobPath + "/" + blobName ) ;
135
- Task copyTask = cloudBlockBlob . UploadFromFileAsync ( file ) ;
135
+
136
+ string contents = File . ReadAllText ( file ) ;
137
+ Task copyTask = cloudBlockBlob . UploadTextAsync ( contents ) ;
136
138
copyTasks . Add ( copyTask ) ;
137
139
_logger ? . LogTrace ( "'{0}' was migrated." , cloudBlockBlob . StorageUri . PrimaryUri . AbsoluteUri . ToString ( ) ) ;
138
140
}
Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ public async Task SecretMigrate_Successful()
54
54
var logs = loggerProvider . GetAllLogMessages ( ) . ToArray ( ) ;
55
55
Assert . Contains ( logs [ logs . Length - 1 ] . FormattedMessage , "Finished successfully." ) ;
56
56
string hostContentFromBlob = await blobRepoMigration . ReadAsync ( ScriptSecretsType . Host , "" ) ;
57
- Assert . Contains ( hostContent , hostContentFromBlob ) ;
57
+ Assert . Equal ( hostContent , hostContentFromBlob ) ;
58
58
string hostContentFromFunction = await blobRepoMigration . ReadAsync ( ScriptSecretsType . Function , "test1" ) ;
59
- Assert . Contains ( functionContent , hostContentFromFunction ) ;
59
+ Assert . Equal ( functionContent , hostContentFromFunction ) ;
60
60
61
61
var blobRepoMigration2 = _fixture . GetBlobStorageSecretsMigrationRepository ( loggerProvider . CreateLogger ( "" ) ) ;
62
62
await blobRepoMigration2 . ReadAsync ( ScriptSecretsType . Host , "host" ) ;
@@ -105,7 +105,6 @@ public async Task SecretMigrate_Conflict()
105
105
{
106
106
_settingsManager . SetSetting ( EnvironmentSettingNames . AzureWebsiteSlotName , null ) ;
107
107
_settingsManager . SetSetting ( EnvironmentSettingNames . AzureWebsiteName , null ) ;
108
-
109
108
}
110
109
}
111
110
}
You can’t perform that action at this time.
0 commit comments