Importing an Azure DevOps organization
When you import an Azure DevOps organization to SonarQube Cloud, the corresponding organization is created in SonarQube Cloud and is bound to the DevOps platform organization: each SonarQube Cloud organization corresponds one-to-one with an Azure DevOps organization.
The user account you used for the import is automatically assigned to the organization’s Owners group which grants you administration rights on the organization.
Prerequisites
You must be an administrator of the Azure DevOps organization.
Step 1: Create a PAT on the Azure organization
SonarQube Cloud uses an Azure DevOps user account to import your Azure DevOps organization and repositories. You must provide a Personal Access Token (PAT) from this account (The PAT will be stored in the respective SonarQube Cloud organization.). We highly recommend that you use a dedicated technical user account in Azure DevOps.
- If you create a project manually, you can set the Azure PAT at the project level but this is not recommended. You should create a bound organization and make sure that the PAT is entered only at the organization level, not at the project level. The project-level field should be left blank.
- If you need to change the PAT stored in the SonarQube Cloud organization, see Changing organization settings.
About the Azure PATs
Be aware of the following PAT failure points:
- Azure PATs require an expiration date. Check the Microsoft documentation for details when creating your PAT.
- Azure requires that a user log in every 30 days, or it automatically kills a PAT; this action may cause your related pipeline to fail. Here is an Azure Q&A on this topic.
Creating a technical user account
We highly recommend that you use a dedicated technical user account in Azure DevOps to manage the integration with SonarQube.
- Do not set the technical user’s account with a Stakeholder access type. Use the Basic access type instead. (Users with the Stakeholder access type can have problems finding their repos when trying to analyze projects.)
- We recommend that you add the account to the Contributors security group.
See the Azure documentation for more information about access levels.
Generating your Azure PAT
1. Log in to Azure DevOps with the technical user account created before.
2. Go to your Azure DevOps organization User settings > Personal access tokens and select + New token.
3. On the next page, under Scopes, make sure that you specify at least the scope Code > Read & write.
4. Click Create to generate the token.
5. When the personal access token is displayed, copy it (you will have to paste it to SonarQube's configuration record as described below).
Step 2: Import your Azure organization
To import your Azure organization to SonarQube Cloud:
- Log in to SonarQube Cloud with any DevOps platform account or your SAML SSO account. If you don't use your Azure DevOps account, see Importing organizations from multiple DevOps platforms for important insights.
- At the top right of the SonarQube Cloud interface, select the ✚ (plus) menu and select Create new organization. The Create an organization page opens.
- Under Import from a DevOps platform, select the Azure DevOps button.
- Follow the instructions.
- Paste the PAT you created in Step 1 to Personal Access Token,.
- Select Continue.
- In Import organization details, SonarQube Cloud suggests a Name and Key for your SonarQube Cloud organization. The key is unique across all organizations within SonarQube Cloud. You can accept the suggestion or change it manually. The interface will prevent you from changing it to an already existing key.
- Select Add additional info to add:
- An avatar: a small image representing the organization and displayed on the UI near the organization name.
- A description of the organization.
- A URL: the URL of the homepage of the organization displayed on the UI.
- In Choose a plan, select the subscription plan for your organization.
- If you selected a paid plan, select the number of Lines of Code (LOC) for your plan and follow the instructions to enter your billing and payment information.
- Select Create Organization. The organization is created and opened in SonarQube Cloud.
Related pages
- Importing a GitHub organization or your personal account
- Importing a Bitbucket Cloud workspace
- Importing a GitLab group
- Importing organizations from multiple DevOps platforms using the same account
- Creating an organization manually
- Binding an unbound organization
- Changing the organization settings
- Deleting an organization
Was this page helpful?