Azure / Azure/azure-powershell
New-AzureRmLogicApp: The integration account id must be provided in the 'integrationAccount' property of the workflow
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Cmdlet(s)
New-AzureRmLogicApp
### PowerShell Version
5.1.14393.1884
### Module Version
Get-Command New-AzureRMLogicApp
CommandType Name Version Source
Cmdlet New-AzureRmLogicApp 4.0.0 AzureRM.LogicApp
### OS Version
10.0.14393.1884
### Description
Note: I'm not sure whether this fault is with the PowerShell CMDlets or the underlying SDK.
Running the command:
```
New-AzureRmLogicApp -ResourceGroupName "{redacted}" -Name "test" -Location "West Europe" -DefinitionFilePath app.json -IntegrationAccountId "/subscriptions/{redacted}/resourceGroups/{redacted/providers/Microsoft.Logic/integrationAccounts/test"
```
errors with
**New-AzureRmLogicApp : The integration account id must be provided in the 'integrationAccount' property of the workflow 'test'.**
This is the definition I've put together to demonstrate this issue, the same thing happens with more complete definitions.
```
{
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"triggers": {},
"actions": {},
"outputs": {}
}
```
In the debug output, you can see that for the request to the logic app API the integration account property seems to not be properly set.
`"integrationAccount": {}`
should presumably be
`"integrationAccount": { "id": "theid"}`
There might be something else at play, but it seems that this might due to a problem with JSON serialization?
### Debug Output
```
HTTP Method:
PUT
Absolute Uri:
https://management.azure.com/subscriptions/{redacted}/resourceGroups/{redacted}/providers/Microsoft
.Logic/workflows/test?api-version=2016-06-01
Headers:
x-ms-client-request-id : 0c9e3c93-81e8-450b-9405-a90cdff77b35
accept-language : en-US
Body:
{
"properties": {
"state": "Enabled",
"integrationAccount": {},
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"triggers": {},
"actions": {},
"outputs": {}
}
},
"location": "West Europe"
}
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
BadRequest
Headers:
Pragma : no-cache
x-ms-request-id : westeurope:6d4a66a4-0530-4d60-ba50-3b24bcb5e58a
Strict-Transport-Security : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-writes: 1196
x-ms-correlation-request-id : 3af26936-f021-4bff-857b-bf107a84645b
x-ms-routing-request-id : UKWEST:20180105T105016Z:3af26936-f021-4bff-857b-bf107a84645b
Cache-Control : no-cache
Date : Fri, 05 Jan 2018 10:50:15 GMT
Body:
{
"error": {
"code": "InvalidRequestContent",
"message": "The integration account id must be provided in the 'integrationAccount' property of the workflow 'test'."
}
}
```
### Script/Steps for Reproduction
```
New-AzureRmResourceGroup -Name "{redacted}" -Location "West Europe"
New-AzureRmIntegrationAccount -ResourceGroupName "{redacted}" -Name "test" -Location "West Europe" -Sku "Standard"
New-AzureRmLogicApp -ResourceGroupName "{redacted}" -Name "test" -Location "West Europe" -DefinitionFilePath app.json -IntegrationAccountId "/subscriptions/{redacted}/resourceGroups/{redacted}/providers/Microsoft.Logic/integrationAccounts/test"
```
Contributor guide
Assessment
This issue has not been assessed yet.