Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vithati committed Oct 22, 2019
2 parents 1b7172d + c011b6a commit 09ca9a4
Show file tree
Hide file tree
Showing 55 changed files with 680 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Tasks/AzureAppServiceManageV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 61
"Patch": 62
},
"minimumAgentVersion": "1.102.0",
"instanceNameFormat": "$(Action): $(WebAppName)",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureAppServiceManageV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 61
"Patch": 62
},
"minimumAgentVersion": "1.102.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 154,
"Patch": 10
"Patch": 11
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 154,
"Patch": 10
"Patch": 11
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 154,
"Patch": 10
"Patch": 11
},
"preview": true,
"demands": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 154,
"Patch": 10
"Patch": 11
},
"preview": true,
"demands": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"loc.friendlyName": "Azure Functions on Kubernetes",
"loc.friendlyName": "Azure Function on Kubernetes",
"loc.helpMarkDown": "[Learn more about this task](https://aka.ms/func-k8s) or [see Azure Functions on Kubernetes with KEDA](https://docs.microsoft.com/en-us/azure/azure-functions/functions-kubernetes-keda) or [check out sample-hello-world-azure-functions](https://github.com/kedacore/sample-hello-world-azure-functions)",
"loc.description": "Deploy Azure functions to Kubernetes cluster.",
"loc.description": "Deploy Azure function to Kubernetes cluster.",
"loc.instanceNameFormat": "Func on K8s - deploy",
"loc.group.displayName.serviceConnections": "Service Connections",
"loc.group.displayName.commands": "Commands",
Expand Down
10 changes: 6 additions & 4 deletions Tasks/AzureFunctionOnKubernetesV0/task.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "FD1AA5B9-400C-4F4B-9C0B-069BA74E53C6",
"name": "AzureFunctionsOnKubernetes",
"friendlyName": "Azure Functions on Kubernetes",
"description": "Deploy Azure functions to Kubernetes cluster.",
"name": "AzureFunctionOnKubernetes",
"friendlyName": "Azure Function on Kubernetes",
"description": "Deploy Azure function to Kubernetes cluster.",
"helpUrl": "https://aka.ms/func-k8s",
"helpMarkDown": "[Learn more about this task](https://aka.ms/func-k8s) or [see Azure Functions on Kubernetes with KEDA](https://docs.microsoft.com/en-us/azure/azure-functions/functions-kubernetes-keda) or [check out sample-hello-world-azure-functions](https://github.com/kedacore/sample-hello-world-azure-functions)",
"category": "Deploy",
Expand All @@ -15,7 +15,7 @@
"version": {
"Major": 0,
"Minor": 160,
"Patch": 3
"Patch": 4
},
"demands": [],
"groups": [
Expand Down Expand Up @@ -110,8 +110,10 @@
"messages": {
"AllContainersNotInReadyState": "All the containers are not in a ready state.",
"CouldNotDeterminePodStatus": "Could not determine the pod's status due to the error: %s",
"CouldNotDetermineServiceStatus": "Could not determine the service %s status due to the error: %s",
"FileContentSynced": "Synced the file content to the disk. The content is %s.",
"NoDataWrittenOnFile": "No data was written into the file %s",
"ServiceExternalIP": "service %s external IP is %s",
"WritingDockerConfigToTempFile": "Writing Docker config to temp file. File path: %s, Docker config: %s"
}
}
6 changes: 4 additions & 2 deletions Tasks/AzureFunctionOnKubernetesV0/task.loc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "FD1AA5B9-400C-4F4B-9C0B-069BA74E53C6",
"name": "AzureFunctionsOnKubernetes",
"name": "AzureFunctionOnKubernetes",
"friendlyName": "ms-resource:loc.friendlyName",
"description": "ms-resource:loc.description",
"helpUrl": "https://aka.ms/func-k8s",
Expand All @@ -15,7 +15,7 @@
"version": {
"Major": 0,
"Minor": 160,
"Patch": 3
"Patch": 4
},
"demands": [],
"groups": [
Expand Down Expand Up @@ -110,8 +110,10 @@
"messages": {
"AllContainersNotInReadyState": "ms-resource:loc.messages.AllContainersNotInReadyState",
"CouldNotDeterminePodStatus": "ms-resource:loc.messages.CouldNotDeterminePodStatus",
"CouldNotDetermineServiceStatus": "ms-resource:loc.messages.CouldNotDetermineServiceStatus",
"FileContentSynced": "ms-resource:loc.messages.FileContentSynced",
"NoDataWrittenOnFile": "ms-resource:loc.messages.NoDataWrittenOnFile",
"ServiceExternalIP": "ms-resource:loc.messages.ServiceExternalIP",
"WritingDockerConfigToTempFile": "ms-resource:loc.messages.WritingDockerConfigToTempFile"
}
}
2 changes: 1 addition & 1 deletion Tasks/AzureKeyVaultV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 1,
"Minor": 155,
"Patch": 4
"Patch": 5
},
"demands": [],
"minimumAgentVersion": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureKeyVaultV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 1,
"Minor": 155,
"Patch": 4
"Patch": 5
},
"demands": [],
"minimumAgentVersion": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureMonitorAlertsV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 0,
"Minor": 159,
"Patch": 0
"Patch": 1
},
"minimumAgentVersion": "2.111.0",
"instanceNameFormat": "Configure Azure Alerts : $(ResourceName)",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureMonitorAlertsV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 0,
"Minor": 159,
"Patch": 0
"Patch": 1
},
"minimumAgentVersion": "2.111.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureMysqlDeploymentV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 156,
"Patch": 11
"Patch": 12
},
"demands": [],
"minimumAgentVersion": "1.100.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureMysqlDeploymentV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 156,
"Patch": 11
"Patch": 12
},
"demands": [],
"minimumAgentVersion": "1.100.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 4,
"Minor": 159,
"Patch": 2
"Patch": 3
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 4,
"Minor": 159,
"Patch": 2
"Patch": 3
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureResourceGroupDeploymentV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 2,
"Minor": 157,
"Patch": 4
"Patch": 5
},
"demands": [],
"minimumAgentVersion": "2.119.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureResourceGroupDeploymentV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 2,
"Minor": 157,
"Patch": 4
"Patch": 5
},
"demands": [],
"minimumAgentVersion": "2.119.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureResourceManagerTemplateDeploymentV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 3,
"Minor": 1,
"Patch": 0
"Patch": 1
},
"preview": "true",
"demands": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 3,
"Minor": 1,
"Patch": 0
"Patch": 1
},
"preview": "true",
"demands": [],
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeploymentV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 4,
"Minor": 157,
"Patch": 5
"Patch": 6
},
"releaseNotes": "What's new in version 4.*<br />Supports Zip Deploy, Run From Package, War Deploy [Details here](https://aka.ms/appServiceDeploymentMethods)<br />Supports App Service Environments<br />Improved UI for discovering different App service types supported by the task<br/>Run From Package is the preferred deployment method, which makes files in wwwroot folder read-only<br/>Click [here](https://aka.ms/azurermwebdeployreadme) for more information.",
"minimumAgentVersion": "2.104.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureRmWebAppDeploymentV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 4,
"Minor": 157,
"Patch": 5
"Patch": 6
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"minimumAgentVersion": "2.104.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureVmssDeploymentV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 0,
"Minor": 1,
"Patch": 3
"Patch": 4
},
"demands": [],
"minimumAgentVersion": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureVmssDeploymentV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 0,
"Minor": 1,
"Patch": 3
"Patch": 4
},
"demands": [],
"minimumAgentVersion": "2.0.0",
Expand Down
46 changes: 30 additions & 16 deletions Tasks/Common/azure-arm-rest-v2/AzureServiceClientBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,32 +140,46 @@ export class AzureServiceClientBase {
timeoutInMinutes = timeoutInMinutes || this.longRunningOperationRetryTimeout;
var timeout = new Date().getTime() + timeoutInMinutes * 60 * 1000;
var waitIndefinitely = timeoutInMinutes == 0;
var ignoreTimeoutErrorThreshold = 5;
var request = new webClient.WebRequest();
request.method = "GET";
request.uri = response.headers["azure-asyncoperation"] || response.headers["location"];
if (!request.uri) {
throw new Error(tl.loc("InvalidResponseLongRunningOperation"));
}
while (true) {
response = await this.beginRequest(request);
tl.debug(`Response status code : ${response.statusCode}`);
if (response.statusCode === 202 || (response.body && (response.body.status == "Accepted" || response.body.status == "Running" || response.body.status == "InProgress"))) {
if(response.body && response.body.status) {
tl.debug(`Response status : ${response.body.status}`);
try {
response = await this.beginRequest(request);
tl.debug(`Response status code : ${response.statusCode}`);
if (response.statusCode === 202 || (response.body && (response.body.status == "Accepted" || response.body.status == "Running" || response.body.status == "InProgress"))) {
if (response.body && response.body.status) {
tl.debug(`Response status : ${response.body.status}`);
}
// If timeout; throw;
if (!waitIndefinitely && timeout < new Date().getTime()) {
throw new Error(tl.loc("TimeoutWhileWaiting"));
}

// Retry after given interval.
var sleepDuration = 15;
if (response.headers["retry-after"]) {
sleepDuration = parseInt(response.headers["retry-after"]);
}
await this.sleepFor(sleepDuration);
} else {
break;
}
// If timeout; throw;
if (!waitIndefinitely && timeout < new Date().getTime()) {
throw new Error(tl.loc("TimeoutWhileWaiting"));
}
catch (error) {
let errorString: string = (!!error && error.toString()) || "";
if(!!errorString && errorString.toLowerCase().indexOf("request timeout") >= 0 && ignoreTimeoutErrorThreshold > 0) {
// Ignore Request Timeout error and continue polling operation
tl.debug(`Request Timeout: ${request.uri}`);
ignoreTimeoutErrorThreshold--;
}

// Retry after given interval.
var sleepDuration = 15;
if (response.headers["retry-after"]) {
sleepDuration = parseInt(response.headers["retry-after"]);
else {
throw error;
}
await this.sleepFor(sleepDuration);
} else {
break;
}
}

Expand Down
Loading

0 comments on commit 09ca9a4

Please sign in to comment.