Post Request in ADF - azure-data-factory

I'm creating a pipeline in ADF that sends a post request, but it's returning the attached error.
Could you help what I might be doing wrong?
Below I put the code generated in the ADF for the post and the image with the error to facilitate the help.
What am I doing wrong, I can't identify my mistake.
Thank you all.
Error
Pipeline
I created the Web pipeline with the code below and it returned an error.
{
"name": "xxxx_xxxx",
"type": "WebActivity",
"dependsOn": [],
"policy": {
"timeout": "0.12:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"url": "https://xxxxxx/xxxxx/xxxx",
"connectVia": {
"referenceName": "AutoResolveIntegrationRuntime",
"type": "IntegrationRuntimeReference"
},
"method": "POST",
"body": {
"fornecedor": "string",
"tipoArquivo": "string",
"data": [
{
"id": 0,
"placa": "string",
"rastreadorNumeroSerie": "string",
"tipoEvento": "string",
"tempo": 0,
"rastreadorBateriaInternaAtiva": 0,
"rastreadorBateriaInternaTensao": 0,
"dataHoraEvento": "2022-12-24T14:23:14.865Z",
"gpsFixado": 0,
"latitudeInicio": 0,
"longitudeInicio": 0,
"latitudeFim": 0,
"longitudeFim": 0,
"velocidade": 0,
"altitude": 0,
"odometro": 0,
"bateriaExternaAtiva": 0,
"bateriaExternaTensao": 0,
"ignicao": 0,
"revGeoLogradouro": "string",
"revGeoFaixaNumeracao": "string",
"revGeoCep": "string",
"revGeoMunicipio": "string",
"revGeoUf": "string",
"horimetro": 0,
"sleep": 0,
"rpm": 0
}
]
}
}
}

Related

Liquid Mapping Failure in VS Code

Alright so I have a simple mapping and I'm using my self of shopify preview plugin for VS code to see what I'm doing in the code. But I'm not getting anything in the fields.
This is my Liquid Code
{
"contact":{
"matchKey": "{{content.Content.CrmId}}",
"matchKeyType": "{{content.Content.Owner}}"
}
}
I want to extract the information from the Json and create another json output schema.
Below is the input schema:
{
"content":{
"Name": "dwadwadwa",
"Version": "string",
"Sender": "TEST",
"Content": {
"OrderNumber": "string",
"OrderGroupId": 0,
"AffiliateId": "string",
"BillingCurrency": "string",
"CustomerId": "string",
"CrmId": "string",
"CustomerName": "string",
"HandlingTotal": 0,
"MarketId": "string",
"Name": "string",
"Owner": "string",
"OwnerOrg": "string",
"ShippingTotal": 0,
"Status": "string",
"SubTotal": 0,
"TaxTotal": 0,
"Total": 0,
"Modified": "string",
"Created": "string",
"Properties": [
{
"Key": "string",
"Value": "string"
}
],
"Forms": [
{
"ReturnComment": "string",
"ReturnType": "string",
"ReturnAuthCode": "string",
"OrderFormId": 0,
"Name": "string",
"ReceiptNumber": "string",
"BillingAddressId": "string",
"ShippingTotal": 0,
"HandlingTotal": 0,
"TaxTotal": 0,
"DiscountAmount": 0,
"SubTotal": 0,
"Total": 0,
"Status": "string",
"AuthorizedPaymentTotal": 0,
"CapturedPaymentTotal": 0,
"Properties": [
{
"Key": "string",
"Value": "string"
}
],
"Payments": [
{
"Amount": 0,
"AuthorizationCode": "string",
"CustomerName": "string",
"PaymentId": "string",
"PaymentMethodId": "string",
"PaymentMethodName": "string",
"PaymentTypeModel": "string",
"Status": "string",
"TransactionType": "string",
"ValidationCode": "string",
"Properties": [
{
"Key": "string",
"Value": "string"
}
]
}
],
"Shipments":
{
"ShipmentId": 0,
"ShippingMethodId": "string",
"ShippingMethodName": "string",
"ShippingTax": 0,
"ShippingAddressId": "string",
"ShipmentTrackingNumber": "string",
"ShippingDiscountAmount": 0,
"ShippingSubTotal": 0,
"ShippingTotal": 0,
"Status": "string",
"PrevStatus": "string",
"PickListId": "string",
"SubTotal": 0,
"WarehouseCode": "string",
"PickupPoint": "string",
"Properties": [
{
"Key": "string",
"Value": "string"
}
],
"DiscountsModel": [
{
"DiscountId": 0,
"DiscountAmount": 0,
"DiscountCode": "string",
"DiscountName": "string",
"DisplayMessage": "string",
"DiscountValue": 0
}
],
"LineItems": [
{
"LineItemId": 0,
"Code": "string",
"DisplayName": "string",
"PlacedPrice": 0,
"ExtendedPrice": 0,
"DiscountedPrice": 0,
"SalesTax": 0,
"TaxCategoryId": 0,
"Quantity": 0,
"ShippedQuantity": 0,
"ReturnQuantity": 0,
"InventoryTrackingStatus": "string",
"IsInventoryAllocated": true,
"IsGift": true,
"DeliveryInfo": "string",
"ProductUrl": "string",
"ImageUrl": "string",
"Properties": [
{
"Key": "string",
"Value": "string"
}
]
}
]
}
]
}
],
"OrderAddresses": [
{
"OrderGroupAddressId": 0,
"Name": "string",
"FirstName": "string",
"LastName": "string",
"Organization": "string",
"Line1": "string",
"Line2": "string",
"City": "string",
"State": "string",
"CountryCode": "string",
"CountryName": "string",
"PostalCode": "string",
"RegionCode": "string",
"RegionName": "string",
"DaytimePhoneNumber": "string",
"EveningPhoneNumber": "string",
"Email": "string",
"Properties": [
{
"Key": "string",
"Value": "string"
}
]
}
]
}
}
}
Anyone know what is wrong with this i'm kinda lost and cannot find anything on the internet.
This is my output btw
{
"contact":{
"matchKey": "",
"matchKeyType": ""
}
}

AWS DMS fails to migrate text columns between RDS Postgres

I have two RDS Postgres clusters in two separate AWS accounts on a set of paired VPCs, they can connect through the task instance just fine.
However, the task fails because of unique constraints. After I removed the constraints I see that the data inserted into my new cluster is missing all text columns data. So in reality it's not grabbing any text or lobs even though I have it set to full mode.
My end goal is really just a 1:1 copy of my rds cluster in my first account with ongoing replication until I switch over. I've turned on default debugging but not seeing any helpful errors.
This error doesn't make any sense to me though since I don't even have an events table.
2021-11-03T02:53:48:343248 [DATA_STRUCTURE ]E: SQLite general error. Code <19>, Message <UNIQUE constraint failed: events.identifier, events.eventType, events.detailMessage>. [1000505] (at_sqlite.c:525)
This is the only other warning that shows up in the logs.
2021-11-03T03:06:40:405809 [TASK_MANAGER ]W: Table 'public'.'bridge_types' (subtask 1 thread 1) is suspended (replicationtask.c:2527)
Here is my table mapping settings:
{
"rules": [
{
"rule-type": "selection",
"rule-id": "1",
"rule-name": "1",
"object-locator": {
"schema-name": "%",
"table-name": "bridge_types"
},
"rule-action": "include",
"filters": []
}
]
}
Here is my task settings:
{
"Logging": {
"EnableLogging": true,
"LogComponents": [
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "TRANSFORMATION"
},
{
"Severity": "LOGGER_SEVERITY_DETAILED_DEBUG",
"Id": "SOURCE_UNLOAD"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "IO"
},
{
"Severity": "LOGGER_SEVERITY_DETAILED_DEBUG",
"Id": "TARGET_LOAD"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "PERFORMANCE"
},
{
"Severity": "LOGGER_SEVERITY_DETAILED_DEBUG",
"Id": "SOURCE_CAPTURE"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "SORTER"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "REST_SERVER"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "VALIDATOR_EXT"
},
{
"Severity": "LOGGER_SEVERITY_DETAILED_DEBUG",
"Id": "TARGET_APPLY"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "TASK_MANAGER"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "TABLES_MANAGER"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "METADATA_MANAGER"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "FILE_FACTORY"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "COMMON"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "ADDONS"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "DATA_STRUCTURE"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "COMMUNICATION"
},
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "FILE_TRANSFER"
}
],
"CloudWatchLogGroup": "dms-tasks-db-test-replication",
"CloudWatchLogStream": "dms-task-ASPBCUAYMDE3TMD5HUZTMECM52RBD774RUSRIAA"
},
"StreamBufferSettings": {
"StreamBufferCount": 3,
"CtrlStreamBufferSizeInMB": 5,
"StreamBufferSizeInMB": 8
},
"ErrorBehavior": {
"FailOnNoTablesCaptured": true,
"ApplyErrorUpdatePolicy": "LOG_ERROR",
"FailOnTransactionConsistencyBreached": false,
"RecoverableErrorThrottlingMax": 1800,
"DataErrorEscalationPolicy": "SUSPEND_TABLE",
"ApplyErrorEscalationCount": 0,
"RecoverableErrorStopRetryAfterThrottlingMax": true,
"RecoverableErrorThrottling": true,
"ApplyErrorFailOnTruncationDdl": false,
"DataTruncationErrorPolicy": "LOG_ERROR",
"ApplyErrorInsertPolicy": "LOG_ERROR",
"ApplyErrorEscalationPolicy": "LOG_ERROR",
"RecoverableErrorCount": -1,
"DataErrorEscalationCount": 0,
"TableErrorEscalationPolicy": "STOP_TASK",
"RecoverableErrorInterval": 5,
"ApplyErrorDeletePolicy": "IGNORE_RECORD",
"TableErrorEscalationCount": 0,
"FullLoadIgnoreConflicts": true,
"DataErrorPolicy": "LOG_ERROR",
"TableErrorPolicy": "SUSPEND_TABLE"
},
"ValidationSettings": {
"ValidationPartialLobSize": 0,
"PartitionSize": 10000,
"RecordFailureDelayLimitInMinutes": 0,
"SkipLobColumns": false,
"FailureMaxCount": 10000,
"HandleCollationDiff": false,
"ValidationQueryCdcDelaySeconds": 0,
"ValidationMode": "ROW_LEVEL",
"TableFailureMaxCount": 1000,
"RecordFailureDelayInMinutes": 5,
"MaxKeyColumnSize": 8096,
"EnableValidation": true,
"ThreadCount": 5,
"RecordSuspendDelayInMinutes": 30,
"ValidationOnly": false
},
"FullLoadSettings": {
"CommitRate": 10000,
"StopTaskCachedChangesApplied": false,
"StopTaskCachedChangesNotApplied": true,
"MaxFullLoadSubTasks": 8,
"TransactionConsistencyTimeout": 600,
"CreatePkAfterFullLoad": false,
"TargetTablePrepMode": "DO_NOTHING"
},
"TargetMetadata": {
"ParallelApplyBufferSize": 0,
"ParallelApplyQueuesPerThread": 0,
"ParallelApplyThreads": 0,
"TargetSchema": "",
"InlineLobMaxSize": 0,
"ParallelLoadQueuesPerThread": 0,
"SupportLobs": true,
"LobChunkSize": 4096,
"TaskRecoveryTableEnabled": false,
"ParallelLoadThreads": 0,
"LobMaxSize": 0,
"BatchApplyEnabled": false,
"FullLobMode": true,
"LimitedSizeLobMode": false,
"LoadMaxFileSize": 0,
"ParallelLoadBufferSize": 0
},
"BeforeImageSettings": null,
"ControlTablesSettings": {
"historyTimeslotInMinutes": 5,
"HistoryTimeslotInMinutes": 5,
"StatusTableEnabled": false,
"SuspendedTablesTableEnabled": false,
"HistoryTableEnabled": false,
"ControlSchema": "",
"FullLoadExceptionTableEnabled": false
},
"LoopbackPreventionSettings": null,
"CharacterSetSettings": null,
"FailTaskWhenCleanTaskResourceFailed": false,
"ChangeProcessingTuning": {
"StatementCacheSize": 50,
"CommitTimeout": 1,
"BatchApplyPreserveTransaction": true,
"BatchApplyTimeoutMin": 1,
"BatchSplitSize": 0,
"BatchApplyTimeoutMax": 30,
"MinTransactionSize": 1000,
"MemoryKeepTime": 60,
"BatchApplyMemoryLimit": 500,
"MemoryLimitTotal": 1024
},
"ChangeProcessingDdlHandlingPolicy": {
"HandleSourceTableDropped": true,
"HandleSourceTableTruncated": true,
"HandleSourceTableAltered": true
},
"PostProcessingRules": null
}

How to get all the files from the Moodle assignment in a course?

I want to get all the files from an assignment in Moodle. Is there a way to get all the files?
When I call core_course_get_contents from my local Moodle instance as
http://localhost:8077/webservice/rest/server.php?wstoken=11e2d8b7f8e21ca1804e41e9cac5a816&wsfunction=core_course_get_contents&courseid=4&moodlewsrestformat=json
I receive the response as:
[
{
"id": 22,
"name": "General",
"visible": 1,
"summary": "",
"summaryformat": 1,
"section": 0,
"hiddenbynumsections": 0,
"uservisible": true,
"modules": []
},
{
"id": 23,
"name": "Introduction",
"visible": 1,
"summary": "",
"summaryformat": 1,
"section": 1,
"hiddenbynumsections": 0,
"uservisible": true,
"modules": [
{
"id": 44,
"url": "http://localhost:8077/mod/assign/view.php?id=44",
"name": "Assignment",
"instance": 3,
"contextid": 99,
"visible": 1,
"uservisible": true,
"visibleoncoursepage": 1,
"modicon": "http://localhost:8077/theme/image.php/boost/assign/1613571924/icon",
"modname": "assign",
"modplural": "Assignments",
"indent": 0,
"onclick": "",
"afterlink": null,
"customdata": "\"\"",
"noviewlink": false,
"completion": 1,
"completiondata": {
"state": 0,
"timecompleted": 0,
"overrideby": null,
"valueused": false
}
},
{
"id": 46,
"url": "http://localhost:8077/mod/resource/view.php?id=46",
"name": "test(.txt)",
"instance": 24,
"contextid": 102,
"visible": 1,
"uservisible": true,
"visibleoncoursepage": 1,
"modicon": "http://localhost:8077/theme/image.php/boost/core/1613571924/f/text-24",
"modname": "resource",
"modplural": "Files",
"indent": 0,
"onclick": "",
"afterlink": null,
"customdata": "\"a:1:{s:10:\\\"printintro\\\";i:1;}\"",
"noviewlink": false,
"completion": 1,
"completiondata": {
"state": 0,
"timecompleted": 0,
"overrideby": null,
"valueused": false
},
"contents": [
{
"type": "file",
"filename": "test.txt",
"filepath": "/",
"filesize": 935,
"fileurl": "http://localhost:8077/webservice/pluginfile.php/102/mod_resource/content/1/test.txt?forcedownload=1",
"timecreated": 1621949734,
"timemodified": 1621949744,
"sortorder": 1,
"mimetype": "text/plain",
"isexternalfile": false,
"userid": 2,
"author": "ABC",
"license": "unknown"
}
],
"contentsinfo": {
"filescount": 1,
"filessize": 935,
"lastmodified": 1621949744,
"mimetypes": [
"text/plain"
],
"repositorytype": ""
}
}
]
}
]
I want to get the files from the assignment. Is there a way to achieve this?

How to retrieve Forum/discussion attachments of a course in Moodle LMS?

I have to list all the attachments of a discussion in a course. I don't know how to retrieve all the attachments URLs in a forum/discussion in Moodle LMS.
My code is in c# and usually, I call the Moodle REST API as http://localhost:8077/webservice/rest/server.php?wstoken=11e2d8b7f8e21ca1804e41e9cac5a812&wsfunction=core_course_get_contents&courseid=4&moodlewsrestformat=json and I can get the fileurl for the course files.
Likewise, I would like to retrieve forum/discussion files but I don't see any fileurl or something similar.
I only see the response as below:
[
{
"id": 22,
"name": "General",
"visible": 1,
"summary": "",
"summaryformat": 1,
"section": 0,
"hiddenbynumsections": 0,
"uservisible": true,
"modules": []
},
{
"id": 23,
"name": "Introduction",
"visible": 1,
"summary": "",
"summaryformat": 1,
"section": 1,
"hiddenbynumsections": 0,
"uservisible": true,
"modules": [
{
"id": 46,
"url": "http://localhost:8077/mod/resource/view.php?id=46",
"name": "Everest (.txt)",
"instance": 24,
"contextid": 102,
"visible": 1,
"uservisible": true,
"visibleoncoursepage": 1,
"modicon": "http://localhost:8077/theme/image.php/boost/core/1613571924/f/text-24",
"modname": "resource",
"modplural": "Files",
"indent": 0,
"onclick": "",
"afterlink": null,
"customdata": "\"a:1:{s:10:\\\"printintro\\\";i:1;}\"",
"noviewlink": false,
"completion": 1,
"completiondata": {
"state": 0,
"timecompleted": 0,
"overrideby": null,
"valueused": false
},
"contents": [
{
"type": "file",
"filename": "Everest.txt",
"filepath": "/",
"filesize": 935,
"fileurl": "http://localhost:8077/webservice/pluginfile.php/102/mod_resource/content/1/Everest.txt?forcedownload=1",
"timecreated": 1621949734,
"timemodified": 1621949744,
"sortorder": 1,
"mimetype": "text/plain",
"isexternalfile": false,
"userid": 2,
"author": "DP Bhatt",
"license": "unknown"
}
],
"contentsinfo": {
"filescount": 1,
"filessize": 935,
"lastmodified": 1621949744,
"mimetypes": [
"text/plain"
],
"repositorytype": ""
}
},
{
"id": 47,
"url": "http://localhost:8077/mod/forum/view.php?id=47",
"name": "Forum",
"instance": 5,
"contextid": 112,
"visible": 1,
"uservisible": true,
"visibleoncoursepage": 1,
"modicon": "http://localhost:8077/theme/image.php/boost/forum/1613571924/icon",
"modname": "forum",
"modplural": "Forums",
"indent": 0,
"onclick": "",
"afterlink": null,
"customdata": "\"\"",
"noviewlink": false,
"completion": 1,
"completiondata": {
"state": 0,
"timecompleted": 0,
"overrideby": null,
"valueused": false
}
}
]
}
]
It would be great if someone guides me on the right path. Thank you very much in advance.

Commit Status not working with Continuous Deployment Trigger in Azure Release via API

We have an Azure Repository which triggers a Release-Pipeline every time something is pushed to the main branch.
When a Release is triggered it shows its status (succeeded) on the right side in the commits in Azure Repos like on the following Picture:
It even shows which stage is already promoted etc. which is awesome. This all works fine when configuring the Release Pipeline Manually with the following CD-Trigger Configuration:
Even when exporting the Pipeline JSON file and reimporting it everything works as expected.
However, when creating the Release with the exact same Settings via API i don't see the Status of the Release. The trigger itself works as expected but the status in the commits is simply not there:
Does someone know which exact Setting in the Release-Pipeline.json is responsible for this status?
Here are some parts of the json body I send via API which might be missing something?
Edit: A few more information needed i guess. I use a cli-tool to create the body and send the api request. The values are templated.
The template gets its values either from previous api calls or from user inputs. Here is the complete template. I created it based on the manually configured relase-pipeline JSON (Which works fine and shows the status i want).
{
"name": "{{.BuildProjectName}}/{{.BuildServiceName}}",
"path": "\\",
"isDeleted": false,
"source": "restApi",
"releaseNameFormat": "{{.BuildServiceName}}-$(rev:r)",
"properties": {
"DefinitionCreationSource": {
"$type": "System.String",
"$value": "ReleaseNew"
},
"IntegrateBoardsWorkItems": {
"$type": "System.String",
"$value": "False"
},
"IntegrateJiraWorkItems": {
"$type": "System.String",
"$value": "false"
}
},
"artifacts": [
{
"sourceId": "{{.BuildProjectID}}:{{.BuildRepoID}}",
"type": "Git",
"alias": "BuildRepo",
"definitionReference": {
"branches": {
"id": "{{.BuildRepoDefaultBranch}}",
"name": "{{.BuildRepoDefaultBranch}}"
},
"checkoutNestedSubmodules": {
"id": "True",
"name": "Any nested submodules within"
},
"defaultVersionType": {
"id": "latestFromBranchType",
"name": "Latest from the default branch"
},
"definition": {
"id": "{{.BuildRepoID}}",
"name": "{{.BuildServiceName}}"
},
"project": {
"id": "{{.BuildProjectID}}",
"name": "{{.BuildProjectName}}"
}
},
"isPrimary": true,
"isRetained": false
},
{
"type": "Git",
"alias": "FluxDeployScript",
"definitionReference": {
"branches": {
"id": "master",
"name": "master"
},
"checkoutNestedSubmodules": {
"id": "True",
"name": "Any nested submodules within"
},
"defaultVersionType": {
"id": "latestFromBranchType",
"name": "Latest from the default branch"
},
"definition": {
"id": "black-washed",
"name": "azure-pipeline-templates"
},
"project": {
"id": "black-washed",
"name": "Operations"
}
},
"isRetained": false
},
{
"type": "Build",
"alias": "BuildPipeline",
"definitionReference": {
"defaultVersionType": {
"id": "latestType",
"name": "Latest"
},
"definition": {
"id": "{{.BuildPipelineID}}",
"name": "{{.BuildServiceName}}"
},
"IsMultiDefinitionType": {
"id": "False",
"name": "False"
},
"project": {
"id": "{{.BuildProjectID}}",
"name": "{{.BuildProjectName}}"
}
},
"isRetained": false
}
],
"environments": [
{
"name": "dev",
"rank": 1,
"conditions": [
{
"name": "ReleaseStarted",
"conditionType": 1,
"value": ""
}
],
"deployPhases": [
{
"rank": 1,
"phaseType": 1,
"name": "Agent job",
"refName": null,
"deploymentInput": {
"queueId": "{{.QueueID}}",
"agentSpecification": {
"identifier": "ubuntu-20.04"
}
},
"workflowTasks": [
{
"environment": {},
"taskId": "2a6ca863-f2ce-4f4d-8bcb-15e64608ec4b",
"version": "1.*",
"name": "Download flux creds",
"refName": "fluxCreds",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"secureFile": "black-washed",
"retryCount": "8",
"socketTimeout": ""
}
},
{
"environment": {
"USER_EMAIL": "{{.ApproverMail}}",
"ENVIRONMENT": "$(Release.EnvironmentName)",
"DESCRIPTION": "$(Release.ReleaseDescription)",
"URL": "$(Release.ReleaseWebURL)",
"PROJECT": "{{.BuildProjectName}}",
"CONTAINER": "{{.BuildServiceName}}",
"TAG": "$(Release.Artifacts.BuildPipeline.BuildNumber)",
"REPOSITORY": "finodigital.azurecr.io",
"WORKLOAD_TYPE": "deployment",
"NAMESPACE": "{{.BuildProjectName}}",
"WORKLOAD_NAME": "{{.BuildProjectName}}-{{.BuildServiceName}}",
"USER_NAME": "{{.ApproverName}}",
"FLUX_CREDS": "$(fluxCreds.secureFilePath)"
},
"taskId": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"version": "3.*",
"name": "Bash Script",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"targetType": "filePath",
"filePath": "$(System.DefaultWorkingDirectory)/FluxDeployScript/flux-release.sh",
"arguments": "",
"workingDirectory": "",
"failOnStderr": "false",
"noProfile": "true",
"noRc": "true"
}
}
]
}
],
"retentionPolicy": {
"daysToKeep": 30,
"releasesToKeep": 3,
"retainBuild": true
},
"preDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": true,
"isNotificationOn": false
}
],
"approvalOptions": {
"requiredApproverCount": null,
"releaseCreatorCanBeApprover": false,
"autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false,
"enforceIdentityRevalidation": false,
"timeoutInMinutes": 0,
"executionOrder": 1
}
},
"postDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": true,
"isNotificationOn": false
}
],
"approvalOptions": {
"requiredApproverCount": null,
"releaseCreatorCanBeApprover": false,
"autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false,
"enforceIdentityRevalidation": false,
"timeoutInMinutes": 0,
"executionOrder": 2
}
}
},
{
"name": "test",
"rank": 2,
"conditions": [
{
"name": "dev",
"conditionType": 2,
"value": "4"
}
],
"deployPhases": [
{
"rank": 1,
"phaseType": 1,
"name": "Agent job",
"refName": null,
"deploymentInput": {
"queueId": "{{.QueueID}}",
"agentSpecification": {
"identifier": "ubuntu-20.04"
}
},
"workflowTasks": [
{
"environment": {},
"taskId": "2a6ca863-f2ce-4f4d-8bcb-15e64608ec4b",
"version": "1.*",
"name": "Download flux creds",
"refName": "fluxCreds",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"secureFile": "black-washed",
"retryCount": "8",
"socketTimeout": ""
}
},
{
"environment": {
"USER_EMAIL": "{{.ApproverMail}}",
"ENVIRONMENT": "$(Release.EnvironmentName)",
"DESCRIPTION": "$(Release.ReleaseDescription)",
"URL": "$(Release.ReleaseWebURL)",
"PROJECT": "{{.BuildProjectName}}",
"CONTAINER": "{{.BuildServiceName}}",
"TAG": "$(Release.Artifacts.BuildPipeline.BuildNumber)",
"REPOSITORY": "finodigital.azurecr.io",
"WORKLOAD_TYPE": "deployment",
"NAMESPACE": "{{.BuildProjectName}}",
"WORKLOAD_NAME": "{{.BuildProjectName}}-{{.BuildServiceName}}",
"USER_NAME": "{{.ApproverName}}",
"FLUX_CREDS": "$(fluxCreds.secureFilePath)"
},
"taskId": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"version": "3.*",
"name": "Bash Script",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"targetType": "filePath",
"filePath": "$(System.DefaultWorkingDirectory)/FluxDeployScript/flux-release.sh",
"arguments": "",
"workingDirectory": "",
"failOnStderr": "false",
"noProfile": "true",
"noRc": "true"
}
}
]
}
],
"retentionPolicy": {
"daysToKeep": 30,
"releasesToKeep": 3,
"retainBuild": true
},
"preDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": false,
"isNotificationOn": false,
"approver": {
"displayName": null,
"id": "{{.ApproverID}}"
}
}
],
"approvalOptions": {
"requiredApproverCount": null,
"releaseCreatorCanBeApprover": false,
"autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false,
"enforceIdentityRevalidation": false,
"timeoutInMinutes": 0,
"executionOrder": 1
}
},
"postDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": true,
"isNotificationOn": false
}
],
"approvalOptions": {
"requiredApproverCount": null,
"releaseCreatorCanBeApprover": false,
"autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false,
"enforceIdentityRevalidation": false,
"timeoutInMinutes": 0,
"executionOrder": 2
}
}
},
{
"name": "prod",
"rank": 3,
"conditions": [
{
"name": "test",
"conditionType": 2,
"value": "4"
}
],
"deployPhases": [
{
"rank": 1,
"phaseType": 1,
"name": "Agent job",
"refName": null,
"deploymentInput": {
"queueId": "{{.QueueID}}",
"agentSpecification": {
"identifier": "ubuntu-20.04"
}
},
"workflowTasks": [
{
"environment": {},
"taskId": "2a6ca863-f2ce-4f4d-8bcb-15e64608ec4b",
"version": "1.*",
"name": "Download flux creds",
"refName": "fluxCreds",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"secureFile": "black-wahsed",
"retryCount": "8",
"socketTimeout": ""
}
},
{
"environment": {
"USER_EMAIL": "{{.ApproverMail}}",
"ENVIRONMENT": "$(Release.EnvironmentName)",
"DESCRIPTION": "$(Release.ReleaseDescription)",
"URL": "$(Release.ReleaseWebURL)",
"PROJECT": "{{.BuildProjectName}}",
"CONTAINER": "{{.BuildServiceName}}",
"TAG": "$(Release.Artifacts.BuildPipeline.BuildNumber)",
"REPOSITORY": "finodigital.azurecr.io",
"WORKLOAD_TYPE": "deployment",
"NAMESPACE": "{{.BuildProjectName}}",
"WORKLOAD_NAME": "{{.BuildProjectName}}-{{.BuildServiceName}}",
"USER_NAME": "{{.ApproverName}}",
"FLUX_CREDS": "$(fluxCreds.secureFilePath)"
},
"taskId": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"version": "3.*",
"name": "Bash Script",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"targetType": "filePath",
"filePath": "$(System.DefaultWorkingDirectory)/FluxDeployScript/flux-release.sh",
"arguments": "",
"workingDirectory": "",
"failOnStderr": "false",
"noProfile": "true",
"noRc": "true"
}
}
]
}
],
"retentionPolicy": {
"daysToKeep": 30,
"releasesToKeep": 3,
"retainBuild": true
},
"preDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": false,
"isNotificationOn": false,
"approver": {
"displayName": null,
"id": "{{.ApproverID}}"
}
}
],
"approvalOptions": {
"requiredApproverCount": null,
"releaseCreatorCanBeApprover": false,
"autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false,
"enforceIdentityRevalidation": false,
"timeoutInMinutes": 0,
"executionOrder": 1
}
},
"postDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": true,
"isNotificationOn": false
}
],
"approvalOptions": {
"requiredApproverCount": null,
"releaseCreatorCanBeApprover": false,
"autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped": false,
"enforceIdentityRevalidation": false,
"timeoutInMinutes": 0,
"executionOrder": 2
}
}
}
],
"triggers": [
{
"branchFilters": [
"{{.BuildRepoDefaultBranch}}"
],
"alias": "BuildRepo",
"triggerType": 3
}
]
According to your description, I tested it and everything works as expected.
Steps:
Get the release definition via the REST API Definitions - Get and copy the response body.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions/{definitionId}?api-version=6.1-preview.4
Create the new release pipeline via the REST API Definitions - Create
POST https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?api-version=6.1-preview.4
Copy the response body and rename the field name to New release pipeline2, then mark it as request body.
I am using PostMan.
Result:
Update1
It seems that you are missing the field environmentOptions field in the request body, which contains publishDeploymentStatus, which controls the feature you are missing.
If you do not configure it or set the value to false, you will not see the Status of the Release in the commit page.
"environmentOptions": {
"emailNotificationType": "OnlyOnFailure",
"emailRecipients": "release.environment.owner;release.creator",
"skipArtifactsDownload": false,
"timeoutInMinutes": 0,
"enableAccessToken": false,
"publishDeploymentStatus": false,
"badgeEnabled": false,
"autoLinkWorkItems": false,
"pullRequestDeploymentEnabled": false
},
Result: