我正在使用Microsoft Bot Framework和适用于Node.js的botBuilder SDK v4开发一个机器人。
我正在使用Azure blob存储来存储userState和sessionState。 Blob存储包含3个用于生产,登台和集成环境的容器。
因此,我是通过以下方式配置的:
try {
const blobStorageConfig = botConfig.findServiceByNameOrId(
process.env.BLOB_STORAGE_NAME
);
const blobStorage = new BlobStorage({
containerName: blobStorageConfig.container,
storageAccountOrConnectionString: blobStorageConfig.connectionString
});
conversationState = new ConversationState(blobStorage);
userState = new UserState(blobStorage);
} catch (error) {
console.error(`[BlobStorageError]:\n\n${error.stack}\n\n`);
}
运行bot时,成功存储了userState和sessionState,但是我在Azure日志中得到了此错误:
2019-05-29T15:23:48
Microsoft.WindowsAzure.Storage.StorageException: The remote server returned an error: (404) Not Found. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
at Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.PutBlock(String blockId, Stream blockData, String contentMD5, AccessCondition accessCondition, BlobRequestOptions options, OperationContext operationContext)
at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AddNewBlockToBlob(Stream stream, List`1 blockIds, CloudBlockBlob blockBlob)
at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.AppendStreamToBlob(Stream stream)
at Microsoft.WindowsAzure.WebSites.Diagnostics.AzureBlobTraceListener.ConsumeBuffer()
Request Information
RequestID:m2d...
RequestDate:Wed, 29 May 2019 15:23:47 GMT
StatusMessage:The specified resource does not exist.
ErrorCode:ResourceNotFound