jeffhollan / LogicAppTemplateCreator

Script to convert Logic Apps into templates for deployment
MIT License
143 stars 74 forks source link

Blank connection when deployed? #33

Closed joeyeng closed 5 years ago

joeyeng commented 6 years ago

After deploying the generated template my connection had blank values:

"$connections": {
        "value": {
            "azureblob_1": {
                "connectionId": "",
                "connectionName": "",
                "id": ""
            }
        }
    }

Here's how it was defined in the template:

"parameters": {
          "$connections": {
            "value": {
              "azureblob-1": {
                "id": "[concat('/subscriptions/',subscription().subscriptionId,'/providers/Microsoft.Web/locations/',parameters('logicAppLocation'),'/managedApis/azureblob')]",
                "connectionId": "[resourceId('Microsoft.Web/connections', parameters('azureblob-1_name'))]",
                "connectionName": "[parameters('azureblob-1_name')]"
              }
            }
          }
        }

Did I do something wrong or is this a known limitation?

MLogdberg commented 6 years ago

Hi, not sure exactly how you mean, was the lower code snippet how the ARM template looked like when deploying? Since that seems correct according too me.

joeyeng commented 6 years ago

The upper snippet is how it looks in code view in the deployed LA. The lower snippet is what was generated by the tool.

On Fri, Aug 31, 2018, 12:56 AM Mattias Lögdberg notifications@github.com wrote:

Hi, not sure exactly how you mean, was the lower code snippet how the ARM template looked like when deploying? Since that seems correct according too me.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jeffhollan/LogicAppTemplateCreator/issues/33#issuecomment-417584273, or mute the thread https://github.com/notifications/unsubscribe-auth/AHoUIscfWFz0pWhnOGC4c0_qFd6SEgbLks5uWOxIgaJpZM4WSbGJ .

MLogdberg commented 6 years ago

Wow that was a new one, never seen that before... Is it the same if you try a new Logic App? Any special restrictions that you have? Using power shell to deploy or VSTS?

joeyeng commented 5 years ago

This was a new LA (first time deploying it to this subscription and resource group at least). I don't know of any special restrictions (I wasn't the one who created the resource group).. anything I should look for in particular? Using VSTS to deploy.

The azureblob_1 api connection resource itself looks good. It has a connected status and it's in the expected region (same as the logic app).

joeyeng commented 5 years ago

@MLogdberg Looking at the workflow definition of the generated template I see the connection referred to as azureblob_1: @parameters('$connections')['azureblob_1']['connectionId'], but the parameters lists the name as azureblob-1. One uses underscore and one uses dash. This seems like a problem. Or is that okay?

joeyeng commented 5 years ago

Yep, that was the problem. I changed them to match and now my LA is fixed.

So the tool created a parameter for the connection name:

"azureblob-1_name": {
      "value": "azureblob-1"
    }

The question is why did the dash get converted to an underscore.

joeyeng commented 5 years ago

@MLogdberg I've got a fix. The problem happens when the connection parameter name is different than the "connectionName". Very confusing, but yea. PR coming soon.

MLogdberg commented 5 years ago

Sounds good!

joeyeng commented 5 years ago

PR https://github.com/jeffhollan/LogicAppTemplateCreator/pull/35