Azure Blob Storage
要设置 Azure Blobstorage状态存储,请创建一个类型为的组件。 请参阅本指南,了解如何创建和应用状态存储配置。
Warning
以上示例将密钥明文存储, It is recommended to use a secret store for the secrets as described here.
元数据字段规范
请遵循 Azure 文档中关于如何创建 Azure Storage Account的说明。
要将 Azure Blob Storage配置为状态存储,你需要如下属性:
- AccountKey:主要或次要存储密钥。
- ContainerName:用于Dapr状态的容器名称。 如果容器不存在,将会自动创建.
应用配置
要将 Azure Blob Storage状态存储应用到Kubernetes,请执行如下kubectl
CLI:
本地运行
要在本地运行,创建一个包含YAML文件的components
目录,并提供命令的路径,标志为--components-path
。
例如,以下操作来自于名为myservice
的服务
在容器中创建blob文件,文件名为key
,文件内容为value
。
根据,通过使用ETag
实现Azure Blob Storage状态并发。
相关链接
- 阅读 本指南 以获取配置状态存储组件的说明