Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Logic Apps - ARM template to deploy filesystem API connection

I am trying to deploy file system API connection using ARM template. I could not find the parametersValue schema for this connection and so tried with naming the parameters as they appear on Azure portal

Edit API Connection Screen shot on Azure Portal1

{
  "apiVersion": "2016-06-01",
  "name": "filesystem",
  "type": "Microsoft.Web/connections",
  "location": "[resourceGroup().location]",
  "properties": {
    "api": {
      "id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/westus/managedApis/filesystem')]"
    },
    "parameterValues": {
      "displayName": "FileSyetem",
      "rootFolder": "[parameters('rootFolder')]",
      "authenticationType": "Windows",
      "username": "[parameters('username')]",
      "password": "[parameters('password')]"
    }
  }

However deployment is failing due to wrong parameterValue names displayName and authenticationType

Below is error in the deployment log - Bad Request

Input parameters are invalid. See details for more information. Details:errorCode: ParameterNotDefined. Message: Parameter 'displayName' is not allowed on the connection since it was not defined as a connection parameter when the API was registered...

Does anyone knows correct json schema for filesystem connection? I could not find it on https://resources.azure.com .

like image 761
JJY Avatar asked Feb 06 '23 10:02

JJY


1 Answers

I was able to solve the issue by following instruction on blog

https://blogs.msdn.microsoft.com/logicapps/2016/02/23/deploying-in-the-logic-apps-preview-refresh/

Specially using armclient command line tool to retrieve the connection metadata https://github.com/projectkudu/ARMClient

{
  "apiVersion": "2016-06-01",
  "name": "filesystem",
  "type": "Microsoft.Web/connections",
  "location": "[resourceGroup().location]",
  "properties": {
    "api": {
      "id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/centralus/managedApis/filesystem')]"
    },
    "displayName": "logicAppFile",
    "parameterValues": {
      "rootfolder": "c:\\",
      "authType": "windows",
      "username": "[parameters('username')]",
      "password": "[parameters('password')]",
      "gateway": {
        "name": "OnPremGateway",
        "id": "/subscriptions/-----/resourceGroups/-----/providers/Microsoft.Web/connectionGateways/OnPremGateway",
        "type": "Microsoft.Web/connectionGateways"
      }
    }
  },
}
like image 51
JJY Avatar answered May 09 '23 02:05

JJY