Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.5k stars 4.93k forks source link

Cannot link Integration Account to Integration Service Environment #10725

Open jackofallops opened 3 years ago

jackofallops commented 3 years ago

Hi, I'm trying to allow Terraform users to place their Integration Accounts in Integration Service Environments. Currently on API version 2019-05-01 I'm getting the following:

StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidRequestContent" Message="The request content is not valid and could not be deserialized: 'Could not find member 'properties' on object of type 'IntegrationServiceEnvironmentReference'. Path 'properties.integrationServiceEnvironment.properties' when setting the ID in the properties structure here.

The ARM template generated from the portal suggests that the ID should actually be set one level higher, in a field that is (in the Go SDK), marked as READ ONLY:

{
    "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "name": {
            "type": "string"
        },
        "location": {
            "type": "string"
        },
        "sku": {
            "type": "string"
        },
        "integrationAccountApiVersion": {
            "type": "string",
            "defaultValue": "2016-06-01"
        },
        "integrationServiceEnvironmentId": {
            "type": "string"
        },
        "tags": {
            "type": "object",
            "defaultValue": {}
        }
    },
    "resources": [
        {
            "apiVersion": "[parameters('integrationAccountApiVersion')]",
            "name": "[parameters('name')]",
            "location": "[parameters('location')]",
            "tags": "[parameters('tags')]",
            "type": "Microsoft.Logic/IntegrationAccounts",
            "sku": {
                "name": "[parameters('sku')]"
            },
            "properties": {
                "integrationServiceEnvironment": {
                    "id": "[parameters('integrationServiceEnvironmentId')]"
                }
            }
        }
    ]
}

However, when doing so, the following error is received: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidRequestContent" Message="The integration service environment reference Id '<null>' is not valid."

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-logicapps-team.

tombuildsstuff commented 3 years ago

👋 is there any update on this?

ecfan commented 3 years ago

CC: @Azure/azure-logicapps-team

laveeshb commented 3 years ago

@jackofallops The ARM template looks correct. The error message suggests the value for parameter 'integrationServiceEnvironmentId' is null or incorrect. Can you provide the parameters you used to deploy this template? Please feel free to email me the parameters at laveeshb@microsoft.com (as the they could contain PII).

jackofallops commented 3 years ago

Hi @laveeshb - Thanks for the response. The example above was taken from the automation template generated by the portal, and is the basis for the work I'm doing to make the functionality available in Terraform. When using azure-sdk-for-go, this parameter is sent as per the structure above, and the '<null>' response received. I'll spin up another test and post the pertinent calls here (redacting anything sensitive) - Since this takes quite a few hours to create an ISE, this will be later today.