pulumi / pulumi-azure

A Microsoft Azure Pulumi resource package, providing multi-language access to Azure
Apache License 2.0
131 stars 50 forks source link

Azure LogicApps - Actions & Triggers should have description property #799

Closed mahalel closed 3 years ago

mahalel commented 3 years ago

Hi, thank you for this great software.

I am using Pulumi with Python for Azure LogicApps configuration.

I have noticed that neither Triggers or Actions have the Description property avaiable.

Example - for recurrence this is the json object (exported from Azure):

{
    "recurrence": {
        "frequency": "Hour",
        "interval": 1
    },
    "description": "This is a test description"
}

It would be nice if we could have the option to add this for each action, for the scenario where we want to document the action in detail.

Regards, Andrei.

stack72 commented 3 years ago

Hi @mahalel

Thanks for opening the issue here. So each of these resources accept a body which is a JSON string (like in your example) that you can pass the description

const exampleTriggerCustom = new azure.logicapps.TriggerCustom("exampleTriggerCustom", {
    logicAppId: exampleWorkflow.id,
    body: `{
  "recurrence": {
    "frequency": "Day",
    "interval": 1
  },
  "type": "Recurrence"
}
`,
});

The body can be passed a description as that is controlled by Azure not Pulumi. The Azure Go SDK (whcih the provider is based on under the hood) doesn't have support for this description either - jsut the body JSON string

Paul

mahalel commented 3 years ago

Got it!

Thank you for the prompt answer.

stack72 commented 3 years ago

Any time - please do let me know if that works (or doesn't) so we can close this out if necessary :)

Paul

mahalel commented 3 years ago

Howdy, this works so we can close this issue.

import pulumi
from pulumi import Output
from pulumi_azure import core, logicapps

la_test_delete = logicapps.Workflow("la-test-delete",
    location="australiaeast",
    name="la-test-delete",
    resource_group_name="API-Stuff",
    workflow_schema="https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    workflow_version="1.0.0.0")

example_trigger_custom = logicapps.TriggerCustom("rec-test",
    logic_app_id=la_test_delete.id,
    body="""{
  "recurrence": {
    "frequency": "Day",
    "interval": 1
  },
  "description": "This is a test description",
  "type": "Recurrence"
}
""")
stack72 commented 3 years ago

Fantastic! Thanks for circling back so fast :)