简体   繁体   中英

Azure continuous deployment from different VSTS account

I'm trying to setup continuous deployment via the Aure Portal.

When doing this via the VSTS account (let's call it "VSTS Account A") which is owned by the same account owner as Azure, everything works fine.

In this case I'm trying to configure continuous deploymenet from source code held in another VSTS account (let's go with Account B).

The Azure account owner is not the Account B owner but is an admin (member of Organization Administrators) for Account B. The owner is also listed explicitly as a member of at least one project within Account B.

The problem is that when it commes to configuring "Deployment source" within the app service section, Account B is not listed as an option to choose from.

I've followed various links (eg part 4 of this page ) about linking the VSTS account with an Azure account but still no joy. There are a couple of problems here:

  • The Azure classic portal has a New button within the Visual Studio Team Services section but when I choose Link To Existing, I get the following message:

    Make sure you're the account owner. If you are, maybe your account is linked to another Azure subscription or connected to another Azure Active Directory

    Account B is not linked to another Azure Subscription or Azure AD.

  • The new portal doesn't even have an option to attempt to link a different account, plus the menu link says "Team Services Account Preview" so whether the Preview status has something to do with it, I don't know.

I'd have thought this would be a relatively common use case, has anyone had any joy setting up something similar?

I was finally able to choose the relevant account by making the VSTS principal a co-admin in the Azure account which contains the web app, signing in as that user and changing the directory to use from the the user dropdown menu (top-right). Note, the user account in question is already an administrator for a different Azure account, just to complicate matters further. I only had the option to change the directory once the user was a member of multiple directories.

So I finally got it configured and committing code to the specified branch was triggering a deploy. However, it transpires that setting up continuous deployment from within Azure gives you limited scope and I got constant errors which were not straightforward to fix.

I ended up getting it working properly by following these instructions:

Configuring it all from within VSO gives you a lot more clarity about what's actually happening.

When doing the initial setup, I had to go through an authentication step with the Azure account I was trying to deploy to and that process launches a pop-up window which was getting blocked so I missed it at first.

The initial build and deploy were fine but I was getting a build error when being triggered from a code commmit. This is because the Build Definition --> Variables --> BuildConfiguration value was set back to Release even though I set it to the correct value for my project when doing the initial configuration. Once I updated that, the next commit triggered the build which in turn created the artifact which in turn triggered the deploy which went through fine.

Googler from the future here, I had the same problem and came across a really good article called "DevOps: Connecting VSTS to Azure by Ken Muse" enter link description here

This worked like a charm for me from the first try!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM