【问题标题】:Azure Logic App creation of Redis Cache requires x-ms-api-versionAzure Logic App 创建 Redis 缓存需要 x-ms-api-version
【发布时间】:2017-09-04 11:24:21
【问题描述】:

我正在构建一个 Azure 逻辑应用程序并尝试自动创建 Azure Redis 缓存。我可以为此提出一个特定的操作(创建或更新资源):

如您所见,我输入了 2016-02-01 作为 api 版本。我在这里尝试了不同的值,只是从我从微软知道的其他 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 的正确值是多少?根据资源提供者,我在哪里可以找到该值的历史记录?

【问题讨论】:

  • 可以试试2016-04-01 API 版本吗?
  • @GauravMantri 同样的错误。
  • 这很奇怪。我从这里获取了版本:docs.microsoft.com/en-us/rest/api/redis/redis/create.
  • @GauravMantri 获取版本的好资源,谢谢!也许任务标题中的“预览”语句意味着“当前不工作”;-)。

标签: azure azure-resource-manager azure-logic-apps azure-redis-cache


【解决方案1】:

试试

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

【讨论】:

  • 我仍然收到错误“在 API 版本 '2014-04-01' 的命名空间 'Microsoft.Cache' 中找不到资源类型。”但是 +1 提示我 az provider show
  • 用图片检查更新的答案。它对我有用:) @sprinter252
猜你喜欢
  • 2018-04-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-06
  • 1970-01-01
  • 1970-01-01
  • 2019-01-13
  • 1970-01-01
相关资源
最近更新 更多