Skip to content

Commit c1e818d

Browse files
authored
Merge pull request #1527 from sharmaharry/patch-1
Create Azure Manage WebJob
2 parents cae6e3b + 3df0e41 commit c1e818d

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"Id": "923532f4-1ee1-49db-b3b3-a8cab0d8986b",
3+
"Name": "Azure Manage WebJob",
4+
"Description": "This template can start, stop, or delete a web job",
5+
"ActionType": "Octopus.AzurePowerShell",
6+
"Version": 1,
7+
"CommunityActionTemplateId": null,
8+
"Packages": [],
9+
"Properties": {
10+
"Octopus.Action.Script.ScriptSource": "Inline",
11+
"Octopus.Action.Script.Syntax": "PowerShell",
12+
"Octopus.Action.Azure.AccountId": "#{Octopus.Action.Azure.AccountId}",
13+
"Octopus.Action.Script.ScriptBody": "$httpAction = 'POST'\n\nif ($WebJobAction -eq 'delete') {\n $httpAction = 'DELETE'\n}\n\n$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes((\"{0}:{1}\" -f $WebJobUserName,$WebJobPassword)))\n$apiUrl = \"https://$WebJobWebApp.scm.azurewebsites.net/api/$WebJobType/$WebJobName/$WebJobAction\"\nInvoke-RestMethod -Uri $apiUrl -Headers @{Authorization=(\"Basic {0}\" -f $base64AuthInfo)} -Method $httpAction -ContentType \"Application/Json\"",
14+
"OctopusUseBundledTooling": "False"
15+
},
16+
"Parameters": [
17+
{
18+
"Id": "c0de82c1-748a-4741-8380-e2e4660b80df",
19+
"Name": "WebJobWebApp",
20+
"Label": "Web App",
21+
"HelpText": "The Web App the Azure WebJob is hosted under.",
22+
"DefaultValue": "",
23+
"DisplaySettings": {
24+
"Octopus.ControlType": "SingleLineText"
25+
}
26+
},
27+
{
28+
"Id": "bae34daf-b130-4b5e-99df-a35ec1ab4a13",
29+
"Name": "WebJobUserName",
30+
"Label": "User Name",
31+
"HelpText": "The Username of the authentication to the Kudu Api.\n\nSee https://github.com/projectkudu/kudu/wiki/Deployment-credentials",
32+
"DefaultValue": "",
33+
"DisplaySettings": {
34+
"Octopus.ControlType": "SingleLineText"
35+
}
36+
},
37+
{
38+
"Id": "689302ce-9989-4aa8-8c5b-221d899b41b0",
39+
"Name": "WebJobPassword",
40+
"Label": "Password",
41+
"HelpText": "The Password of the authentication to the Kudu Api.\n\nSee https://github.com/projectkudu/kudu/wiki/Deployment-credentials",
42+
"DefaultValue": "",
43+
"DisplaySettings": {
44+
"Octopus.ControlType": "Sensitive"
45+
}
46+
},
47+
{
48+
"Id": "b87406da-59c7-400c-8d45-6e174b87660e",
49+
"Name": "WebJobAction",
50+
"Label": "Action",
51+
"HelpText": "The action to perform. Start, Stop, or Delete.",
52+
"DefaultValue": "",
53+
"DisplaySettings": {
54+
"Octopus.ControlType": "Select",
55+
"Octopus.SelectOptions": "start|Start\nstop|Stop\ndelete|Delete"
56+
}
57+
},
58+
{
59+
"Id": "f6b72bf8-fe1a-404d-98f2-3ea12d09e1b2",
60+
"Name": "WebJobType",
61+
"Label": "Job Type",
62+
"HelpText": "The type of job, Continuous or Triggered",
63+
"DefaultValue": "continuouswebjobs",
64+
"DisplaySettings": {
65+
"Octopus.ControlType": "Select",
66+
"Octopus.SelectOptions": "continuouswebjobs|Continuous\ntriggeredwebjobs|Triggered"
67+
}
68+
},
69+
{
70+
"Id": "727d450b-f3aa-4f80-9ae4-e3397e339bab",
71+
"Name": "WebJobName",
72+
"Label": "Job Name",
73+
"HelpText": "The name of the Job to act upon.",
74+
"DefaultValue": "",
75+
"DisplaySettings": {
76+
"Octopus.ControlType": "SingleLineText"
77+
}
78+
}
79+
],
80+
"StepPackageId": "Octopus.AzurePowerShell",
81+
"$Meta": {
82+
"ExportedAt": "2024-06-24T10:30:22.248Z",
83+
"OctopusVersion": "2023.3.13118",
84+
"Type": "ActionTemplate"
85+
},
86+
"LastModifiedBy": "Your GitHub Username",
87+
"Category": "other"
88+
}

0 commit comments

Comments
 (0)