Обновленный ответ и обходной путь
К сожалению, несмотря на то, что документация API предполагает, что это возможно, вы не можете использовать setState для обновления триггера любого типа, собственного или управляемого, включенного или нет.
{"error":{"code":"WorkflowTriggerSetStateNotSupported","message":"The workflow trigger 'Recurrence' of type 'Recurrence' does not support the set state action."}}
{"error":{"code":"WorkflowTriggerSetStateNotSupported","message":"The workflow trigger 'sbAuto' of type 'ApiConnection' does not support the set state action."}}
Вы также не можетеиспользуйте глагол PATCH для обновления рабочего процесса:
{"error":{"code":"PatchWorkflowPropertiesNotSupported","message":"The request to patch workflow 'XXXXXXX' is not supported. None of the fields inside the properties object can be patched."}}
Я поднял эту проблему в Microsoft.
Однако ...
Что возможно возможно, используется глагол PUT для обновления рабочего процесса.
Для этого лучше всего извлечь рабочий процесс с использованием глагола GET, обновить объект повторения JSON и переиздатьиспользуя PUT (Создать или Обновить).
В моем примере ниже приведено определение созданного мною рабочего процесса tempotestla .
Запрос:
GET https://management.azure.com/subscriptions/651a2541-8d19-42a0-85fe-89a9eee81c48/resourceGroups/TechSouth/providers/Microsoft.Logic/workflows/tempotestla?api-version=2016-06-01 HTTP/1.1
User-Agent: Fiddler
Host: management.azure.com
Content-Type: application/json
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Length: 0
Ответ:
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 1431
Content-Type: application/json; charset=utf-8
Expires: -1
Vary: Accept-Encoding
x-ms-request-id: uksouth:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-resource-requests: 19999
x-ms-correlation-request-id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
x-ms-routing-request-id: UKSOUTH2:20191022T160012Z:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
X-Content-Type-Options: nosniff
Date: Tue, 22 Oct 2019 16:00:11 GMT
{
"properties":{
"provisioningState":"Succeeded",
"createdTime":"2019-10-22T13:27:18.8425031Z",
"changedTime":"2019-10-22T15:59:39.3684114Z",
"state":"Disabled",
"version":"xxxxxxxxxxxxxxxxxxxx",
"accessEndpoint":"https://prod-00.uksouth.logic.azure.com:443/workflows/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"definition":{
"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion":"1.0.0.0",
"parameters":{
},
"triggers":{
"Recurrence":{
"recurrence":{
"frequency":"Hour",
"interval":5
},
"type":"Recurrence"
}
},
"actions":{
"Terminate":{
"runAfter":{
},
"type":"Terminate",
"inputs":{
"runStatus":"Succeeded"
}
}
},
"outputs":{
}
},
"parameters":{
},
"endpointsConfiguration":{
"workflow":{
"outgoingIpAddresses":[
{
"address":"51.140.74.14"
},
{
"address":"51.140.73.85"
},
{
"address":"51.140.78.44"
},
{
"address":"51.140.137.190"
},
{
"address":"51.140.153.135"
},
{
"address":"51.140.28.225"
},
{
"address":"51.140.142.28"
},
{
"address":"51.140.158.24"
}
],
"accessEndpointIpAddresses":[
{
"address":"51.140.79.109"
},
{
"address":"51.140.78.71"
},
{
"address":"51.140.84.39"
},
{
"address":"51.140.155.81"
}
]
},
"connector":{
"outgoingIpAddresses":[
{
"address":"51.140.80.51"
},
{
"address":"51.140.148.0/28"
}
]
}
}
},
"id":"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxxxx/providers/Microsoft.Logic/workflows/tempotestla",
"name":"tempotestla",
"type":"Microsoft.Logic/workflows",
"location":"uksouth",
"tags":{
}
}
Это страница обзора моего рабочего процесса:
Отсюда, если вы используете объектно-ориентированный код или сценарий, вы можете десериализовать тело ответа и изменить интервал:
objResponse.properties.definition.triggers.<TriggerType>.<TriggerName>.frequency = "Minute"
Затем выполните повторную сериализацию вашего объекта и отправьте его обратно. к API в запросе PUT. Здесь я меняю часы на дни:
PUT https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/xxxxxxxxx/providers/Microsoft.Logic/workflows/tempotestla?api-version=2016-06-01 HTTP/1.1
User-Agent: Fiddler
Host: management.azure.com
Content-Type: application/json
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Length: 1534
{
"properties":{
"provisioningState":"Succeeded",
"createdTime":"2019-10-22T15:25:16.1635472Z",
"changedTime":"2019-10-22T15:25:16.153712Z",
"state":"Disabled",
"version":"08586298489693318400",
"accessEndpoint":"https://prod-00.uksouth.logic.azure.com:443/workflows/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"definition":{
"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion":"1.0.0.0",
"parameters":{
},
"triggers":{
"Recurrence":{
"recurrence":{
"frequency":"Day",
"interval":5
},
"type":"Recurrence"
}
},
"actions":{
"Terminate":{
"runAfter":{
},
"type":"Terminate",
"inputs":{
"runStatus":"Succeeded"
}
}
},
"outputs":{
}
},
"parameters":{
},
},
"id":"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxxxx/providers/Microsoft.Logic/workflows/tempotestla",
"name":"tempotestla",
"type":"Microsoft.Logic/workflows",
"location":"uksouth",
"tags":{
}
}
Вы должны получить обновленный объект обратно в теле ответа.
Вот моя сводная страница рабочего процесса после выдачи запроса:
Надеюсь, это поможет.