我正在构建一个 Azure 逻辑应用程序,并尝试自动创建 Azure Redis 缓存。我可以提出一个具体的操作(创建或更新资源):
如您所见,我输入了 2016-02-01
作为 api 版本。我在这里尝试了不同的值,只是根据我从 Microsoft 了解到的其他 api 版本进行猜测。我在互联网上找不到任何这方面的资源。此步骤的结果将是:
{
"error":
{
"code": "InvalidResourceType",
"message": "The resource type could not be found in the namespace 'Microsoft.Cache' for api version '2016-02-01'."
}
}
x-ms-api-version
的正确值是什么?在哪里可以找到基于资源提供程序的该值的历史记录?
最佳答案
尝试
Resource Provider: Microsoft.Cache
Name: Redis/<yourrediscachename>
x-ms-api-version: 2017-02-01
了解每种资源类型支持的版本的一种简单方法是在 Azure 门户上使用 CLI,例如
az provider show --namespace Microsoft.Cache --query "resourceTypes[?resourceType=='Redis'].apiVersions | [0]"
将返回:
[
"2017-02-01",
"2016-04-01",
"2015-08-01",
"2015-03-01",
"2014-04-01-preview",
"2014-04-01"
]
我让它工作:
HTH
关于Azure 逻辑应用创建 Redis 缓存需要 x-ms-api-version,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46035986/