第 16 章 Preparing and uploading VHD images to Microsoft Azure


You can create custom images and update them, either manually or automatically, on the Microsoft Azure cloud by using RHEL image builder.

To create a VHD image that you can manually upload to the Microsoft Azure cloud, you can use RHEL image builder.

Prerequisites

  • You must have a Microsoft Azure resource group and storage account.
  • You have Python installed. The AZ CLI tool depends on Python.

Procedure

  1. Import the Microsoft repository key:

    $ sudo rpm --import https://packages.microsoft.com/keys/microsoft-2025.asc
  2. Create a packages-microsoft-com-prod repository:

    [azure-cli]
    name=Azure CLI
    baseurl=https://packages.microsoft.com/yumrepos/packages.microsoft.com/rhel/10/prod/
    enabled=1
    gpgcheck=1
    gpgkey=https://packages.microsoft.com/keys/microsoft.asc
  3. Install Microsoft Azure CLI. The downloaded version of the Microsoft Azure CLI package can vary depending on the currently available version.

    $ sudo dnf install azure-cli
  4. Run Microsoft Azure CLI:

    $ az login

    The terminal shows the following message: Note, we have launched a browser for you to login. For old experience with device code, use az login --use-device-code. Then, the terminal opens the Login from where you can log in.

    注意

    If you are running a remote (SSH) session, the login page link does not open in the browser. In this case, you can copy the link to a browser and log in to authenticate your remote session. To sign in, use a web browser to open the Login page and enter the device code to authenticate.

  5. List the keys for the storage account in Microsoft Azure and make note of the value key1 from the output of the previous command.

    $ az storage account keys list --resource-group <resource_group_name> --account-name <account_name>

    Replace resource-group-name with the name of your Microsoft Azure resource group and storage-account-name with the name of your Microsoft Azure storage account.

    1. To list the available resources using the following command:

      $ az resource list
  6. Create a storage container:

    $ az storage container create --account-name <storage_account_name> \
    --account-key <key1_value> --name <storage_account_name>

    Replace storage-account-name with the name of the storage account.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部