4
votes

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 .

3
It seems API connections are not available in resources.azure.com which is very annoyingRuSs

3 Answers

9
votes

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"
        }
      }
    },
  }
0
votes

i have seen you solved but it. So grats and thank you for posting your solution.

Perhaps it can make other with some problem easier, so I posted too. I am a newbie and it helped me much.

I had the problem with other connectors (office365, office365user,..).

With Visual studio 2019 and installed logic App extension (Download Link) you can do following steps for getting an ARM-template with Api Connection informations. (Screenshots will follow)

  1. in Visual studio 2019 open the cloud explorer
  2. select the needed subscription and the concerning logic app
  3. then right-click on the logic App and choose "Open with Logic App Editor" from the menu
  4. Normally the logic app designer view will open in a client Window of VS2019 ( it could be take some time, if you will not wait you could choose in bottom window section CodeView - it doens't matter we only need the download function)
  5. then you click on download and after the finished download you had an template file with the resource information for the Api Connection(s)

In many cases this ARM-file works direct for deployment, but there could be some expression make problems (e.g. use [[ instead [ in text ) but the Api Connection(s) should be correct in the downloaded file.

I think there was 2 powershell scripts that shows you the correct API connection informations too, 1 script I have tested and it worked not for me but i only make a few tests and then Cancel it. So I didn't added the links here and it was and I have not kept it in in mind.

-1
votes

If your using logic app custom connector then you have to define those parameters with the same