
To start working with Azure R, you'll need to create an Azure account, which can be done in just a few minutes.
Azure R is a cloud-based platform that integrates with Azure Active Directory (Azure AD) to provide secure authentication and authorization for your R applications.
To get started, ensure you have an Azure subscription, which can be obtained for free or through a paid plan.
With Azure AD, you can manage user identities, groups, and permissions, making it easier to control access to your R resources.
Active Directory Authentication
Active Directory Authentication is a crucial aspect of Azure R, and AzureAuth is the package that makes it all possible. It provides Azure Active Directory (AAD) authentication functionality for R users of Microsoft's Azure cloud.
AzureAuth supports both AAD v1.0 and v2.0, and multiple authentication methods, including device code and resource owner grant. This means you can choose the method that best fits your needs.
The package is part of the 'AzureR' family of packages and is based on the 'OAuth' framework in the 'httr' package. This ensures a streamlined and efficient authentication process.
AzureAuth also caches tokens in a user-specific directory obtained using the 'rappdirs' package. This keeps your authentication process organized and easy to manage.
With AzureAuth, you can obtain OAuth 2.0 tokens for services including Azure Resource Manager, Azure Storage, and others. This opens up a world of possibilities for integrating your R code with Azure services.
Azure Services
Azure Services can be a powerful tool for deploying your R model.
You can deploy an R model to an online (real-time) endpoint, which means your model is ready to be used by others.
This is an exciting step in the process, as it allows you to share your model with the world.
To get started, you'll need to learn how to deploy an R model to an online endpoint, which is covered in the next steps section.
By following these steps, you'll be able to share your model with others and get real-time feedback.
Data Management
Data Management is a crucial aspect of Azure R, and with the AzureKusto package, you can easily manage your data. This package includes an interface to Azure Data Explorer, also known as Kusto, a fast and distributed data exploration service from Microsoft.
The AzureKusto package extends the object framework provided by AzureRMR to support creation and deletion of databases, and management of database principals. This makes it easy to set up and manage your databases.
With AzureKusto, you can also manage database principals, which is a key aspect of data management.
Table Storage Interface
The Table Storage Interface is a powerful tool for managing data. It's an interface to the table storage service in Azure, which you can access through the Azure website.
This interface supplies functionality for reading and writing data stored in tables, both as part of a storage account and from a CosmosDB database with the table service API. It's part of the AzureR family of packages, which makes it easy to integrate with other Azure services.
To use the Table Storage Interface, you can use the Azure SDK for Azure Table Storage. This driver models Azure Table APIs as relational tables, views, and stored procedures.
You can retrieve the list of tables using a specific line of code, which will give you access to the data stored in the tables.
Data Explorer
Data Explorer is a fast, distributed data exploration service from Microsoft, accessible through AzureKusto.
It's based on the Kusto engine, which allows for quick and efficient querying of large datasets.
AzureKusto provides an interface to 'Azure Data Explorer', also known as 'Kusto', and includes 'DBI' and 'dplyr' interfaces.
These interfaces enable users to write queries in R and have them translated into the native 'KQL' query language, executed lazily.
On the admin side, AzureKusto extends the object framework provided by 'AzureRMR' to support creation and deletion of databases, and management of database principals.
It's part of the 'AzureR' family of packages, designed to make working with Azure data services more seamless.
Notebooks and DataFrames

You can create a SparkR dataframe using Spark SQL, which is a powerful tool for data analysis. This method allows you to write SQL queries that can be executed on large datasets.
SparkR DataFrames can also be created using Spark SQL queries, making it a flexible and efficient way to work with data.
AzureKusto is an interface to 'Azure Data Explorer', also known as 'Kusto', a fast, distributed data exploration service from Microsoft. This service allows you to explore and analyze large datasets in a scalable and efficient manner.
Plot Table Data
Plotting table data can be a straightforward process. You can create simple bar plots with the built-in bar plot function.
To plot Azure Table data, you can use any data visualization package available in the CRAN repository. This allows for flexibility and customization of the plot.
Azure Table data can be analyzed with data visualization packages, making it possible to create a variety of plots. The bar plot function can be used to create simple bar plots.
Create and Run Notebook Sessions

Notebooks are a great place to validate ideas and use quick experiments to get insights from your data. They're widely used in data preparation, data visualization, machine learning, and other big data scenarios.
To get started with R in Synapse notebooks, you can change the primary language by setting the language option to SparkR (R). This will allow you to run R code in your notebook.
You can also use multiple languages in one notebook by specifying the language magic command at the beginning of a cell. This is useful for combining different languages and techniques in a single notebook.
Create Spark DataFrame from Local Data
You can create a Spark DataFrame from a local R data.frame by converting it into a Spark DataFrame using the as.DataFrame function. This is a simple way to get started with Spark DataFrames.
To do this, you'll need to pass in your local R data.frame to the as.DataFrame function. This function takes your local data and converts it into a Spark DataFrame, which you can then use for analysis and manipulation.

You can also create a Spark DataFrame from a local R data.frame by using the as.DataFrame function and passing in your data. This approach is straightforward and works well for small to medium-sized datasets.
Using Spark SQL queries is another way to create a Spark DataFrame. You can write a query that selects the data you need and then use the Spark SQL engine to execute it and create a Spark DataFrame.
Manage Sessions
Managing sessions in Azure R is a breeze, especially with the ability to use session-scoped packages. This feature allows you to add, manage, and update session dependencies without having to update the entire Apache Spark pool.
You can install session-scoped libraries, and they'll only be available to the current notebook, not impacting other sessions or jobs using the same Spark pool. These libraries are installed on top of the base runtime and pool level libraries, and notebook libraries take the highest precedence.
Here are the key things to know about session-scoped R libraries:
- They don't persist across sessions, so you'll need to reinstall them at the start of each session.
- They're automatically installed across both the driver and worker nodes.
You can install R libraries from CRAN and CRAN snapshots, like Highcharter, a popular package for R visualizations. To do this, you'll use the installation command, which will install the library on all nodes within your Apache Spark pool.
Frequently Asked Questions
What is Azure R?
Azure R is a family of lightweight yet powerful R packages for working with Azure. They provide direct access to the Azure REST API, eliminating language dependencies.
Can you run R on Azure?
Yes, you can run R on Azure using a notebook in your Azure Machine Learning workspace. To get started, select a notebook and ensure your compute instance is running.
What does Azurerm stand for?
Azure Resource Manager is a cloud management system, often abbreviated as ARM. It's a key component of Microsoft Azure, helping you manage and deploy cloud resources efficiently.
Sources
- https://azure.r-universe.dev/packages
- https://learn.microsoft.com/en-us/azure/machine-learning/how-to-r-train-model
- https://www.cdata.com/kb/tech/azure-odbc-r.rst
- https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-r-language
- https://www.r-bloggers.com/2018/11/azurer-r-packages-to-control-azure-services/
Featured Images: pexels.com