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

相關問題