Edit

Share via


Configure your Rust development environment for Azure

Configure your local Rust development environment for Azure to build cloud applications efficiently on your workstation before deployment. Local development gives you access to a wider variety of tools and a familiar environment for faster iteration.

This article provides suggestions to set up and validate a local Rust development environment that integrates seamlessly with Azure services.

One-time subscription creation

You create Azure resources within a subscription and resource group. If you don't have a subscription, create a free trial subscription.

If you already have a subscription, access your existing subscription with:

One-time software installation

For Azure development with Rust on your local workstation, install the following tools:

Name/Installer Description
Rust Install the Rust programming language via rustup, which includes the Rust compiler (rustc), package manager (cargo), and standard library.
Visual Studio Code Visual Studio Code gives you a great Rust integration and coding experience but it isn't required. You can use any code editor.
Visual Studio Code extensions Install any relevant extensions for Azure services you intend to use.
rust-analyzer extension The recommended VS Code extension for Rust language support, providing code completion, error checking, and more.

How to install Rust

Follow these steps to install Rust:

  1. Go to https://www.rust-lang.org/tools/install.

  2. Follow the instructions for your operating system to install rustup, the Rust toolchain installer.

  3. Verify your installation by running the following commands:

    rustc --version
    cargo --version
    

The Rust toolchain includes:

For detailed installation guidance and troubleshooting, see the Installation chapter in The Rust Programming Language book. For development environment setup tips, including editor configuration, see the Development Environment chapter and the official Rust development tools guide.

Create an Azure resource group for your project

  1. Open the Azure portal in a web browser.

  2. In the search bar, enter resource groups and select it.

  3. Select + Create.

  4. Enter your resource group settings:

    Property Value
    Subscription Select your subscription.
    Resource group Enter your resource group name. This resource group name is used as part of a resources URI when you access the Resource Manager (management plane). The name isn't used for control (such as creating a database) or data plane (inserting data into a table).
    Region Select a geographical region for the resource group.
  5. Select Review + create to begin validation.

  6. When validation successes, select Create.

Add Azure SDK crates to your Rust project

You can get the Azure SDK for Rust crates from crates.io. To learn more, see Azure SDK for Rust.

Authenticate to Azure

To authenticate to Azure from your Rust application, use the Azure Identity SDK crate. This library provides a set of credential types that you can use to authenticate to Azure services.

Additional Rust resources

If you're new to Rust, these official resources can help you get up to speed: