From c46a7f69e1c600e9c2b4d38bf28048bfc50d02b4 Mon Sep 17 00:00:00 2001 From: rokmicrosoft <33001640+rokmicrosoft@users.noreply.github.com> Date: Sun, 15 Apr 2018 18:22:59 +0530 Subject: [PATCH] Users/rok/msi node based task (#6981) * MSI node changes * msi changes argument pass * review incoporated * aftet review incorprated * After camelcase for enum name * proper identation * L0 modifieed * build failure * error messgae changed * Url changed * test case changes * after copying in mysql * removing quotes * azure app service manage task resource copy * key vault conflict * azure RG task * resolving conflit with azurerm * javatool installer * jenkins download artifact * packerbuild * status code changed * till updated task version * review incorporated * review incorporated * revwerting package json changes --- .../resources.resjson/en-US/resources.resjson | 7 +- Tasks/AzureAppServiceManage/task.json | 7 +- Tasks/AzureAppServiceManage/task.loc.json | 7 +- .../resources.resjson/en-US/resources.resjson | 6 +- Tasks/AzureKeyVault/npm-shrinkwrap.json | 2 +- Tasks/AzureKeyVault/task.json | 8 +- Tasks/AzureKeyVault/task.loc.json | 8 +- .../resources.resjson/en-US/resources.resjson | 5 +- Tasks/AzureMysqlDeployment/task.json | 5 +- Tasks/AzureMysqlDeployment/task.loc.json | 5 +- .../resources.resjson/en-US/resources.resjson | 6 +- Tasks/AzureResourceGroupDeployment/task.json | 6 +- .../task.loc.json | 6 +- .../resources.resjson/en-US/resources.resjson | 6 +- Tasks/AzureRmWebAppDeployment/task.json | 6 +- Tasks/AzureRmWebAppDeployment/task.loc.json | 6 +- .../resources.resjson/en-US/resources.resjson | 5 +- Tasks/AzureVmssDeployment/package-lock.json | 2 +- Tasks/AzureVmssDeployment/task.json | 7 +- Tasks/AzureVmssDeployment/task.loc.json | 7 +- .../resources.resjson/en-US/resources.resjson | 4 +- .../Common/azure-arm-rest/Tests/mock_utils.ts | 20 ++++- .../Common/azure-arm-rest/azure-arm-common.ts | 83 ++++++++++++++++--- .../azure-arm-rest/azure-arm-endpoint.ts | 8 +- Tasks/Common/azure-arm-rest/azureModels.ts | 7 ++ Tasks/Common/azure-arm-rest/module.json | 4 +- Tasks/Common/azure-arm-rest/package-lock.json | 2 +- .../azurestack-common/package-lock.json | 2 +- .../resources.resjson/en-US/resources.resjson | 5 +- Tasks/HelmDeploy/task.json | 5 +- Tasks/HelmDeploy/task.loc.json | 5 +- .../resources.resjson/en-US/resources.resjson | 5 +- Tasks/JavaToolInstaller/task.json | 7 +- Tasks/JavaToolInstaller/task.loc.json | 7 +- .../resources.resjson/en-US/resources.resjson | 4 +- Tasks/JenkinsDownloadArtifacts/task.json | 6 +- Tasks/JenkinsDownloadArtifacts/task.loc.json | 6 +- .../resources.resjson/en-US/resources.resjson | 5 +- Tasks/PackerBuild/package-lock.json | 18 +--- Tasks/PackerBuild/task.json | 7 +- Tasks/PackerBuild/task.loc.json | 7 +- 41 files changed, 240 insertions(+), 94 deletions(-) diff --git a/Tasks/AzureAppServiceManage/Strings/resources.resjson/en-US/resources.resjson b/Tasks/AzureAppServiceManage/Strings/resources.resjson/en-US/resources.resjson index b70def758d3d..b440a22517c4 100644 --- a/Tasks/AzureAppServiceManage/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/AzureAppServiceManage/Strings/resources.resjson/en-US/resources.resjson @@ -53,7 +53,6 @@ "loc.messages.RestartAppServiceAccepted": "Restart request accepted by App Service : %s", "loc.messages.InvalidAction": "Invalid Action selected !", "loc.messages.WARNINGCannotupdatedeploymentstatusSCMendpointisnotenabledforthiswebsite": "WARNING: Cannot update deployment status. SCM endpoint is not enabled for this website.", - "loc.messages.CouldnotfetchaccesstokenforAzureStatusCode": "Could not fetch acccess token for Azure App Service. StatusCode %s (%s)", "loc.messages.WebAppDoesntExist": "Web app '%s' doesn't exist.", "loc.messages.UnabletoretrieveWebAppID": "Unable to retrieve connection details for Azure App Service:'%s'. Status Code: %s", "loc.messages.StartingSwapSlot": "Requesting swap slot for Web App : %s", @@ -78,7 +77,6 @@ "loc.messages.UnableToFetchContinuousWebJobs": "Unable to fetch continuous web jobs", "loc.messages.UnableToStartContinuousWebJob": "Unable to start continuous web job", "loc.messages.UnableToStopContinuousWebJob": "Unable to stop continuous web job", - "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for azure. Status code: %s, status message: %s", "loc.messages.AppNameCannotBeNull": "App name cannot be null or undefined and it must be of type string.", "loc.messages.SlotNameCannotBeNull": "Slot name cannot be null or undefined and it must be of type string.", "loc.messages.SourceSlotNameCannotBeNull": "Source slot name cannot be null or undefined and it must be of type string.", @@ -164,5 +162,8 @@ "loc.messages.WebJobAlreadyInStoppedState": "WebJob '%s' is already in stopped state.", "loc.messages.RestartingKuduService": "Restarting Kudu Service.", "loc.messages.RestartedKuduService": "Kudu Service restarted.", - "loc.messages.FailedToRestartKuduService": "Failed to restart kudu Service. %s." + "loc.messages.FailedToRestartKuduService": "Failed to restart kudu Service. %s.", + "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/AzureAppServiceManage/task.json b/Tasks/AzureAppServiceManage/task.json index 36d0f5e6f3bc..6206d0832f9b 100644 --- a/Tasks/AzureAppServiceManage/task.json +++ b/Tasks/AzureAppServiceManage/task.json @@ -288,7 +288,6 @@ "RestartAppServiceAccepted": "Restart request accepted by App Service : %s", "InvalidAction": "Invalid Action selected !", "WARNINGCannotupdatedeploymentstatusSCMendpointisnotenabledforthiswebsite": "WARNING: Cannot update deployment status. SCM endpoint is not enabled for this website.", - "CouldnotfetchaccesstokenforAzureStatusCode": "Could not fetch acccess token for Azure App Service. StatusCode %s (%s)", "WebAppDoesntExist": "Web app '%s' doesn't exist.", "UnabletoretrieveWebAppID": "Unable to retrieve connection details for Azure App Service:'%s'. Status Code: %s", "StartingSwapSlot": "Requesting swap slot for Web App : %s", @@ -313,7 +312,6 @@ "UnableToFetchContinuousWebJobs": "Unable to fetch continuous web jobs", "UnableToStartContinuousWebJob": "Unable to start continuous web job", "UnableToStopContinuousWebJob": "Unable to stop continuous web job", - "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for azure. Status code: %s, status message: %s", "AppNameCannotBeNull": "App name cannot be null or undefined and it must be of type string.", "SlotNameCannotBeNull": "Slot name cannot be null or undefined and it must be of type string.", "SourceSlotNameCannotBeNull": "Source slot name cannot be null or undefined and it must be of type string.", @@ -399,6 +397,9 @@ "WebJobAlreadyInStoppedState": "WebJob '%s' is already in stopped state.", "RestartingKuduService": "Restarting Kudu Service.", "RestartedKuduService": "Kudu Service restarted.", - "FailedToRestartKuduService": "Failed to restart kudu Service. %s." + "FailedToRestartKuduService": "Failed to restart kudu Service. %s.", + "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } \ No newline at end of file diff --git a/Tasks/AzureAppServiceManage/task.loc.json b/Tasks/AzureAppServiceManage/task.loc.json index 50c4546adb27..937dbc74b4dd 100644 --- a/Tasks/AzureAppServiceManage/task.loc.json +++ b/Tasks/AzureAppServiceManage/task.loc.json @@ -292,7 +292,6 @@ "RestartAppServiceAccepted": "ms-resource:loc.messages.RestartAppServiceAccepted", "InvalidAction": "ms-resource:loc.messages.InvalidAction", "WARNINGCannotupdatedeploymentstatusSCMendpointisnotenabledforthiswebsite": "ms-resource:loc.messages.WARNINGCannotupdatedeploymentstatusSCMendpointisnotenabledforthiswebsite", - "CouldnotfetchaccesstokenforAzureStatusCode": "ms-resource:loc.messages.CouldnotfetchaccesstokenforAzureStatusCode", "WebAppDoesntExist": "ms-resource:loc.messages.WebAppDoesntExist", "UnabletoretrieveWebAppID": "ms-resource:loc.messages.UnabletoretrieveWebAppID", "StartingSwapSlot": "ms-resource:loc.messages.StartingSwapSlot", @@ -317,7 +316,6 @@ "UnableToFetchContinuousWebJobs": "ms-resource:loc.messages.UnableToFetchContinuousWebJobs", "UnableToStartContinuousWebJob": "ms-resource:loc.messages.UnableToStartContinuousWebJob", "UnableToStopContinuousWebJob": "ms-resource:loc.messages.UnableToStopContinuousWebJob", - "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", "AppNameCannotBeNull": "ms-resource:loc.messages.AppNameCannotBeNull", "SlotNameCannotBeNull": "ms-resource:loc.messages.SlotNameCannotBeNull", "SourceSlotNameCannotBeNull": "ms-resource:loc.messages.SourceSlotNameCannotBeNull", @@ -403,6 +401,9 @@ "WebJobAlreadyInStoppedState": "ms-resource:loc.messages.WebJobAlreadyInStoppedState", "RestartingKuduService": "ms-resource:loc.messages.RestartingKuduService", "RestartedKuduService": "ms-resource:loc.messages.RestartedKuduService", - "FailedToRestartKuduService": "ms-resource:loc.messages.FailedToRestartKuduService" + "FailedToRestartKuduService": "ms-resource:loc.messages.FailedToRestartKuduService", + "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file diff --git a/Tasks/AzureKeyVault/Strings/resources.resjson/en-US/resources.resjson b/Tasks/AzureKeyVault/Strings/resources.resjson/en-US/resources.resjson index 15c74a87f908..f78c32db458d 100644 --- a/Tasks/AzureKeyVault/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/AzureKeyVault/Strings/resources.resjson/en-US/resources.resjson @@ -15,7 +15,6 @@ "loc.messages.SecretCannotBeEmpty": "secret must be a non empty string.", "loc.messages.armUrlCannotBeEmpty": "arm Url must be a non empty string.", "loc.messages.authorityUrlCannotBeEmpty": "authority must be a non empty string.", - "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for azure. Status code: %s, status message: %s", "loc.messages.CallbackCannotBeNull": "callback cannot be null.", "loc.messages.CredentialsCannotBeNull": "'credentials' cannot be null.", "loc.messages.SubscriptionIdCannotBeNull": "'subscriptionId' cannot be null.", @@ -40,5 +39,8 @@ "loc.messages.GetSecretFailedBecauseOfInvalidCharacters": "Cannot find the secret with name: %s. Secret name must be a string 1-127 characters in length containing only 0-9, a-z, A-Z, and -", "loc.messages.UploadingAttachment": "Uploading %s as attachment", "loc.messages.CouldNotWriteToFile": "Could not save content to file. Failed with an error %s", - "loc.messages.CouldNotMaskSecret": "%s value has regular expressions hence could not mask completely" + "loc.messages.CouldNotMaskSecret": "%s value has regular expressions hence could not mask completely", + "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/AzureKeyVault/npm-shrinkwrap.json b/Tasks/AzureKeyVault/npm-shrinkwrap.json index 540d90203bf0..3d8701896b7a 100644 --- a/Tasks/AzureKeyVault/npm-shrinkwrap.json +++ b/Tasks/AzureKeyVault/npm-shrinkwrap.json @@ -107,4 +107,4 @@ } } } -} +} \ No newline at end of file diff --git a/Tasks/AzureKeyVault/task.json b/Tasks/AzureKeyVault/task.json index d960bbedef69..605d7e044adf 100644 --- a/Tasks/AzureKeyVault/task.json +++ b/Tasks/AzureKeyVault/task.json @@ -14,7 +14,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 16 + "Patch": 17 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -70,7 +70,6 @@ "SecretCannotBeEmpty": "secret must be a non empty string.", "armUrlCannotBeEmpty": "arm Url must be a non empty string.", "authorityUrlCannotBeEmpty": "authority must be a non empty string.", - "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for azure. Status code: %s, status message: %s", "CallbackCannotBeNull": "callback cannot be null.", "CredentialsCannotBeNull": "'credentials' cannot be null.", "SubscriptionIdCannotBeNull": "'subscriptionId' cannot be null.", @@ -95,6 +94,9 @@ "GetSecretFailedBecauseOfInvalidCharacters": "Cannot find the secret with name: %s. Secret name must be a string 1-127 characters in length containing only 0-9, a-z, A-Z, and -", "UploadingAttachment": "Uploading %s as attachment", "CouldNotWriteToFile": "Could not save content to file. Failed with an error %s", - "CouldNotMaskSecret": "%s value has regular expressions hence could not mask completely" + "CouldNotMaskSecret": "%s value has regular expressions hence could not mask completely", + "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } \ No newline at end of file diff --git a/Tasks/AzureKeyVault/task.loc.json b/Tasks/AzureKeyVault/task.loc.json index df2a41750d55..817bd7bb50b7 100644 --- a/Tasks/AzureKeyVault/task.loc.json +++ b/Tasks/AzureKeyVault/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 16 + "Patch": 17 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -72,7 +72,6 @@ "SecretCannotBeEmpty": "ms-resource:loc.messages.SecretCannotBeEmpty", "armUrlCannotBeEmpty": "ms-resource:loc.messages.armUrlCannotBeEmpty", "authorityUrlCannotBeEmpty": "ms-resource:loc.messages.authorityUrlCannotBeEmpty", - "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", "CallbackCannotBeNull": "ms-resource:loc.messages.CallbackCannotBeNull", "CredentialsCannotBeNull": "ms-resource:loc.messages.CredentialsCannotBeNull", "SubscriptionIdCannotBeNull": "ms-resource:loc.messages.SubscriptionIdCannotBeNull", @@ -97,6 +96,9 @@ "GetSecretFailedBecauseOfInvalidCharacters": "ms-resource:loc.messages.GetSecretFailedBecauseOfInvalidCharacters", "UploadingAttachment": "ms-resource:loc.messages.UploadingAttachment", "CouldNotWriteToFile": "ms-resource:loc.messages.CouldNotWriteToFile", - "CouldNotMaskSecret": "ms-resource:loc.messages.CouldNotMaskSecret" + "CouldNotMaskSecret": "ms-resource:loc.messages.CouldNotMaskSecret", + "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file diff --git a/Tasks/AzureMysqlDeployment/Strings/resources.resjson/en-US/resources.resjson b/Tasks/AzureMysqlDeployment/Strings/resources.resjson/en-US/resources.resjson index 5dc63adf5f48..4a5cecf6bab6 100644 --- a/Tasks/AzureMysqlDeployment/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/AzureMysqlDeployment/Strings/resources.resjson/en-US/resources.resjson @@ -58,5 +58,8 @@ "loc.messages.CallbackCannotBeNull": "callback cannot be null.", "loc.messages.UnableToCreateDatabaseException": "Unable to create database.", "loc.messages.WindowMysqlClientMissingError": "Mysql Client is missing in window agent box. Please install it by running mysql client installer 'https://aka.ms/window-mysqlcli-installer' script file in your agent box.", - "loc.messages.LinuxMysqlClientMissingError": "Mysql Client is missing in linux agent box. Please install it by running 'apt-get install mysql-client'." + "loc.messages.LinuxMysqlClientMissingError": "Mysql Client is missing in linux agent box. Please install it by running 'apt-get install mysql-client'.", + "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/AzureMysqlDeployment/task.json b/Tasks/AzureMysqlDeployment/task.json index 3ad149f26fa9..06d8d6bec0a4 100644 --- a/Tasks/AzureMysqlDeployment/task.json +++ b/Tasks/AzureMysqlDeployment/task.json @@ -218,6 +218,9 @@ "CallbackCannotBeNull": "callback cannot be null.", "UnableToCreateDatabaseException": "Unable to create database.", "WindowMysqlClientMissingError": "Mysql Client is missing in window agent box. Please install it by running mysql client installer 'https://aka.ms/window-mysqlcli-installer' script file in your agent box.", - "LinuxMysqlClientMissingError": "Mysql Client is missing in linux agent box. Please install it by running 'apt-get install mysql-client'." + "LinuxMysqlClientMissingError": "Mysql Client is missing in linux agent box. Please install it by running 'apt-get install mysql-client'.", + "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } diff --git a/Tasks/AzureMysqlDeployment/task.loc.json b/Tasks/AzureMysqlDeployment/task.loc.json index 0587fba82605..44e1d4c39c05 100644 --- a/Tasks/AzureMysqlDeployment/task.loc.json +++ b/Tasks/AzureMysqlDeployment/task.loc.json @@ -220,6 +220,9 @@ "CallbackCannotBeNull": "ms-resource:loc.messages.CallbackCannotBeNull", "UnableToCreateDatabaseException": "ms-resource:loc.messages.UnableToCreateDatabaseException", "WindowMysqlClientMissingError": "ms-resource:loc.messages.WindowMysqlClientMissingError", - "LinuxMysqlClientMissingError": "ms-resource:loc.messages.LinuxMysqlClientMissingError" + "LinuxMysqlClientMissingError": "ms-resource:loc.messages.LinuxMysqlClientMissingError", + "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file diff --git a/Tasks/AzureResourceGroupDeployment/Strings/resources.resjson/en-US/resources.resjson b/Tasks/AzureResourceGroupDeployment/Strings/resources.resjson/en-US/resources.resjson index 1ffe5af6cdc2..949f7da70c22 100644 --- a/Tasks/AzureResourceGroupDeployment/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/AzureResourceGroupDeployment/Strings/resources.resjson/en-US/resources.resjson @@ -110,7 +110,6 @@ "loc.messages.SecretCannotBeEmpty": "secret must be a non empty string.", "loc.messages.armUrlCannotBeEmpty": "arm Url must be a non empty string.", "loc.messages.authorityUrlCannotBeEmpty": "authority must be a non empty string.", - "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for azure. Status code: %s, status message: %s", "loc.messages.LoadBalancerNameCannotBeNull": "'loadBalancerName cannot be null or undefined and it must be of type string.'", "loc.messages.NetworkInterfaceNameCannotBeNull": "networkInterfaceName cannot be null or undefined and it must be of type string.", "loc.messages.NetworkSecurityGroupNameCannotBeNull": "networkSecurityGroupName cannot be null or undefined and it must be of type string.", @@ -169,5 +168,8 @@ "loc.messages.UnableToFetchActiveDirectory": "Unable to fetch active directory resource id.", "loc.messages.SpecifiedAzureRmEndpointIsInvalid": "Specified AzureRm endpoint url : '{0}' is invalid.", "loc.messages.FailedToFetchAzureStackDependencyData": "Failed to fetch azure stack dependency data, error message : {0}", - "loc.messages.UnableToReadResponseBody": "Unable to read response body. Error: %s" + "loc.messages.UnableToReadResponseBody": "Unable to read response body. Error: %s", + "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/AzureResourceGroupDeployment/task.json b/Tasks/AzureResourceGroupDeployment/task.json index 62fb604e5013..6de8ab02a713 100644 --- a/Tasks/AzureResourceGroupDeployment/task.json +++ b/Tasks/AzureResourceGroupDeployment/task.json @@ -361,7 +361,6 @@ "SecretCannotBeEmpty": "secret must be a non empty string.", "armUrlCannotBeEmpty": "arm Url must be a non empty string.", "authorityUrlCannotBeEmpty": "authority must be a non empty string.", - "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for azure. Status code: %s, status message: %s", "LoadBalancerNameCannotBeNull": "'loadBalancerName cannot be null or undefined and it must be of type string.'", "NetworkInterfaceNameCannotBeNull": "networkInterfaceName cannot be null or undefined and it must be of type string.", "NetworkSecurityGroupNameCannotBeNull": "networkSecurityGroupName cannot be null or undefined and it must be of type string.", @@ -420,6 +419,9 @@ "UnableToFetchActiveDirectory": "Unable to fetch active directory resource id.", "SpecifiedAzureRmEndpointIsInvalid": "Specified AzureRm endpoint url : '{0}' is invalid.", "FailedToFetchAzureStackDependencyData": "Failed to fetch azure stack dependency data, error message : {0}", - "UnableToReadResponseBody": "Unable to read response body. Error: %s" + "UnableToReadResponseBody": "Unable to read response body. Error: %s", + "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } \ No newline at end of file diff --git a/Tasks/AzureResourceGroupDeployment/task.loc.json b/Tasks/AzureResourceGroupDeployment/task.loc.json index 17dde4f8ad7a..d89f622c308c 100644 --- a/Tasks/AzureResourceGroupDeployment/task.loc.json +++ b/Tasks/AzureResourceGroupDeployment/task.loc.json @@ -361,7 +361,6 @@ "SecretCannotBeEmpty": "ms-resource:loc.messages.SecretCannotBeEmpty", "armUrlCannotBeEmpty": "ms-resource:loc.messages.armUrlCannotBeEmpty", "authorityUrlCannotBeEmpty": "ms-resource:loc.messages.authorityUrlCannotBeEmpty", - "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", "LoadBalancerNameCannotBeNull": "ms-resource:loc.messages.LoadBalancerNameCannotBeNull", "NetworkInterfaceNameCannotBeNull": "ms-resource:loc.messages.NetworkInterfaceNameCannotBeNull", "NetworkSecurityGroupNameCannotBeNull": "ms-resource:loc.messages.NetworkSecurityGroupNameCannotBeNull", @@ -420,6 +419,9 @@ "UnableToFetchActiveDirectory": "ms-resource:loc.messages.UnableToFetchActiveDirectory", "SpecifiedAzureRmEndpointIsInvalid": "ms-resource:loc.messages.SpecifiedAzureRmEndpointIsInvalid", "FailedToFetchAzureStackDependencyData": "ms-resource:loc.messages.FailedToFetchAzureStackDependencyData", - "UnableToReadResponseBody": "ms-resource:loc.messages.UnableToReadResponseBody" + "UnableToReadResponseBody": "ms-resource:loc.messages.UnableToReadResponseBody", + "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file diff --git a/Tasks/AzureRmWebAppDeployment/Strings/resources.resjson/en-US/resources.resjson b/Tasks/AzureRmWebAppDeployment/Strings/resources.resjson/en-US/resources.resjson index edf1bd0f8709..4c6eead19a5b 100644 --- a/Tasks/AzureRmWebAppDeployment/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/AzureRmWebAppDeployment/Strings/resources.resjson/en-US/resources.resjson @@ -71,7 +71,6 @@ "loc.messages.ErrorNoSuchDeployingMethodExists": "Error : No such deploying method exists", "loc.messages.UnabletoretrieveconnectiondetailsforazureRMWebApp": "Unable to retrieve connection details for Azure App Service : %s. Status Code: %s (%s)", "loc.messages.UnabletoretrieveResourceID": "Unable to retrieve connection details for Azure Resource:'%s'. Status Code: %s", - "loc.messages.CouldnotfetchaccesstokenforAzureStatusCode": "Could not fetch access token for Azure. Status Code: %s (%s)", "loc.messages.Successfullyupdateddeploymenthistory": "Successfully updated deployment History at %s", "loc.messages.Failedtoupdatedeploymenthistory": "Failed to update deployment history. Error: %s", "loc.messages.WARNINGCannotupdatedeploymentstatusSCMendpointisnotenabledforthiswebsite": "WARNING : Cannot update deployment status : SCM endpoint is not enabled for this website", @@ -191,5 +190,8 @@ "loc.messages.FailedToGetDeploymentLogs": "Failed to get deployment logs. Error: %s", "loc.messages.GoExeNameNotPresent": "Go exe name is not present", "loc.messages.WarDeploymentRetry": "Retrying war file deployment as it did not expand successfully earlier.", - "loc.messages.Updatemachinetoenablesecuretlsprotocol": "Make sure the machine is using TLS 1.2 protocol or higher. Check https://aka.ms/enableTlsv2 for more information on how to enable TLS in your machine." + "loc.messages.Updatemachinetoenablesecuretlsprotocol": "Make sure the machine is using TLS 1.2 protocol or higher. Check https://aka.ms/enableTlsv2 for more information on how to enable TLS in your machine.", + "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/AzureRmWebAppDeployment/task.json b/Tasks/AzureRmWebAppDeployment/task.json index 85809c1c6f15..831e6f9505c9 100644 --- a/Tasks/AzureRmWebAppDeployment/task.json +++ b/Tasks/AzureRmWebAppDeployment/task.json @@ -413,7 +413,6 @@ "ErrorNoSuchDeployingMethodExists": "Error : No such deploying method exists", "UnabletoretrieveconnectiondetailsforazureRMWebApp": "Unable to retrieve connection details for Azure App Service : %s. Status Code: %s (%s)", "UnabletoretrieveResourceID": "Unable to retrieve connection details for Azure Resource:'%s'. Status Code: %s", - "CouldnotfetchaccesstokenforAzureStatusCode": "Could not fetch access token for Azure. Status Code: %s (%s)", "Successfullyupdateddeploymenthistory": "Successfully updated deployment History at %s", "Failedtoupdatedeploymenthistory": "Failed to update deployment history. Error: %s", "WARNINGCannotupdatedeploymentstatusSCMendpointisnotenabledforthiswebsite": "WARNING : Cannot update deployment status : SCM endpoint is not enabled for this website", @@ -533,6 +532,9 @@ "FailedToGetDeploymentLogs": "Failed to get deployment logs. Error: %s", "GoExeNameNotPresent": "Go exe name is not present", "WarDeploymentRetry": "Retrying war file deployment as it did not expand successfully earlier.", - "Updatemachinetoenablesecuretlsprotocol" : "Make sure the machine is using TLS 1.2 protocol or higher. Check https://aka.ms/enableTlsv2 for more information on how to enable TLS in your machine." + "Updatemachinetoenablesecuretlsprotocol" : "Make sure the machine is using TLS 1.2 protocol or higher. Check https://aka.ms/enableTlsv2 for more information on how to enable TLS in your machine.", + "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } diff --git a/Tasks/AzureRmWebAppDeployment/task.loc.json b/Tasks/AzureRmWebAppDeployment/task.loc.json index 80f313b44aaa..9bee3ecfae20 100644 --- a/Tasks/AzureRmWebAppDeployment/task.loc.json +++ b/Tasks/AzureRmWebAppDeployment/task.loc.json @@ -424,7 +424,6 @@ "ErrorNoSuchDeployingMethodExists": "ms-resource:loc.messages.ErrorNoSuchDeployingMethodExists", "UnabletoretrieveconnectiondetailsforazureRMWebApp": "ms-resource:loc.messages.UnabletoretrieveconnectiondetailsforazureRMWebApp", "UnabletoretrieveResourceID": "ms-resource:loc.messages.UnabletoretrieveResourceID", - "CouldnotfetchaccesstokenforAzureStatusCode": "ms-resource:loc.messages.CouldnotfetchaccesstokenforAzureStatusCode", "Successfullyupdateddeploymenthistory": "ms-resource:loc.messages.Successfullyupdateddeploymenthistory", "Failedtoupdatedeploymenthistory": "ms-resource:loc.messages.Failedtoupdatedeploymenthistory", "WARNINGCannotupdatedeploymentstatusSCMendpointisnotenabledforthiswebsite": "ms-resource:loc.messages.WARNINGCannotupdatedeploymentstatusSCMendpointisnotenabledforthiswebsite", @@ -544,6 +543,9 @@ "FailedToGetDeploymentLogs": "ms-resource:loc.messages.FailedToGetDeploymentLogs", "GoExeNameNotPresent": "ms-resource:loc.messages.GoExeNameNotPresent", "WarDeploymentRetry": "ms-resource:loc.messages.WarDeploymentRetry", - "Updatemachinetoenablesecuretlsprotocol": "ms-resource:loc.messages.Updatemachinetoenablesecuretlsprotocol" + "Updatemachinetoenablesecuretlsprotocol": "ms-resource:loc.messages.Updatemachinetoenablesecuretlsprotocol", + "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file diff --git a/Tasks/AzureVmssDeployment/Strings/resources.resjson/en-US/resources.resjson b/Tasks/AzureVmssDeployment/Strings/resources.resjson/en-US/resources.resjson index 0fbc8b57ce03..45343c0bfba4 100644 --- a/Tasks/AzureVmssDeployment/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/AzureVmssDeployment/Strings/resources.resjson/en-US/resources.resjson @@ -72,5 +72,8 @@ "loc.messages.FailedToListItemInsideContainer": "Failed to list items inside container: %s. Error: %s.", "loc.messages.SuccessFullyFetchedItemList": "Successfully fetcted list of items", "loc.messages.UnableToFetchItem": "Unable to fetch item: %s. Error: %s.", - "loc.messages.UploadingItem": "Uploading %s." + "loc.messages.UploadingItem": "Uploading %s.", + "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/AzureVmssDeployment/package-lock.json b/Tasks/AzureVmssDeployment/package-lock.json index c001bf085a76..bb8fce47650b 100644 --- a/Tasks/AzureVmssDeployment/package-lock.json +++ b/Tasks/AzureVmssDeployment/package-lock.json @@ -981,4 +981,4 @@ } } } -} +} \ No newline at end of file diff --git a/Tasks/AzureVmssDeployment/task.json b/Tasks/AzureVmssDeployment/task.json index 64029958e055..db370cfa0c03 100644 --- a/Tasks/AzureVmssDeployment/task.json +++ b/Tasks/AzureVmssDeployment/task.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 0, - "Patch": 13 + "Patch": 14 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -212,6 +212,9 @@ "FailedToListItemInsideContainer": "Failed to list items inside container: %s. Error: %s.", "SuccessFullyFetchedItemList": "Successfully fetcted list of items", "UnableToFetchItem": "Unable to fetch item: %s. Error: %s.", - "UploadingItem": "Uploading %s." + "UploadingItem": "Uploading %s.", + "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } \ No newline at end of file diff --git a/Tasks/AzureVmssDeployment/task.loc.json b/Tasks/AzureVmssDeployment/task.loc.json index f58211b1ea8d..a2ef8adc7e87 100644 --- a/Tasks/AzureVmssDeployment/task.loc.json +++ b/Tasks/AzureVmssDeployment/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 0, - "Patch": 13 + "Patch": 14 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -214,6 +214,9 @@ "FailedToListItemInsideContainer": "ms-resource:loc.messages.FailedToListItemInsideContainer", "SuccessFullyFetchedItemList": "ms-resource:loc.messages.SuccessFullyFetchedItemList", "UnableToFetchItem": "ms-resource:loc.messages.UnableToFetchItem", - "UploadingItem": "ms-resource:loc.messages.UploadingItem" + "UploadingItem": "ms-resource:loc.messages.UploadingItem", + "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file diff --git a/Tasks/Common/azure-arm-rest/Strings/resources.resjson/en-US/resources.resjson b/Tasks/Common/azure-arm-rest/Strings/resources.resjson/en-US/resources.resjson index 4e51ed5cdc62..19b241da6238 100644 --- a/Tasks/Common/azure-arm-rest/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/Common/azure-arm-rest/Strings/resources.resjson/en-US/resources.resjson @@ -4,7 +4,9 @@ "loc.messages.SecretCannotBeEmpty": "secret must be a non empty string.", "loc.messages.armUrlCannotBeEmpty": "arm Url must be a non empty string.", "loc.messages.authorityUrlCannotBeEmpty": "authority must be a non empty string.", - "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s", "loc.messages.CallbackCannotBeNull": "callback cannot be null.", "loc.messages.VMNameCannotBeNull": "vmName cannot be null or undefined and it must be of type string.", "loc.messages.InvalidValue": "%s is not a valid value. The valid values are: %s", diff --git a/Tasks/Common/azure-arm-rest/Tests/mock_utils.ts b/Tasks/Common/azure-arm-rest/Tests/mock_utils.ts index cfdd0f640fe3..21d05d772d92 100644 --- a/Tasks/Common/azure-arm-rest/Tests/mock_utils.ts +++ b/Tasks/Common/azure-arm-rest/Tests/mock_utils.ts @@ -1,11 +1,12 @@ -import { AzureEndpoint, WebTest } from '../azureModels'; +import { AzureEndpoint, WebTest, Scheme } from '../azureModels'; import { ApplicationInsightsWebTests } from '../azure-arm-appinsights-webtests'; import * as querystring from "querystring"; import { ApplicationTokenCredentials } from '../azure-arm-common'; export var nock = require('nock'); -export function getMockEndpoint() { +export function getMockEndpoint(scheme?: string, msiClientId?: string) { process.env["AZURE_HTTP_USER_AGENT"] = "TEST_AGENT"; + var endpoint: AzureEndpoint = { activeDirectoryAuthority: "https://login.windows.net/", environment: "AzureCloud", @@ -18,7 +19,7 @@ export function getMockEndpoint() { environmentAuthorityUrl: "https://login.windows.net/", activeDirectoryResourceID: "https://management.azure.com/", applicationTokenCredentials: new ApplicationTokenCredentials("MOCK_SPN_ID", "MOCK_TENANT_ID", "MOCK_SPN_KEY", "https://management.azure.com/", - "https://login.windows.net/", "https://management.azure.com/", false) + "https://login.windows.net/", "https://management.azure.com/", false, scheme, msiClientId) } nock("https://login.windows.net", { @@ -36,6 +37,19 @@ export function getMockEndpoint() { access_token: "DUMMY_ACCESS_TOKEN" }).persist(); + let apiVersion = "2018-02-01"; + let msiClientIdUrl = msiClientId ? "&client_id=" + msiClientId : ""; + var msiUrl = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=" + apiVersion + "&resource=https://management.azure.com/" + msiClientIdUrl; + nock(msiUrl, { + reqheaders: { + "Metadata": true + } + }) + .get("/oauth2/token?resource=https://management.azure.com/") + .reply(200, { + access_token: "DUMMY_ACCESS_TOKEN" + }).persist(); + return endpoint; } diff --git a/Tasks/Common/azure-arm-rest/azure-arm-common.ts b/Tasks/Common/azure-arm-rest/azure-arm-common.ts index 172fb8d74fb9..93a6863496cf 100644 --- a/Tasks/Common/azure-arm-rest/azure-arm-common.ts +++ b/Tasks/Common/azure-arm-rest/azure-arm-common.ts @@ -2,6 +2,7 @@ import tl = require('vsts-task-lib/task'); import Q = require('q'); import querystring = require('querystring'); import webClient = require("./webClient"); +import AzureModels = require("./azureModels"); export class ApplicationTokenCredentials { private clientId: string; @@ -11,19 +12,24 @@ export class ApplicationTokenCredentials { public authorityUrl: string; public activeDirectoryResourceId: string; public isAzureStackEnvironment: boolean; + public scheme: number; + public msiClientId: string; private token_deferred: Q.Promise; - constructor(clientId: string, domain: string, secret: string, baseUrl: string, authorityUrl: string, activeDirectoryResourceId: string, isAzureStackEnvironment: boolean) { - if (!Boolean(clientId) || typeof clientId.valueOf() !== 'string') { - throw new Error(tl.loc("ClientIdCannotBeEmpty")); - } + constructor(clientId: string, domain: string, secret: string, baseUrl: string, authorityUrl: string, activeDirectoryResourceId: string, isAzureStackEnvironment: boolean, scheme?: string, msiClientId?: string) { if (!Boolean(domain) || typeof domain.valueOf() !== 'string') { throw new Error(tl.loc("DomainCannotBeEmpty")); } - if (!Boolean(secret) || typeof secret.valueOf() !== 'string') { - throw new Error(tl.loc("SecretCannotBeEmpty")); + if((!scheme ||scheme ==='ServicePrincipal')){ + if (!Boolean(clientId) || typeof clientId.valueOf() !== 'string') { + throw new Error(tl.loc("ClientIdCannotBeEmpty")); + } + + if (!Boolean(secret) || typeof secret.valueOf() !== 'string') { + throw new Error(tl.loc("SecretCannotBeEmpty")); + } } if (!Boolean(baseUrl) || typeof baseUrl.valueOf() !== 'string') { @@ -49,11 +55,20 @@ export class ApplicationTokenCredentials { this.authorityUrl = authorityUrl; this.activeDirectoryResourceId = activeDirectoryResourceId; this.isAzureStackEnvironment = isAzureStackEnvironment; + this.scheme = scheme ? AzureModels.Scheme[scheme] : AzureModels.Scheme['SPN'] ; + this.msiClientId = msiClientId ; } public getToken(force?: boolean): Q.Promise { if (!this.token_deferred || force) { - this.token_deferred = this.getAuthorizationToken(); + if(this.scheme === AzureModels.Scheme.ManagedServiceIdentity) + { + this.token_deferred = this._getMSIAuthorizationToken(0, 0); + } + else + { + this.token_deferred = this._getSPNAuthorizationToken(); + } } return this.token_deferred; @@ -67,9 +82,55 @@ export class ApplicationTokenCredentials { return this.clientId; } - private getAuthorizationToken(): Q.Promise { + private _getMSIAuthorizationToken(retyCount: number ,timeToWait: number): Q.Promise { var deferred = Q.defer(); + let webRequest = new webClient.WebRequest(); + webRequest.method = "GET"; + let apiVersion = "2018-02-01"; + const retryLimit = 5; + let msiClientId = this.msiClientId ? "&client_id=" + this.msiClientId : ""; + webRequest.uri = "http://169.254.169.254/metadata/identity/oauth2/token?api-version=" + apiVersion + "&resource="+ this.baseUrl + msiClientId; + webRequest.headers = { + "Metadata": true + }; + + webClient.sendRequest(webRequest).then( + (response: webClient.WebResponse) => { + if (response.statusCode == 200) + { + deferred.resolve(response.body.access_token); + } + else if (response.statusCode == 429 || response.statusCode == 500) + { + if(retyCount < retryLimit) + { + let waitedTime = 2000 + timeToWait * 2; + retyCount +=1; + setTimeout(() => { + deferred.resolve(this._getMSIAuthorizationToken(retyCount, waitedTime)); + }, waitedTime); + } + else + { + deferred.reject(tl.loc('CouldNotFetchAccessTokenforMSIStatusCode', response.statusCode, response.statusMessage)); + } + } + else + { + deferred.reject(tl.loc('CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode', response.statusCode, response.statusMessage)); + } + }, + (error) => { + deferred.reject(error) + } + ); + + return deferred.promise; + } + + private _getSPNAuthorizationToken(): Q.Promise { + var deferred = Q.defer(); let webRequest = new webClient.WebRequest(); webRequest.method = "POST"; webRequest.uri = this.authorityUrl + this.domain + "/oauth2/token/"; @@ -85,10 +146,12 @@ export class ApplicationTokenCredentials { webClient.sendRequest(webRequest).then( (response: webClient.WebResponse) => { - if (response.statusCode == 200) { + if (response.statusCode == 200) + { deferred.resolve(response.body.access_token); } - else { + else + { deferred.reject(tl.loc('CouldNotFetchAccessTokenforAzureStatusCode', response.statusCode, response.statusMessage)); } }, diff --git a/Tasks/Common/azure-arm-rest/azure-arm-endpoint.ts b/Tasks/Common/azure-arm-rest/azure-arm-endpoint.ts index 92fa9423f56e..2ca2c6d6d37a 100644 --- a/Tasks/Common/azure-arm-rest/azure-arm-endpoint.ts +++ b/Tasks/Common/azure-arm-rest/azure-arm-endpoint.ts @@ -28,12 +28,14 @@ export class AzureRMEndpoint { this.endpoint = { subscriptionID: tl.getEndpointDataParameter(this._connectedServiceName, 'subscriptionid', true), subscriptionName: tl.getEndpointDataParameter(this._connectedServiceName, 'subscriptionname', true), - servicePrincipalClientID: tl.getEndpointAuthorizationParameter(this._connectedServiceName, 'serviceprincipalid', false), - servicePrincipalKey: tl.getEndpointAuthorizationParameter(this._connectedServiceName, 'serviceprincipalkey', false), + servicePrincipalClientID: tl.getEndpointAuthorizationParameter(this._connectedServiceName, 'serviceprincipalid', true), + servicePrincipalKey: tl.getEndpointAuthorizationParameter(this._connectedServiceName, 'serviceprincipalkey', true), environmentAuthorityUrl: tl.getEndpointDataParameter(this._connectedServiceName, 'environmentAuthorityUrl', true), tenantID: tl.getEndpointAuthorizationParameter(this._connectedServiceName, 'tenantid', false), url: tl.getEndpointUrl(this._connectedServiceName, true), environment: tl.getEndpointDataParameter(this._connectedServiceName, 'environment', true), + scheme: tl.getEndpointAuthorizationScheme(this._connectedServiceName, true), + msiClientId: tl.getEndpointDataParameter(this._connectedServiceName, 'msiclientId', true), activeDirectoryResourceID: tl.getEndpointDataParameter(this._connectedServiceName, 'activeDirectoryServiceEndpointResourceId', true) } as AzureEndpoint; @@ -46,7 +48,7 @@ export class AzureRMEndpoint { } this.endpoint.applicationTokenCredentials = new ApplicationTokenCredentials(this.endpoint.servicePrincipalClientID, this.endpoint.tenantID, this.endpoint.servicePrincipalKey, - this.endpoint.url, this.endpoint.environmentAuthorityUrl, this.endpoint.activeDirectoryResourceID, this.endpoint.environment.toLowerCase() == constants.AzureEnvironments.AzureStack); + this.endpoint.url, this.endpoint.environmentAuthorityUrl, this.endpoint.activeDirectoryResourceID, this.endpoint.environment.toLowerCase() == constants.AzureEnvironments.AzureStack, this.endpoint.scheme, this.endpoint.msiClientId); } return this.endpoint; diff --git a/Tasks/Common/azure-arm-rest/azureModels.ts b/Tasks/Common/azure-arm-rest/azureModels.ts index cec697d7baf8..29d675b07fcf 100644 --- a/Tasks/Common/azure-arm-rest/azureModels.ts +++ b/Tasks/Common/azure-arm-rest/azureModels.ts @@ -166,6 +166,11 @@ export enum ComputeResourceType { VirtualMachineScaleSet } +export enum Scheme { + ManagedServiceIdentity, + SPN +} + export interface StorageAccountSku { name: string; tier?: string; @@ -215,6 +220,8 @@ export interface AzureEndpoint { portalEndpoint?: string; AzureKeyVaultDnsSuffix?: string; AzureKeyVaultServiceEndpointResourceId?: string; + msiClientId?: string; + scheme?: string; applicationTokenCredentials: ApplicationTokenCredentials; } diff --git a/Tasks/Common/azure-arm-rest/module.json b/Tasks/Common/azure-arm-rest/module.json index 9122c04efb40..50eec16d2667 100644 --- a/Tasks/Common/azure-arm-rest/module.json +++ b/Tasks/Common/azure-arm-rest/module.json @@ -5,7 +5,9 @@ "SecretCannotBeEmpty": "secret must be a non empty string.", "armUrlCannotBeEmpty": "arm Url must be a non empty string.", "authorityUrlCannotBeEmpty": "authority must be a non empty string.", - "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s", "CallbackCannotBeNull": "callback cannot be null.", "VMNameCannotBeNull": "vmName cannot be null or undefined and it must be of type string.", "InvalidValue": "%s is not a valid value. The valid values are: %s", diff --git a/Tasks/Common/azure-arm-rest/package-lock.json b/Tasks/Common/azure-arm-rest/package-lock.json index b28f47aca8cb..06b8ccba1676 100644 --- a/Tasks/Common/azure-arm-rest/package-lock.json +++ b/Tasks/Common/azure-arm-rest/package-lock.json @@ -26,7 +26,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { "brace-expansion": "1.1.8" } diff --git a/Tasks/Common/azurestack-common/package-lock.json b/Tasks/Common/azurestack-common/package-lock.json index 3302c1a23ada..6443fe63c472 100644 --- a/Tasks/Common/azurestack-common/package-lock.json +++ b/Tasks/Common/azurestack-common/package-lock.json @@ -49,7 +49,7 @@ "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + "integrity": "sha1-3Eu8emyp2Rbe5dQ1FvAJK1j3uKs=" }, "shelljs": { "version": "0.3.0", diff --git a/Tasks/HelmDeploy/Strings/resources.resjson/en-US/resources.resjson b/Tasks/HelmDeploy/Strings/resources.resjson/en-US/resources.resjson index 7a1fd4f5e013..b83ace034073 100644 --- a/Tasks/HelmDeploy/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/HelmDeploy/Strings/resources.resjson/en-US/resources.resjson @@ -68,5 +68,8 @@ "loc.messages.RetryingRequest": "Retrying request after %s seconds.", "loc.messages.PatternNotFoundInFilePath": "Pattern not found in file path %s.", "loc.messages.CantResolvePatternInPath": "Can not resolve pattern in file path %s.", - "loc.messages.PatternFoundInPath": "Pattern found in file path %s." + "loc.messages.PatternFoundInPath": "Pattern found in file path %s.", + "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/HelmDeploy/task.json b/Tasks/HelmDeploy/task.json index 196095f5eba2..835b5ed7e354 100644 --- a/Tasks/HelmDeploy/task.json +++ b/Tasks/HelmDeploy/task.json @@ -347,6 +347,9 @@ "RetryingRequest": "Retrying request after %s seconds.", "PatternNotFoundInFilePath": "Pattern not found in file path %s.", "CantResolvePatternInPath": "Can not resolve pattern in file path %s.", - "PatternFoundInPath": "Pattern found in file path %s." + "PatternFoundInPath": "Pattern found in file path %s.", + "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } \ No newline at end of file diff --git a/Tasks/HelmDeploy/task.loc.json b/Tasks/HelmDeploy/task.loc.json index 3dd40d9cbcdf..42917aad9a91 100644 --- a/Tasks/HelmDeploy/task.loc.json +++ b/Tasks/HelmDeploy/task.loc.json @@ -361,6 +361,9 @@ "RetryingRequest": "ms-resource:loc.messages.RetryingRequest", "PatternNotFoundInFilePath": "ms-resource:loc.messages.PatternNotFoundInFilePath", "CantResolvePatternInPath": "ms-resource:loc.messages.CantResolvePatternInPath", - "PatternFoundInPath": "ms-resource:loc.messages.PatternFoundInPath" + "PatternFoundInPath": "ms-resource:loc.messages.PatternFoundInPath", + "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file diff --git a/Tasks/JavaToolInstaller/Strings/resources.resjson/en-US/resources.resjson b/Tasks/JavaToolInstaller/Strings/resources.resjson/en-US/resources.resjson index dce2551189b2..dd4aff396905 100644 --- a/Tasks/JavaToolInstaller/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/JavaToolInstaller/Strings/resources.resjson/en-US/resources.resjson @@ -45,5 +45,8 @@ "loc.messages.SucceedMsg": "Successfully extracted all files.", "loc.messages.SetJavaHome": "JAVA_HOME is being set to: %s", "loc.messages.SetExtendedJavaHome": "%s is being set to: %s", - "loc.messages.UnsupportedFileExtension": "Specified JDK source file does not have a supported file extension." + "loc.messages.UnsupportedFileExtension": "Specified JDK source file does not have a supported file extension.", + "loc.messages.CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/JavaToolInstaller/task.json b/Tasks/JavaToolInstaller/task.json index 8c6c44d6cd6d..54964b8b5c69 100644 --- a/Tasks/JavaToolInstaller/task.json +++ b/Tasks/JavaToolInstaller/task.json @@ -13,7 +13,7 @@ "version": { "Major": 0, "Minor": 134, - "Patch": 0 + "Patch": 1 }, "preview": true, "satisfies": ["Java"], @@ -164,6 +164,9 @@ "SucceedMsg": "Successfully extracted all files.", "SetJavaHome": "JAVA_HOME is being set to: %s", "SetExtendedJavaHome": "%s is being set to: %s", - "UnsupportedFileExtension": "Specified JDK source file does not have a supported file extension." + "UnsupportedFileExtension": "Specified JDK source file does not have a supported file extension.", + "CouldNotFetchAccessTokenforAzureStatusCode": "Could not fetch access token for Azure. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } diff --git a/Tasks/JavaToolInstaller/task.loc.json b/Tasks/JavaToolInstaller/task.loc.json index bc131db0e24b..eb63039ec5be 100644 --- a/Tasks/JavaToolInstaller/task.loc.json +++ b/Tasks/JavaToolInstaller/task.loc.json @@ -13,7 +13,7 @@ "version": { "Major": 0, "Minor": 134, - "Patch": 0 + "Patch": 1 }, "preview": true, "satisfies": [ @@ -166,6 +166,9 @@ "SucceedMsg": "ms-resource:loc.messages.SucceedMsg", "SetJavaHome": "ms-resource:loc.messages.SetJavaHome", "SetExtendedJavaHome": "ms-resource:loc.messages.SetExtendedJavaHome", - "UnsupportedFileExtension": "ms-resource:loc.messages.UnsupportedFileExtension" + "UnsupportedFileExtension": "ms-resource:loc.messages.UnsupportedFileExtension", + "CouldNotFetchAccessTokenforAzureStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforAzureStatusCode", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file diff --git a/Tasks/JenkinsDownloadArtifacts/Strings/resources.resjson/en-US/resources.resjson b/Tasks/JenkinsDownloadArtifacts/Strings/resources.resjson/en-US/resources.resjson index 0c484a9e4653..3233aa4f76c6 100644 --- a/Tasks/JenkinsDownloadArtifacts/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/JenkinsDownloadArtifacts/Strings/resources.resjson/en-US/resources.resjson @@ -123,5 +123,7 @@ "loc.messages.CannotFindJobType": "Could not detect job type", "loc.messages.InvalidJobName": "Invalid job name %s", "loc.messages.ContinuationTokenExistsFetchingRemainingFiles": "Continuation token exists, trying to fetch the list of remaining files.", - "loc.messages.GetArtifactItemsNotSupported": "Get artifact items not supported, invalid code path" + "loc.messages.GetArtifactItemsNotSupported": "Get artifact items not supported, invalid code path", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/JenkinsDownloadArtifacts/task.json b/Tasks/JenkinsDownloadArtifacts/task.json index 5af5043fd0d1..8565845e3a07 100644 --- a/Tasks/JenkinsDownloadArtifacts/task.json +++ b/Tasks/JenkinsDownloadArtifacts/task.json @@ -18,7 +18,7 @@ "version": { "Major": 1, "Minor": 133, - "Patch": 2 + "Patch": 3 }, "groups": [ { @@ -361,6 +361,8 @@ "CannotFindJobType": "Could not detect job type", "InvalidJobName": "Invalid job name %s", "ContinuationTokenExistsFetchingRemainingFiles": "Continuation token exists, trying to fetch the list of remaining files.", - "GetArtifactItemsNotSupported": "Get artifact items not supported, invalid code path" + "GetArtifactItemsNotSupported": "Get artifact items not supported, invalid code path", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } \ No newline at end of file diff --git a/Tasks/JenkinsDownloadArtifacts/task.loc.json b/Tasks/JenkinsDownloadArtifacts/task.loc.json index bc2f971da072..01fb87955564 100644 --- a/Tasks/JenkinsDownloadArtifacts/task.loc.json +++ b/Tasks/JenkinsDownloadArtifacts/task.loc.json @@ -18,7 +18,7 @@ "version": { "Major": 1, "Minor": 133, - "Patch": 2 + "Patch": 3 }, "groups": [ { @@ -361,6 +361,8 @@ "CannotFindJobType": "ms-resource:loc.messages.CannotFindJobType", "InvalidJobName": "ms-resource:loc.messages.InvalidJobName", "ContinuationTokenExistsFetchingRemainingFiles": "ms-resource:loc.messages.ContinuationTokenExistsFetchingRemainingFiles", - "GetArtifactItemsNotSupported": "ms-resource:loc.messages.GetArtifactItemsNotSupported" + "GetArtifactItemsNotSupported": "ms-resource:loc.messages.GetArtifactItemsNotSupported", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file diff --git a/Tasks/PackerBuild/Strings/resources.resjson/en-US/resources.resjson b/Tasks/PackerBuild/Strings/resources.resjson/en-US/resources.resjson index 09cd90b6ac44..ea54e4c6aa5b 100644 --- a/Tasks/PackerBuild/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/PackerBuild/Strings/resources.resjson/en-US/resources.resjson @@ -79,5 +79,8 @@ "loc.messages.ParsingCustomTemplateParameters": "Parsing custom template parameters json.", "loc.messages.FetchingSPNDetailsRemotely": "Fetching SPN details for app id %s from azure AD graph endpoint...", "loc.messages.FetchedSPNDetailsRemotely": "Fetched SPN details successfully. ObjectId: %s", - "loc.messages.FailedToFetchSPNDetailsRemotely": "Could not fetch SPN details from graph endpoint. Error: %s." + "loc.messages.FailedToFetchSPNDetailsRemotely": "Could not fetch SPN details from graph endpoint. Error: %s.", + "loc.messages.GetArtifactItemsNotSupported": "Get artifact items not supported, invalid code path", + "loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "loc.messages.CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } \ No newline at end of file diff --git a/Tasks/PackerBuild/package-lock.json b/Tasks/PackerBuild/package-lock.json index c8b74cb68127..c4823bec9cea 100644 --- a/Tasks/PackerBuild/package-lock.json +++ b/Tasks/PackerBuild/package-lock.json @@ -10,26 +10,10 @@ }, "azure-arm-rest": { "version": "file:../../_build/Tasks/Common/azure-arm-rest-1.0.2.tgz", - "integrity": "sha1-XxtKje67DJxt8Np8AGo740d6oKk=", "requires": { "q": "1.4.1", "typed-rest-client": "0.12.0", "vsts-task-lib": "2.0.5" - }, - "dependencies": { - "vsts-task-lib": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/vsts-task-lib/-/vsts-task-lib-2.0.5.tgz", - "integrity": "sha1-y9WrIy6rtxDJaXkFMYcmlZHA1RA=", - "requires": { - "minimatch": "3.0.4", - "mockery": "1.7.0", - "q": "1.4.1", - "semver": "5.5.0", - "shelljs": "0.3.0", - "uuid": "3.2.1" - } - } } }, "balanced-match": { @@ -225,4 +209,4 @@ } } } -} +} \ No newline at end of file diff --git a/Tasks/PackerBuild/task.json b/Tasks/PackerBuild/task.json index e0cdaa7c5b02..ed35643cc616 100644 --- a/Tasks/PackerBuild/task.json +++ b/Tasks/PackerBuild/task.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 0, - "Patch": 13 + "Patch": 14 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -299,6 +299,9 @@ "ParsingCustomTemplateParameters": "Parsing custom template parameters json.", "FetchingSPNDetailsRemotely": "Fetching SPN details for app id %s from azure AD graph endpoint...", "FetchedSPNDetailsRemotely": "Fetched SPN details successfully. ObjectId: %s", - "FailedToFetchSPNDetailsRemotely": "Could not fetch SPN details from graph endpoint. Error: %s." + "FailedToFetchSPNDetailsRemotely": "Could not fetch SPN details from graph endpoint. Error: %s.", + "GetArtifactItemsNotSupported": "Get artifact items not supported, invalid code path", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "Could not fetch access token for Managed Service Principal. Please configure Managed Service Identity (MSI) for virtual machine 'https://aka.ms/azure-msi-docs'. Status code: %s, status message: %s", + "CouldNotFetchAccessTokenforMSIStatusCode": "Could not fetch access token for Managed Service Principal. Status code: %s, status message: %s" } } \ No newline at end of file diff --git a/Tasks/PackerBuild/task.loc.json b/Tasks/PackerBuild/task.loc.json index 73cb4dae891f..a905dd728581 100644 --- a/Tasks/PackerBuild/task.loc.json +++ b/Tasks/PackerBuild/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 0, "Minor": 0, - "Patch": 13 + "Patch": 14 }, "demands": [], "minimumAgentVersion": "2.0.0", @@ -299,6 +299,9 @@ "ParsingCustomTemplateParameters": "ms-resource:loc.messages.ParsingCustomTemplateParameters", "FetchingSPNDetailsRemotely": "ms-resource:loc.messages.FetchingSPNDetailsRemotely", "FetchedSPNDetailsRemotely": "ms-resource:loc.messages.FetchedSPNDetailsRemotely", - "FailedToFetchSPNDetailsRemotely": "ms-resource:loc.messages.FailedToFetchSPNDetailsRemotely" + "FailedToFetchSPNDetailsRemotely": "ms-resource:loc.messages.FailedToFetchSPNDetailsRemotely", + "GetArtifactItemsNotSupported": "ms-resource:loc.messages.GetArtifactItemsNotSupported", + "CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIDueToMSINotConfiguredProperlyStatusCode", + "CouldNotFetchAccessTokenforMSIStatusCode": "ms-resource:loc.messages.CouldNotFetchAccessTokenforMSIStatusCode" } } \ No newline at end of file