azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

AZDO pipeline support does not recognize visualstudio.com as a valid AZDO host

Open KSchlobohm opened this issue 3 years ago • 7 comments

Output from azd version

azd version 0.3.0-beta.5 (commit 38169d7067ac73dc4e214e6913bee5e5359b8b15)

Output from az version

{
  "azure-cli": "2.41.0",
  "azure-cli-core": "2.41.0",
  "azure-cli-telemetry": "1.0.8",
  "extensions": {
    "containerapp": "0.3.13",
    "log-analytics": "0.2.2",
    "rdbms-connect": "1.0.4"
  }
}

Describe the bug Receiving an error that's blocking my ability to setup AZDO pipelines until I change my origin URL

To Reproduce

  1. sign into an AZDO repo that automatically redirects you to VisualStudio.com
  2. clone code from AZDO repo
  3. run azd pipeline config --provider azdo
  4. observe error message

Error: ensuring git remote: existing remote is not an Azure DevOps host

Expected behavior Expected that other valid URLs would be recognized

example
<Azure DevOps Org Name>.visualstudio.com

Environment * PowerShell 7.2.7

Additional context

KSchlobohm avatar Nov 02 '22 19:11 KSchlobohm

Also blocked with a URL of the pattern similar to:

 https://dev.azure.com/mydevOpsOrgName/myProjectName

KSchlobohm avatar Nov 02 '22 19:11 KSchlobohm

@hattan can you help triage this?

rajeshkamal5050 avatar Nov 03 '22 16:11 rajeshkamal5050

Thanks for the feedback @KSchlobohm. This is due to how we validate Azure DevOps urls to ensure that existing remotes match a users selection when running azd pipeline config --provider azdo

We can definitely add support for the visualstudio.com domain.

Until that is available there is a workaround which is to set the organization to use the newer dev.azure.com domain. This is can be found under Organization Settings -> General

https://dev.azure.com/<ORG_NAME>/_settings/organizationOverview

image

https://dev.azure.com/mydevOpsOrgName/myProjectName

In terms of this URL pattern, we do validate that https urls are specifically git remotes in this format. https://<ORG_NAME>@dev.azure.com/<ORG_NAME>/<PROJECT>/_git/<PROJECT>

but we will investigate further and look into adding the visualstudio.com domain as well.

hattan avatar Nov 03 '22 16:11 hattan

I'd like to put it out there that I don't have permissions to change the ADO settings for my org. As a result, the workaround by @hattan below does not work for me.

Thanks for the feedback @KSchlobohm. This is due to how we validate Azure DevOps urls to ensure that existing remotes match a users selection when running azd pipeline config --provider azdo

We can definitely add support for the visualstudio.com domain.

Until that is available there is a workaround which is to set the organization to use the newer dev.azure.com domain. This is can be found under Organization Settings -> General

https://dev.azure.com/<ORG_NAME>/_settings/organizationOverview

image

https://dev.azure.com/mydevOpsOrgName/myProjectName

In terms of this URL pattern, we do validate that https urls are specifically git remotes in this format. https://<ORG_NAME>@dev.azure.com/<ORG_NAME>//_git/

but we will investigate further and look into adding the visualstudio.com domain as well.

tonyeung avatar Feb 10 '23 18:02 tonyeung

Hello, I'm also running into this issue.

azd cli version 1.5.1

error message after entering PAT: ERROR: ensuring git remote: existing remote is not an Azure DevOps host

git remote url: https://dev.azure.com/organization/Project/_git/ProjectRepo

bmallen1 avatar Jan 02 '24 22:01 bmallen1

It only supports this pattern by now according to https://github.com/Azure/azure-dev/blob/4a1aba4535d394c5f7ccc2d46576e4b8f3fb8681/cli/azd/pkg/pipeline/azdo_provider.go#L425

https://<ORG_NAME>@dev.azure.com/<ORG_NAME>//_git/ After cloning using the pattern and it seems work.

sunggonm avatar Feb 24 '24 00:02 sunggonm

Hi? Is there any update on this as it's not possible to change the domain pattern in my situation.

geegee4iee avatar Jul 03 '24 12:07 geegee4iee

@geegee4iee , I've created a PR for it

vhvb1989 avatar Jul 11 '24 01:07 vhvb1989