I was unable to find any articles regarding this behaviour.
I am using Visual Studio 2017 and Logic App Designer. I have a configuration that works perfect when deployed, using a parameter file. When I open my JSON in the designer, it says "invalid connection", and I get the option to select an existing connection or a new one. If I choose the existing one, the action is enabled again and works within the studio.
But in the JSON-file on the other hand, there is a new connection created, which is exactly the same as the previous, but it's called (in this case) sftp_2 instead - which the action is using. I've tried to change all references to the old connection, but it doesnät work - it gives me the same error.
It worked when I left work on Friday, but not after I reopened Visual Studio today. Do I need to activate/re-open the old connection first, somehow?
The connection looks like this:
{
"type": "MICROSOFT.WEB/CONNECTIONS",
"apiVersion": "2016-06-01",
"name": "[parameters('sftp_1_Connection_Name')]",
"location": "[parameters('logicAppLocation')]",
"properties": {
"api": {
"id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sftp')]"
},
"displayName": "[parameters('sftp_1_Connection_DisplayName')]",
"parameterValues": {
"hostName": "[parameters('sftp_1_hostName')]",
"userName": "[parameters('sftp_1_userName')]",
"password": "[parameters('sftp_1_password')]",
"sshPrivateKey": "[parameters('sftp_1_sshPrivateKey')]",
"sshPrivateKeyPassphrase": "[parameters('sftp_1_sshPrivateKeyPassphrase')]",
"portNumber": "[parameters('sftp_1_portNumber')]",
"giveUpSecurityAndAcceptAnySshHostKey": "[parameters('sftp_1_giveUpSecurityAndAcceptAnySshHostKey')]",
"sshHostKeyFingerprint": "[parameters('sftp_1_sshHostKeyFingerprint')]",
"disableUploadFilesResumeCapability": "[parameters('sftp_1_disableUploadFilesResumeCapability')]"
}
}
},
And here is one of the actions:
"Get_file_content": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['sftp_1']['connectionId']"
}
},
"method": "get",
"path": "/datasets/default/files/@{encodeURIComponent(encodeURIComponent(parameters('sftp_1_filepath'),items('For_each')?['Name']))}/content",
"queries": {
"inferContentType": true
}
},
"runAfter": {}
}
And finally the connection array:
"$connections": {
"value": {
"sftp_1": {
"id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sftp')]",
"connectionId": "[resourceId('Microsoft.Web/connections', parameters('sftp_1_Connection_Name'))]",
"connectionName": "[parameters('sftp_1_Connection_Name')]"
},
"filesystem": {
"id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'filesystem')]",
"connectionId": "[resourceId('Microsoft.Web/connections', parameters('filesystem_1_Connection_Name'))]",
"connectionName": "[parameters('filesystem_1_Connection_Name')]"
}
}
}
This is the logic app flow

The reasoning behind this is that Visual Studio Logic Apps Designer does not check for if this connection used by this connector is used elsewhere in the logic app or in Azure. So in the case of that, the now old API-connection is still used in Azure somewhere it instead creates an additional API-connection(sftp_2 in this case).
The Designer helps you with discovering 'Dynamic content'. However, to do this it needs to create the API-connection even at the development stage and not at the deployment stage.
As overwriting, this connection in Visual studio Designer would mean that upon saving it would be overwritten in Azure. Since when working in Visual Studio, you are already working with objects deployed in Azure such as connections.
If this happens, I usually go with a Ctrl+H and replace the new connection to the old one's name and remove any reference of the old one — cumbersome work.
As to l--''''''---------'''''''''''' question it becomes something of an egg and a hen problem. You are trying to set a naming convention but the API-connection is created before you can set the naming convention if you go by the designer. If you are working within the JSON this is possible to do with parameters but the designer will look like it is broken. The parameter could be built so it only modifies the connection name.
Here the connector is named blob-3221 but I have to parameters named CustomVariableName and CustomName. I have highlighted where Custom comes up in the code. So here it says that the azureblob_1_Connection_Name is blob-3221 and display name is blob-test,

which are two values declared but not used:

On deployment, it gets the following values:

Placeholder values like blob-3221 are removed and the custom prefixed name is injected.

Parameter file for the name without prefix.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With