Architecture-center: Information on using Azure Devops with R

Created on 31 Jul 2019  ·  16Comments  ·  Source: MicrosoftDocs/architecture-center

Would like to see some notes + guides specific to using Azure Devops + R.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 assigned-to-author doc-enhancement machine-learninsvc triaged

Most helpful comment

My requirement is similar but simpler. I would just like to Connect RStudio version control to an Azure Devops repository.

All 16 comments

Hi @brshallo - Thank you for your feedback! We have assigned this issue to the author to review further and take the right course of action.

Hi, @brshallo. Can you elaborate a little bit on what you're looking for?

For example, do you have some R code that you would like to manage within Azure DevOps? Do you have R models that you would like to deploy with CI/CD pipelines?

Or are you looking to control Azure DevOps with R? Would you like to write an R script that calls the DevsOp API to kick off a new build?

@AnalyticJeremy in the immediate term, we are moving some internally developed R packages to Azure Devops. We would like to use Azure Devops to manage tests as well as documentation + vignette building for these packages. (Our team is just getting access, and I expect in the long-term we will use Azure Devops for a much broader set of use cases).

I found some Azure Devops + R tutorials on @robertdj blog, e.g. test r in azure devops and found this thread on Rstudio Community's page. Though could not find documentation specific to R + Azure Devops on Microsoft's site, even on simple things like how to point my colleagues to easily install packages from a repo on Azure Devops -- instigating this set of tweets: https://twitter.com/brshallo/status/1156260156503707648 .

Given Microsoft's strong support of R in Azure and across your products more generally, I was expecting to find materials/getting started guides specific to Azure Devops + R (hence my post/issue on the docs page).

Thank you for pointing out this gap in our documentation. I will talk with some of our R developers and see if we can get this article in the pipeline.

I am in the same boat so I second this.

But can I add an additional request? It would be nice to have some documentation geared towards IT/software personnel. As in, what is different about R packages vs. other programming languages? For example, vignettes and/or data are often included in R packages (not sure if this is true for other languages). Essentially, something to bridge the gap between IT/software people who might not know anything about R and R users.

@brshallo This item is still in the backlog. In the meantime, it might help to check out this timely blog post from @revodavid
https://blog.revolutionanalytics.com/2019/09/devops-and-r.html

@asbates Can you elaborate a bit on your request? Are you looking for general information on how R packages work? Or are you looking for information specific to how R packages can be included in a DevOps pipeline?

@AnalyticJeremy I'm looking for information specific to R packages in a DevOps pipeline. Essentially, what @brshallo is looking for: building R packages including running tests and building documentation + vignettes.

In addition to that I was hoping to have a quick summary of how to set this up, what sort of system setup is required, etc., but geared towards IT personnel. I think generally, IT may not know much about R. But they will likely be needed to help with setup and if they don't even know what R is, this will probably be difficult.

If this is a bit off-topic I can file a separate issue. Or if you don't think this will be necessary that's fine too. But I wanted to ask just in case.

My requirement is similar but simpler. I would just like to Connect RStudio version control to an Azure Devops repository.

@athosfolk 's comment is headed in the right direction IMHO

AB#160263 - Thanks for reporting - this issue is under review

We have taken this up as a backlog item. Closing the issue as it needs creation of a separate article to link to this content which will be addressed by our backlog item

My requirement is similar but simpler. I would just like to Connect RStudio version control to an Azure Devops repository.

Hello,
Is there any information to answer @athosfolk's inquiry?

I am also searching on how to Connect RStudio's version control to an Azure DevOps repository.

I am not familiar with the version control functionality in the RStudio products. However, I found that they posted an article that might be helpful:
https://support.rstudio.com/hc/en-us/articles/360045105794-How-to-setup-Git-backed-content-deployment-from-a-private-repository-in-RStudio-Connect

Azure DevOps uses Azure AD for user credentials. Many third-party services don't support this. Therefore, Azure DevOps supports "Personal Access Tokens" that allow you to give a third-party service access to your DevOps git repos.
https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page

Do either of these articles help answer your question, @LindsayDChristian? Or did I misunderstand your request?

Thank you @AnalyticJeremy - those links are helpful for deploying apps. The functionality I was hoping DevOps would have is a similar simple version control as follows:

Initial Setup

  1. Assuming the use of Windows PC, Git for Windows is required. [_is there a similar program used for DevOps e.g. SubVersion?_]
  2. In RStudio. Go to Tools > Global Options… > Git/SVN. Then specify “Git executable” as C:/Program Files/Git/bin/git.exe. Click OK.
  3. In RStudio, go to File > New Project… > Version Control > Git. Enter the link to the GitHub repository: https://github.com/<_path to repository_>.git (The link can be copied from the “Code” button of GitHub repository). Click “Create project”. This will clone the repository to the local machine. It may ask for sign in with GitHub credentials as well.

Pulling a repository:
Pulling a respository is synchronising the scripts on your machine with the latest version.

Locate “Git” pane next to “Environment”, “History”. and “Connections”.
Click “Pull” button.
IMPORTANT: Check if it pulled without any error message.

Making changes - save, commit, and PUSH
Save files after amending the code.
“Git” pane will show the files that have been amended (unless excluded by .gitignore^).
Check “Staged” checkboxes next to the files to be committed.
Click “Commit”.
Check changes to be sent to the repository. Enter amendment comments.
Click “Commit”.
IMPORTANT: again, check if it committed the changes without any error message.
Click “Push”.
IMPORTANT: once again, check if it pushed your commit without any error message.

^Should you want to exclude any file to be shared in the repository, you need to add it to .gitignore file.

From the links you have shared and my searching to date it seems DevOps does not appear to have a similar functionality?

Thank you for the additional details, @LindsayDChristian. I think I have some good news for you!

Azure DevOps uses Git for its source control repositories. So the RStudio instructions you posted will generally work the same. You will still need to install Git for Windows on your PC (as described in your instructions). And you will still PULL and PUSH to the Azure DevOps Git Repo with RStudio.

The main difference is that instead of using a GitHub URL in Step 3, you will use an Azure DevOps URL. In Azure DevOps, open your project and click "Repos" from the panel on the right of the screen. This will take you to your repo. In the upper right corner, there's a button that says "Clone". If you click that button, it will show you the Git URL that you need to enter into RStudio.

The URL should look something like: https://<your org name>@dev.azure.com/<your org name>/<your project name>/_git/<your repo name>

Does this help?

Was this page helpful?
0 / 5 - 0 ratings