0

我正在构建Azure逻辑应用程序并尝试自动创建Azure Redis缓存。没有为这个特定动作(创建或更新资源),我是能够调出:Azure Logic应用程序创建Redis缓存需要x-ms-api版本

Defintion in Logic App

正如你可以看到我进入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正确的价值,我在哪里可以找到基于资源提供这种价值的历史?

+0

你可以尝试用'2016-04-01' API的版本? –

+0

@GauravMantri同样的错误。 – sprinter252

+1

这很奇怪。我从这里获取了该版本:https://docs.microsoft.com/en-us/rest/api/redis/redis/create。 –

回答

2

尝试

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" 
] 

我把它一起工作:

enter image description here

HTH

+0

我仍然收到错误“资源类型无法在名为'Microsoft.Cache'的api版本'2014-04-01'中找到。”但是+1暗示我去'az provider show'。 – sprinter252

+0

检查图像的更新答案。它为我工作:) @ sprinter252 –

+0

谢谢!现在它可以工作。 – sprinter252

相关问题