使用 GitHub 帳戶登入 Visual Studio 訂用帳戶Signing in to Visual Studio subscription(s) with your GitHub account

登入您 Visual Studio 訂用帳戶的步驟取決於您使用的帳戶類型。The steps to sign in to your Visual Studio subscription depend on the kind of account you're using. 例如,您可能使用 Microsoft 帳戶 (MSA) 或您的雇主或學校提供的電子郵件地址。For example, you may be using a Microsoft Account (MSA) or an email address supplied by your employer or school. 2019 年 1 月起,您現在也可以使用您的 GitHub 帳戶來登入某些訂用帳戶。As of January 2019, you can now also use your GitHub account to sign in to some subscriptions.

本文將提供使用 GitHub 帳戶登入的步驟。This article will provide the steps for signing in with your GitHub account.

使用您的 GitHub 帳戶登入Signing in with your GitHub account

GitHub 身分識別支援可讓您使用現有 GitHub 帳戶,作為新或現有 Microsoft 帳戶的認證,將您的 GitHub 帳戶與 Microsoft 帳戶連結。GitHub identity support lets you use your existing GitHub account as a credential for a new or existing Microsoft account, linking your GitHub account with your Microsoft account.

當您登入 GitHub 時,Microsoft 會檢查與您 GitHub 帳戶建立關聯的任何電子郵件地址,是否與現有的個人或企業 Microsoft 帳戶相符。When you sign in with GitHub, Microsoft checks whether any email addresses associated with your GitHub account match an existing personal or enterprise Microsoft account. 如果電子郵件地址符合您的企業帳戶,系統會提示您改為登入該帳戶。If the address matches your enterprise account, you'll be prompted to sign in to that account instead. 如果電子郵件地址符合個人帳戶,我們會將您 GitHub 帳戶新增為登入該個人帳戶的方法。If the address matches a personal account, we’ll add your GitHub account as a sign-in method to that personal account.

連結您的 GitHub 和 Microsoft 帳戶認證之後,您可以從任何可使用個人 Microsoft 帳戶的位置 (例如 Azure 網站、Office 應用程式和 Xbox) 使用該單一登入。After your GitHub and Microsoft account credentials are linked, you can use that single sign-in anywhere a personal Microsoft account can be used, like on Azure sites, Office apps, and Xbox. 這些帳戶也可以用於讓 Azure Active Directory 來賓登入為 Microsoft 帳戶 (假設電子郵件地址符合邀請中的其中一個)。These accounts can also be used for Azure Active Directory guest sign ins as a Microsoft account, assuming the email address matches the one on the invite.

注意

將 GitHub 身分識別連結到 Microsoft 帳戶,不會提供 Microsoft 任何程式碼存取權。Linking a GitHub identity to a Microsoft account doesn't give Microsoft any code access. 當應用程式 (例如 Azure DevOps 與 Visual Studio) 需要存取您的程式碼存放庫時,系統會提示您授與此存取權的特定同意。When apps such as Azure DevOps and Visual Studio require access to your code repositories, you'll be prompted to grant specific consent for this access.

常見問題集Frequently asked questions

針對您使用 GitHub 帳戶認證登入 Visual Studio 訂用帳戶時可能會遇到的問題,下列常見問題集可協助您解決。The following FAQs address questions you may encounter regarding the use of your GitHub account credentials to sign in to Visual Studio subscriptions.

問:我忘了我的 GitHub 密碼。Q: I forgot my GitHub password. 我現在應如何存取我的帳戶?How can I access my account now?

答:您可以藉由嘗試 重設您的密碼來復原您的 GitHub 帳戶。A: You can recover your GitHub account by going to Reset your password. 或者,您可以在復原您的帳戶上輸入您的 GitHub 帳戶電子郵件地址,來復原您與 GitHub 連結的 Microsoft 帳戶。Or, you can recover your GitHub-linked Microsoft account by entering your GitHub account’s email address at Recover your account.

問:我已刪除我的 GitHub 帳戶。Q: I deleted my GitHub account. 我現在應如何存取我的 Microsoft 帳戶 (MSA)?How can I access my Microsoft account (MSA) now?

答:如果您的 MSA 上沒有任何其他認證 (例如密碼、驗證器應用程式或安全性金鑰) ,您可以使用附加的電子郵件地址來復原 Microsoft 帳戶。A: If you don’t have any other credentials on your MSA (like a password, Authenticator app, or security key), you can recover your Microsoft account by using the email address attached to it. 若要開始使用,請前往復原您的帳戶To get started, go to Recover your account. 您必須將密碼新增至您的帳戶,讓我們知道稍後如何將您登入。You’ll have to add a password to your account so we'll know how to sign you in later.

問:登入頁面上沒有 [使用 GitHub 登入] 選項。Q: There's no "Sign in with GitHub" option on the sign-in page. 我應如何使用我的 GitHub 認證登入?How can I use my GitHub credentials to sign in?

答:輸入您在建立 GitHub 連結的 Microsoft 帳戶時所選擇的 GitHub 帳戶電子郵件地址。A: Type the GitHub account email address you chose when you created your GitHub-linked Microsoft account. 我們將尋找您的資訊,並將您轉至 GitHub 進行登入。We’ll look you up and send you to GitHub for sign-in. 或者,如果登入頁面中有登入選項連結,請按一下該連結,並使用顯示的 [使用 GitHub 登入] 按鈕。Or, if there’s a Sign-in options link on the sign in page, use the Sign in with GitHub button that's shown after you click that link.

問:我無法使用 GitHub 登入我的一些應用程式和產品。Q: I can't sign in to some of my apps and products with GitHub. 原因為何?Why?

答:並非所有的 Microsoft 產品都可以從其登入頁面(例如 Xbox 主控台)存取 GitHub.com。A: Not all Microsoft products can access GitHub.com from their sign-in page—for example, Xbox consoles. 當您鍵入從 GitHub 帳戶連結的電子郵件地址時,我們會傳送驗證碼到該地址,以便確認這是您本人。Instead, when you type the email address from your linked GitHub account, we’ll send a code to that address so we can verify it’s really you. 您仍會登入到相同的帳戶,只是登入方法不同。You’re still signing in to the same account, just by a different sign-in method.

問:我已將密碼新增至我已連結至 GitHub 帳戶的 Microsoft 帳戶。Q: I've added a password to the Microsoft account I have linked to my GitHub account. 這會造成問題嗎?Will that cause a problem?

答:不是。A: Not at all. 這不會變更您的 GitHub 密碼,只是您多了另一種方式來登入您的 Microsoft 帳戶。This doesn’t change your GitHub password; you’ll just have another way to sign in to your Microsoft account. 每當您使用您的電子郵件地址登入時,我們會讓您選擇使用您的 Microsoft 帳戶密碼登入或轉至 GitHub 登入。Whenever you sign in using your email address, we’ll offer you the choice of signing in with your Microsoft account password or going to GitHub to sign in. 如果您需要新增密碼,我們強烈建議您使用與您 GitHub 帳戶不同的密碼。We strongly recommend that, if you need to add a password, you make sure it’s different from the password for your GitHub account.

問:我想要將驗證器應用程式新增至我使用 GitHub 建立的帳戶。Q: I want to add the Authenticator app to the account I created using GitHub. 可以這麼做嗎?Can I do that?

答:沒問題,只需下載應用程式並使用您的電子郵件地址登入即可。A: No problem — just download the app and sign in using your email address. 當您使用您的電子郵件地址登入時,系統將會提示您選擇驗證器應用程式或 GitHub 作為您的認證。When you sign in with your email address, you'll be prompted to choose either the Authenticator app or GitHub as your credential.

問:我已在我的 GitHub 和 Microsoft 帳戶上啟用雙因素驗證 (MSA) ,但是當我登入 MSA 時,仍會要求您驗證兩次。Q: I've enabled two-factor authentication on both my GitHub and Microsoft accounts (MSA), but when I sign in to my MSA, I'm still asked to authenticate twice. 原因為何?Why?

答:由於安全性限制,Microsoft 會將以 GitHub 登入作為單一要素驗證,即使您在該處啟用了雙步驟驗證也一樣。A: Because of security restrictions, Microsoft counts signing in with GitHub as a single-factor verification, even if you have two-step verification enabled there. 因此,您必須重新驗證您的 Microsoft 帳戶。Therefore, you’ll have to authenticate again for your Microsoft account.

問:如何判斷我的 Microsoft 帳戶和 GitHub 帳戶是否已連結?Q: How can I tell if my Microsoft account and GitHub accounts are linked?

答:當您使用帳號別名來簽署時 (電子郵件地址、電話號碼、Skype 名稱) ,我們會為您的帳戶顯示所有登入方法。A: Whenever you sign using your account alias (email address, phone number, Skype name), we’ll show you all the sign-in methods for your account. 如果您沒有看到 GitHub,則表示您還沒有設定 GitHub。If you don’t see GitHub there, you haven’t set it up yet.

答:請移至 account.microsoft.com 的 [安全性] 索引標籤 ,然後按一下 [ 更多安全性選項 ],將您的 GitHub 帳戶取消連結。A: Go to the Security tab of account.microsoft.com and click More security options to unlink your GitHub account. 取消您 GitHub 帳戶的連結會將其從登入方法移除,並移除 Visual Studio 中任何 GitHub 存放庫的存取權。Unlinking your GitHub account removes it as a sign-in method and removes access to any GitHub repositories in Visual Studio. 其他 Microsoft 產品可能會個別要求存取您的 GitHub 帳戶,因此移除該存取權不會在所有產品中移除存取權。Other Microsoft products might have requested access your GitHub account separately, so removing the access here won’t remove access in all products. 前往 GitHub 設定檔的應用程式權限頁面,並從在該處列出的應用程式中撤銷同意。Go to the application permissions page of your GitHub profile to revoke consent from the apps listed there.

問:我嘗試使用我的 GitHub 帳戶登入,但系統提示我已經有應該改用的 Microsoft 身分識別。Q: I try to use my GitHub account to sign in, but I'm prompted that I already have a Microsoft identity that I should use instead. 這是為什麼?What's happening?

答:如果您的 GitHub 帳戶上有 Azure Active Directory 的電子郵件地址,這表示您已經擁有可存取 Azure 的 Microsoft 身分識別,並使用您的 GitHub 程式碼執行 CI 管線。A: If you have an Azure Active Directory email address on your GitHub account, this means you already have a Microsoft identity that can access Azure and run CI pipelines using your GitHub code. 使用該帳戶可確保您的 Azure 資源和組建管線保留在您組織範圍內。Using that account ensures that your Azure resources and build pipelines remain within your organizational boundaries. 不過,如果您要進行個人工作,我們建議在您的 GitHub 帳戶上設定個人電子郵件地址,讓您隨時都能存取。However, if you’re doing personal work, we recommend putting a personal email address on your GitHub account so that you'll always have access to it. 完成此操作後,請再次嘗試登入,並在系統提示您登入您的公司或學校帳戶時,選擇 [使用不同的電子郵件地址]。Once you do this, try signing in again and choose Use a different email address when you're prompted to sign in to your work or school account. 這會讓您使用該個人電子郵件地址來建立新的 Microsoft 帳戶。This will let you create a new Microsoft account using that personal email address.

請參閱See also

後續步驟Next steps

當您成功登入訂用帳戶入口網站時,建議您前往 https://my.visualstudio.com/benefits 上的 [優點] 頁面,並探索提供給您的絕佳工具、服務及供應項目。Once you've successfully signed in to the subscriptions portal, we recommend visiting the Benefits page at https://my.visualstudio.com/benefits and exploring the great tools, services, and offers available to you.