A reference implementation for provisioning Linux VMs on Azure.
Azure-init is a lightweight provisioning agent that configures Linux virtual machines using Azure metadata. Azure-init is suitable for systems which do not require the full feature set that cloud-init provides. It is a modern, rust-based replacement for the WALinuxAgent provisioning agent to:
- Configure admin user account
- Write SSH keys for authentication
- Set the hostname
- Report ready to Azure wireserver
Azure-init is designed to be minimal, fast, and reliable, with very few dependencies. This allows it to run in the early stages of the boot process when initializing Linux VMs in Azure.
- Minimal footprint: Small binary size and few dependencies
- Fast execution: Optimized for quick VM provisioning
- Early boot compatibility: Can run in very early boot stages
- Azure-specific: Tailored for the Azure environment
- Configurable: Allows customization through configuration files
- Telemetry: Provides KVP-based telemetry for the provisioning process which is used to report detailed errors for some classes of provisioning failures, such as networking failures
Azure-init consists of two main components:
- azure-init - The main provisioning agent run on Azure VMs.
- libazureinit - A library that provides core functionality for accessing provisioning functionality and Azure services.
The agent communicates with the Azure Instance Metadata Service (IMDS) to retrieve VM-specific configuration data, and then applies the appropriate configurations to the Linux system.
For a detailed architectural overview, see Architecture Documentation.
For step-by-step instructions on installing, configuring, and using azure-init, please refer to our Getting Started Guide.
- Rust programming environment
- Access to an Azure subscription (for e2e testing)
To install Rust see here: https://www.rust-lang.org/tools/install.
Building this project can be done by going to the base of the repository in the command line and entering the command cargo build --all
.
This project contains two binaries, the main provisioning agent and the functional testing binary, so this command builds both.
These binaries are quite small, but you can build only one by entering cargo build --bin <binary_name>
and indicating either azure-init
or functional_tests
.
To run the program, you must enter the command cargo run --bin <binary_name>
and indicating the correct binary.
Document | Description |
---|---|
Getting Started Guide | Step-by-step instructions for new users |
Architecture Overview | High-level system design and component interactions |
Configuration Guide | Detailed configuration options and file structure |
Tracing System | Understanding the telemetry and tracing capabilities |
End-to-End Testing | How to perform comprehensive system testing |
Library Documentation | Documentation for the libazureinit library |
Azure-init supports customization through configuration files.
The default configuration path is /etc/azure-init/azure-init.toml
, but additional configuration can be provided in the /etc/azure-init/azure-init.toml.d/
directory.
For detailed information about configuration options and structure, see Configuration Documentation.
Azure-init includes two types of tests: unit tests and end-to-end (e2e) tests.
From the root directory of the repository, run:
cargo test --verbose --all-features --workspace
This command runs unit tests across all libraries in the repository — not just for azure-init. Running the full suite ensures your local testing environment mirrors what’s executed in the CI pipeline.
Please refer to e2e_testing.md for end-to-end testing.
Contributions require you to agree to Microsoft's Contributor License Agreement (CLA). Please refer to CONTRIBUTING.md for detailed instructions.
This project adheres to the Microsoft Open Source Code of Conduct. Check out CODE_OF_CONDUCT.md for a brief collection of links and references.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
For common library used by this reference implementation, please refer to libazureinit.