From ab6043ac36e8171edf5a314d73a10c30e85d0e69 Mon Sep 17 00:00:00 2001 From: Pramod Valavala <43602528+PramodValavala-MSFT@users.noreply.github.com> Date: Mon, 7 Mar 2022 21:49:12 +0530 Subject: [PATCH] Fix az commands used in Service Endpoint Manager --- .../service_endpoint/service_endpoint_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure_functions_devops_build/service_endpoint/service_endpoint_manager.py b/azure_functions_devops_build/service_endpoint/service_endpoint_manager.py index 1142735..e2bdeaf 100644 --- a/azure_functions_devops_build/service_endpoint/service_endpoint_manager.py +++ b/azure_functions_devops_build/service_endpoint/service_endpoint_manager.py @@ -48,7 +48,7 @@ def create_service_endpoint(self, repository_name): """Create a new service endpoint within a project with an associated service principal""" project = self._get_project_by_name(self._project_name) - command = "az account show --o json" + command = "az account show -o json" token_resp = check_output(command, shell=True).decode() account = json.loads(token_resp) @@ -62,7 +62,7 @@ def create_service_endpoint(self, repository_name): service_principle_name = self._get_service_endpoint_name(repository_name, "pipeline") # A service principal name has to include the http/https to be valid - command = "az ad sp create-for-rbac --o json --name http://" + service_principle_name + command = "az ad sp create-for-rbac -o json --name http://" + service_principle_name try: token_resp = check_output(command, stderr=DEVNULL, shell=True).decode() except CalledProcessError: