title: Updating trigger frequency of Azure Logic App using API
body: <p>I am trying to update the recurrence frequency and interval of a Logic App using <a href="https://www.nuget.org/packages/Microsoft.Azure.Management.Logic/" rel="nofollow noreferrer">Azure Logic SDK</a> and it is failing with this error message </p>
  
  <blockquote>
    <p><strong>Microsoft.Rest.Azure.CloudException</strong>: The request to patch workflow 'kk-test-logic-app' is not supported.
    None of the fields inside the properties object can be patched.</p>
  </blockquote>
  
  <p>Here is a code snippet showing what I am trying to do.</p>
  
  <pre><code>    var workflow = await _client.Value.Workflows.GetAsync(resourceGroupName, workflowName);
  
      dynamic workflowDefinition = workflow.Definition;
      workflowDefinition.triggers[triggerName]["recurrence"] = JToken.FromObject(new { frequency = triggerFrequency, interval = triggerInterval });
  
      await _client.Value.Workflows.UpdateAsync(resourceGroupName, workflowName, workflow);
  </code></pre>
  
  <p>where _client is <code>Lazy&lt;LogicManagementClient&gt;</code>.</p>
  
  <p>Here is the definition of the trigger I am trying to update (got using Fiddler): </p>
  
  <pre><code>  "triggers": {
      "When_a_new_email_arrives": {
        "recurrence": {
          "frequency": "Hour",
          "interval": 2
        },
        "splitOn": "@triggerBody()?.value",
        "type": "ApiConnection",
        "inputs": {
          "host": {
            "api": {
              "runtimeUrl": "https://logic-apis-southindia.azure-apim.net/apim/office365"
            },
            "connection": {
              "name": "@parameters('$connections')['office365']['connectionId']"
            }
          },
          "method": "get",
          "path": "/Mail/OnNewEmail",
          "queries": {
            "folderPath": "Inbox",
            "importance": "Any"
          }
        }
      }
    }
  </code></pre>
  
  <p>Note that I am able to successfully retrieve the workflows, workflowRuns, workflowTriggers etc. Only the update operation is failing. Any ideas on how to update properties of workflows using the SDK? </p>
  
  <p><strong>UPDATE:</strong>
  As pointed out by Amor-MSFT in the comments below, this is a defect and as a workaround, I am currently using CreateOrUpdateAsync instead of UpdateAsync. A <a href="https://github.com/Azure/azure-sdk-for-net/issues/3349" rel="nofollow noreferrer">new defect</a> has been created in GitHub to get this to the attention of the SDK development team. </p>