### Create Azure Virtual Network with CLI Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/reference-docs-subgroup.md This quickstart guide shows how to create a virtual network in Azure using the Azure CLI. It's a fundamental step for setting up your cloud network infrastructure. ```bash az network vnet create --resource-group MyResourceGroup --name MyVnet --address-prefix 10.0.0.0/16 --subnet-name MySubnet --subnet-prefix 10.0.0.0/24 ``` -------------------------------- ### Install Azure CLI with a script Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/cli-install-linux-apt.md Use this command to download and execute the Azure CLI installation script. This is the simplest method for installation. ```bash curl -fsSL 'https://azurecliprod.blob.core.windows.net/$root/deb_install.sh' | sudo bash ``` -------------------------------- ### Example az init output Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/get-started-tutorial-1-prepare-environment.md Review an example of the output from `az init`, which displays current configuration settings and options for optimization. ```output Your current config settings: Output format: JSON [core.output = json] Standard error stream (stderr): All events [core.only_show_errors = false] Error output: Show recommendations [core.error_recommendation = on] Syntax highlighting: On [core.no_color = false] Progress Bar: On [core.disable_progress_bar = false] Select an option by typing its number [1] Optimize for interaction These settings improve the output legibility and optimize for human interaction [2] Optimize for automation These settings optimize for machine efficiency [3] Customize settings A walk-through to customize common configurations [4] Exit (default) Return to the command prompt ? Your selection: ``` -------------------------------- ### App Service Webapp Config Set Help Examples Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/release-notes-azure-cli.md Add additional help examples for PowerShell users for `az webapp config set`. ```bash az webapp config set ``` -------------------------------- ### Install Azure CLI using Homebrew Cask (Preview) Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/install-azure-cli-macos-preview.md This installs Azure CLI using the Homebrew Cask from the Azure CLI custom tap. This is the only supported Homebrew installation method during the preview phase. ```bash brew tap azure/azure-cli brew install --cask azure-cli-preview ``` -------------------------------- ### Troubleshoot Installation on Legacy Systems Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/cli-install-linux-dnf.md Provides a workaround for installing Azure CLI on systems lacking Python 3 by building OpenSSL and Python from source. ```bash curl -sL https://azurecliprod.blob.core.windows.net/rhel7_6_install.sh | sudo bash sudo dnf install gcc gcc-c++ make ncurses patch wget tar zlib zlib-devel -y cd ~ wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz tar -xzf openssl-1.1.1d.tar.gz cd openssl-1.1.1d ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl make sudo make install echo "/usr/local/ssl/lib" | sudo tee /etc/ld.so.conf.d/openssl-1.1.1d.conf ``` -------------------------------- ### Install Azure CLI using Homebrew Cask (General Availability) Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/install-azure-cli-macos-preview.md When the Homebrew Cask installation becomes generally available, Azure CLI will be available from the official Homebrew Cask repository. Existing installations using the Homebrew Core formula must migrate. ```bash brew install --cask azure-cli ``` ```bash brew install azure-cli ``` -------------------------------- ### Install AKS CLI with Kubelogin for Darwin/arm64 Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/release-notes-azure-cli.md Add support for kubelogin darwin/arm64 releases when installing the AKS CLI. ```bash az aks install-cli ``` -------------------------------- ### Verify Azure CLI Installation Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/install-azure-cli-macos-preview.md After installation, confirm Azure CLI is available by checking its version. ```bash az --version ``` -------------------------------- ### Update repository information and install Azure CLI Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/cli-install-linux-apt.md After adding the repository, update apt's package list and install the azure-cli package. ```bash sudo apt-get update sudo apt-get install azure-cli ``` -------------------------------- ### Azure CLI ROPC Login Example Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/authenticate-azure-cli-mfa.md Shows an example of attempting to log into Azure using the Resource Owner Password Credential (ROPC) flow with the Azure CLI. This method is not supported when Multi-Factor Authentication (MFA) is required. ```bash az login --username $username –password $password ``` -------------------------------- ### Start Docker Container with Azure CLI Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/run-azure-cli-docker.md This command starts a Docker container with the Azure CLI preinstalled. It uses the 'azurelinux3.0' tag for a stable and supported version. This is useful for setting up an isolated environment for Azure CLI tasks. ```bash docker run -it mcr.microsoft.com/azure-cli:azurelinux3.0 ``` -------------------------------- ### Get specific VM properties as an array Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/query-azure-cli-concepts.md This example demonstrates how to retrieve specific properties of a virtual machine and display them as an array. ```APIDOC ## GET /api/vm/show ### Description Retrieves specific properties of a virtual machine and returns them as an array. ### Method GET ### Endpoint /api/vm/show ### Parameters #### Query Parameters - **resource-group** (string) - Required - The name of the resource group. - **name** (string) - Required - The name of the virtual machine. - **query** (string) - Required - The JMESPath query to select properties. ### Request Example ```azurecli-interactive az vm show --resource-group QueryDemo --name TestVM --query "[name, osProfile.adminUsername, osProfile.linuxConfiguration.ssh.publicKeys[0].keyData]" ``` ### Response #### Success Response (200) - **[array]** (array) - An array containing the queried VM properties. #### Response Example ```json [ "TestVM", "azureuser", "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMobZNJTqgjWn/IB5xlilvE4Y+BMYpqkDnGRUcA0g9BYPgrGSQquCES37v2e3JmpfDPHFsaR+CPKlVr2GoVJMMHeRcMJhj50ZWq0hAnkJBhlZVWy8S7dwdGAqPyPmWM2iJDCVMVrLITAJCno47O4Ees7RCH6ku7kU86b1NOanvrNwqTHr14wtnLhgZ0gQ5GV1oLWvMEVg1YFMIgPRkTsSQKWCG5lLqQ45aU/4NMJoUxGyJTL9i8YxMavaB1Z2npfTQDQo9+womZ7SXzHaIWC858gWNl9e5UFyHDnTEDc14hKkf1CqnGJVcCJkmSfmrrHk/CkmF0ZT3whTHO1DhJTtV stramer@contoso" ] ``` ``` -------------------------------- ### Get container list with a prefix Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/use-azure-cli-successfully-bash.md Retrieve a list of container names that start with a specific prefix and store the result in a variable. ```bash containerPrefix="learnbash" containerList=$(az storage container list \ --query "[].name" \ --prefix $containerPrefix \ --output tsv) ``` -------------------------------- ### Flatten VM list properties into an array of objects Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/query-azure-cli-concepts.md This example demonstrates how to flatten the results of 'az vm list' to get an array of objects, each containing the VM name, OS type, and administrator username. ```APIDOC ## GET /api/vm/list/flatten ### Description Retrieves a list of virtual machines and flattens their properties into an array of objects, each containing the VM name, OS type, and administrator username. ### Method GET ### Endpoint /api/vm/list/flatten ### Parameters #### Query Parameters - **resource-group** (string) - Required - The name of the resource group. - **query** (string) - Required - The JMESPath query to flatten and select properties. ### Request Example ```azurecli-interactive az vm list --resource-group QueryDemo --query "[].{Name:name, OS:storageProfile.osDisk.osType, admin:osProfile.adminUsername}" ``` ### Response #### Success Response (200) - **[array]** (array) - An array of objects, where each object represents a VM with its Name, OS, and admin properties. #### Response Example ```json [ { "Name": "TestVM", "OS": "Linux", "admin": "azureuser" } ] ``` ``` -------------------------------- ### Create PostgreSQL, MySQL, or MariaDB Single Server Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/release-notes-azure-cli.md Demonstrates creating a single server for PostgreSQL, MySQL, or MariaDB with updated experience, new output fields, and new public parameter values. ```bash az postgres|mariadb|mysql server create --public all|||0.0.0.0 ``` -------------------------------- ### Get Help for Specific Azure CLI Command Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/get-started-with-azure-cli.md This command provides detailed information about a specific Azure CLI command, including its arguments, authentication options, and examples. It's essential for understanding how to use a command effectively. ```azurecli-interactive az vm create --help ``` -------------------------------- ### Manage Azure DDoS Network Protection with CLI Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/reference-docs-subgroup.md This snippet demonstrates how to create and configure Azure DDoS Network Protection using the Azure CLI. It's a quickstart guide for securing your network resources against DDoS attacks. ```bash az network ddos-protection create --name MyDdosProtectionPlan --resource-group MyResourceGroup --location westus2 ``` -------------------------------- ### Create sample files for upload Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/use-azure-cli-successfully-bash.md A for loop is used to create three sample text files with unique identifiers for later upload. ```bash for i in `seq 1 3`; do echo $randomIdentifier > container_size_sample_file_$i.txt done ``` -------------------------------- ### Update apt package list and install prerequisites Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/cli-install-linux-apt.md Before installing the Azure CLI, update your package list and install necessary packages for the installation process. ```bash sudo apt-get update sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release ``` -------------------------------- ### Configure App Service with SQL Database Connection Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/samples-azure-cli-samples-repo.md This script demonstrates how to create an App Service plan, a SQL server and database, and connect them by setting the appropriate application settings in the web app. ```bash az appservice plan create -g MyResourceGroup -n MyPlan --sku S1 az sql server create -g MyResourceGroup -n MySqlServer -l eastus --admin-user admin --admin-password password az sql db create -g MyResourceGroup -s MySqlServer -n MyDatabase --service-objective S0 az webapp create -g MyResourceGroup -p MyPlan -n MyWebApp az webapp config appsettings set -g MyResourceGroup -n MyWebApp --settings DB_CONNECTION="$(az sql db show-connection-string -n MyDatabase -s MySqlServer -o tsv)" ``` -------------------------------- ### Create SQL Database Replica Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/release-notes-azure-cli.md Adds the --partner-database argument for creating a SQL database replica. ```bash az sql db replica create --partner-database ``` -------------------------------- ### Install Latest Azure CLI via PowerShell Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/cli-install-windows-msi-powershell.md Downloads and silently installs the latest Azure CLI MSI installer using PowerShell. This script requires administrative privileges and cleans up the installer file after completion. ```powershell $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi Start-Process msiexec.exe -Wait -ArgumentList '/I', 'AzureCLI.msi', '/quiet' Remove-Item .\AzureCLI.msi ``` -------------------------------- ### Create multiple containers using loops Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/use-azure-cli-successfully-bash.md Demonstrates two different Bash loop syntaxes (`seq` and brace expansion) for creating multiple storage containers. ```bash for i in `seq 1 4`; do az storage container create --account-name $storageAccount --account-key $accountKey --name learnbash-$i done for value in {5..8} for (( i=5; i<10; i++)); do az storage container create --account-name $storageAccount --account-key $accountKey --name learnbash-$i done az storage container list --account-name $storageAccount --account-key $accountKey --query [].name ``` -------------------------------- ### Install Azure CLI Extension by Name Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/azure-cli-extensions-overview.md Installs an Azure CLI extension by its name. This is the standard method for installing extensions listed in the available extensions list. ```azurecli az extension add --name ``` -------------------------------- ### Bash Script Example Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/azure-cli-sp-tutorial-4.md A Bash script demonstrating how to use the `az ad sp list` command to retrieve service principal properties and store them in variables. ```APIDOC ## Bash Script ### Description This script retrieves the application ID, tenant ID, and user consent description for a service principal using `az ad sp list` and stores them in Bash variables. ### Code ```bash spID=$(az ad sp list --display-name myServicePrincipalName --query "[].{spID:appId}" --output tsv) tenantID=$(az ad sp list --display-name myServicePrincipalName --query "[].{tenant:appOwnerOrganizationId}" --output tsv) userConsentDescr=$(az ad sp list --display-name myServicePrincipalName --query "[].{ucs:oauth2PermissionScopes.userConsentDescription[0]}" --output tsv) echo "Using appId $spID in tenant $tenantID for $userConsentDescr" ``` ``` -------------------------------- ### Install Azure CLI Alias Extension Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/azure-cli-extension-alias.md Installs the Azure CLI alias extension. Requires Azure CLI version 2.0.28 or later. Verifies installation by listing extensions. ```azurecli az extension add --name alias ``` ```azurecli az extension list --output table --query '[].{Name:name}' ``` -------------------------------- ### Show Application Gateway SSL Certificate Information Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/release-notes-azure-cli.md Adds an example to demonstrate certificate format and fetch information for an application gateway SSL certificate. ```bash az network application-gateway ssl-cert show ``` -------------------------------- ### Azure SQL Managed Instance CLI Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/samples-reference-group.md Examples for creating and configuring Azure SQL Managed Instance using the Azure CLI. ```APIDOC ## POST /api/sql/managed-instance ### Description Creates an Azure SQL Managed Instance. ### Method POST ### Endpoint /api/sql/managed-instance ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the managed instance. - **resourceGroup** (string) - Required - The name of the resource group. - **location** (string) - Required - The Azure region where the instance will be created. ### Request Example ```json { "name": "myManagedInstance", "resourceGroup": "myResourceGroup", "location": "eastus" } ``` ### Response #### Success Response (201) - **id** (string) - The resource ID of the managed instance. - **name** (string) - The name of the managed instance. - **provisioningState** (string) - The provisioning state of the instance. #### Response Example ```json { "id": "/subscriptions/.../resourceGroups/myResourceGroup/providers/Microsoft.Sql/managedInstances/myManagedInstance", "name": "myManagedInstance", "provisioningState": "Succeeded" } ``` ``` -------------------------------- ### Install and Upgrade Azure CLI Interactive Extension Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/interactive-azure-cli.md This command installs or upgrades the Azure CLI interactive extension to the latest version, enabling new AI-powered features. Ensure you have the Azure CLI installed before running this command. ```azurecli-interactive az extension add --name interactive --upgrade ``` -------------------------------- ### Create Azure Resources at Scale using Azure CLI (Bash) Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/samples-azure-cli-samples-repo.md This script demonstrates creating Azure resources at scale using Azure CLI in Bash. It focuses on setting the active subscription, creating virtual networks, and deploying virtual machines. This is useful for provisioning multiple resources efficiently. Dependencies include Azure CLI. ```bash az account set --subscription "" az network vnet create --name myVnet --resource-group myResourceGroup --location westus2 az vm create --resource-group myResourceGroup --name myVM --image UbuntuLTS --vnet-name myVnet --subnet mySubnet --admin-username azureuser --generate-ssh-keys ``` -------------------------------- ### Azure CLI Version Information Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/release-notes-azure-cli.md Displays the installed Azure CLI version and the versions of its installed components. ```text azure-cli (2.0.6) acr (2.0.4) acs (2.0.6) appservice (0.1.6) batch (2.0.4) cdn (0.0.2) cloud (2.0.2) cognitiveservices (0.1.2) command-modules-nspkg (2.0.0) component (2.0.4) configure (2.0.6) core (2.0.6) cosmosdb (0.1.6) dla (0.0.6) dls (0.0.6) feedback (2.0.2) find (0.2.2) interactive (0.3.1) iot (0.1.5) keyvault (2.0.4) lab (0.0.4) monitor (0.0.4) network (2.0.6) nspkg (3.0.0) profile (2.0.4) rdbms (0.0.1) redis (0.2.3) resource (2.0.6) role (2.0.4) sf (1.0.1) sql (2.0.3) storage (2.0.6) vm (2.0.6) ``` -------------------------------- ### Deploy Linux/Windows Webapps with az webapp up Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/release-notes-azure-cli.md Add ability to deploy Linux and Windows webapps to the same resource group using `az webapp up`. ```bash az webapp up ``` -------------------------------- ### Activate Azure CLI alias after installation Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/cli-install-linux-zypper.md After installing the Azure CLI using the custom script, this command activates the alias for the 'az' command in your current shell session. This ensures that the newly installed Azure CLI is recognized and can be used. ```bash source ~/.bashrc ``` -------------------------------- ### ARM Tag Creation Help Note Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/release-notes-azure-cli.md Add a note for handling existing tags in the help for `az tag create`. ```bash az tag create ``` -------------------------------- ### Create Virtual Network and Subnet Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/azure-cli-vm-tutorial-2.md This snippet demonstrates how to create a virtual network named `TutorialVNet1` with an address prefix of `10.0.0.0/16` and a subnet named `TutorialSubnet1` with an address prefix of `10.0.0.0/24` using the Azure CLI. ```APIDOC ## POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks ### Description Creates a virtual network and a subnet within a specified resource group. ### Method POST ### Endpoint /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks ### Parameters #### Path Parameters - **subscriptionId** (string) - Required - The ID of the subscription. - **resourceGroupName** (string) - Required - The name of the resource group. #### Query Parameters - **api-version** (string) - Required - The API version to use for the request. #### Request Body - **name** (string) - Required - The name of the virtual network. - **location** (string) - Required - The location of the virtual network. - **addressSpace** (object) - Required - Address space for the virtual network. - **addressPrefixes** (array of strings) - Required - List of address prefixes. - **subnets** (array of objects) - Optional - List of subnets to create within the virtual network. - **name** (string) - Required - The name of the subnet. - **addressPrefix** (string) - Required - The address prefix for the subnet. ### Request Example ```json { "name": "TutorialVNet1", "location": "eastus", "addressSpace": { "addressPrefixes": [ "10.0.0.0/16" ] }, "subnets": [ { "name": "TutorialSubnet1", "addressPrefix": "10.0.0.0/24" } ] } ``` ### Response #### Success Response (201 Created) - **id** (string) - The ID of the virtual network. - **name** (string) - The name of the virtual network. - **location** (string) - The location of the virtual network. - **properties** (object) - Properties of the virtual network. - **addressSpace** (object) - Address space of the virtual network. - **addressPrefixes** (array of strings) - Address prefixes. - **subnets** (array of objects) - List of subnets. - **name** (string) - The name of the subnet. - **addressPrefix** (string) - The address prefix of the subnet. #### Response Example ```json { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/VMTutorialResources/providers/Microsoft.Network/virtualNetworks/TutorialVNet1", "name": "TutorialVNet1", "location": "eastus", "properties": { "addressSpace": { "addressPrefixes": [ "10.0.0.0/16" ] }, "subnets": [ { "name": "TutorialSubnet1", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/VMTutorialResources/providers/Microsoft.Network/virtualNetworks/TutorialVNet1/subnets/TutorialSubnet1", "properties": { "addressPrefix": "10.0.0.0/24" } } ] } } ``` ``` -------------------------------- ### List Installed Azure CLI Extensions Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/install-azure-cli.md Use the `az extension list` command to view all installed extensions for the Azure CLI. This command provides more detailed information than `az version` regarding extensions, including their installation path and status. ```bash az extension list ``` -------------------------------- ### Server Creation and Firewall Rules Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/reference-docs-subgroup.md Commands for creating an Azure Database for PostgreSQL - Flexible Server instance and configuring a firewall rule. ```APIDOC ## Create PostgreSQL Flexible Server and Configure Firewall Rule ### Description Creates an Azure Database for PostgreSQL - Flexible Server instance and configures a firewall rule to allow access from a specific IP address or range. ### Method POST ### Endpoint /servers ### Parameters #### Request Body - **name** (string) - Required - The name of the new server. - **location** (string) - Required - The Azure region for the server. - **sku** (object) - Required - The SKU for the server. - **name** (string) - Required - The name of the SKU (e.g., Standard_D2s_v3). - **tier** (string) - Required - The pricing tier (e.g., Standard). - **capacity** (integer) - Optional - The vCores count. - **administratorLogin** (string) - Required - The administrator login name for the server. - **administratorLoginPassword** (string) - Required - The administrator login password. - **version** (string) - Optional - The PostgreSQL version (e.g., 14). - **storage** (object) - Optional - Storage configuration. - **sizeGB** (integer) - Required - The storage size in GB. - **firewallRules** (array) - Optional - A list of firewall rules to configure. - **name** (string) - Required - The name of the firewall rule. - **startIpAddress** (string) - Required - The start IP address of the range. - **endIpAddress** (string) - Required - The end IP address of the range. ### Request Example ```json { "name": "mypgserver", "location": "eastus", "sku": { "name": "Standard_D2s_v3", "tier": "Standard", "capacity": 2 }, "administratorLogin": "pgadmin", "administratorLoginPassword": "", "version": "14", "storage": { "sizeGB": 128 }, "firewallRules": [ { "name": "AllowMyIP", "startIpAddress": "203.0.113.1", "endIpAddress": "203.0.113.1" } ] } ``` ### Response #### Success Response (201) - **id** (string) - The resource ID of the created server. - **name** (string) - The name of the server. - **location** (string) - The Azure region of the server. - **administratorLogin** (string) - The administrator login name. - **version** (string) - The PostgreSQL version. - **storage** (object) - Storage configuration. - **firewallRules** (array) - The configured firewall rules. #### Response Example ```json { "id": "/subscriptions/.../resourceGroups/.../providers/Microsoft.DBforPostgreSQL/flexibleServers/mypgserver", "name": "mypgserver", "location": "eastus", "administratorLogin": "pgadmin", "version": "14", "storage": { "sizeGB": 128 }, "firewallRules": [ { "name": "AllowMyIP", "startIpAddress": "203.0.113.1", "endIpAddress": "203.0.113.1" } ] } ``` ``` -------------------------------- ### Create Azure Media Services Account and Service Principal Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/samples-azure-cli-samples-repo.md This script demonstrates how to create an Azure Media Services account, a service principal for authentication, and a storage account. It's a foundational step for using Azure Media Services. ```bash az ams account create --name --resource-group az ams account sp create --account-name --resource-group --sp-name --sp-password az storage account create --name --resource-group --sku Standard_LRS ``` -------------------------------- ### Install and Link Python Dependency for Azure CLI on macOS Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/install-azure-cli-macos.md Resolves potential version mismatches or installation issues by installing and linking a specific Python version (3.10) using Homebrew. This is a troubleshooting step for when the Azure CLI cannot find its Python dependencies. ```bash brew update && brew install python@3.10 && brew upgrade python@3.10 brew link --overwrite python@3.10 ``` -------------------------------- ### Display command help with --help Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/azure-cli-global-parameters.md Use the --help parameter to retrieve reference information, including available subgroups and parameters, for any Azure CLI command. ```azurecli az group create --name myResourceGroup --location eastus --help ``` -------------------------------- ### Install Azure CLI using Homebrew on macOS Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/install-azure-cli-macos.md Installs the Azure CLI package on macOS using the Homebrew package manager. This command first updates the local Homebrew repository information and then installs the 'azure-cli' package. It requires macOS 13 or higher. ```bash brew update && brew install azure-cli ``` -------------------------------- ### Create Azure Event Grid Topic and Subscription using Bash Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/samples-azure-cli-samples-repo.md This script demonstrates how to create an Azure Event Grid topic and a subscription to it using Azure CLI commands. It covers resource provisioning and configuration for event handling. ```bash az account show az deployment group create az eventgrid event-subscription create az eventgrid topic create az eventgrid topic key list az eventgrid topic show az provider register az provider show ``` -------------------------------- ### Deploy Custom Domain to Azure Front Door using Azure CLI Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/samples-azure-cli-samples-repo.md This script outlines the steps to deploy a custom domain to Azure Front Door. It includes creating DNS records, setting up the Front Door service, configuring frontend endpoints with HTTPS, and uploading content to a storage account. Dependencies include Azure CLI, Azure DNS, and Azure Storage. ```bash az network dns record-set a create --resource-group myResourceGroup --name www --zone-name contoso.com az network dns record-set cname set-record --resource-group myResourceGroup --record-set-name "*" --cname your.frontdoor.com --zone-name contoso.com az network front-door create --name myFrontDoor --resource-group myResourceGroup --sku Premium_AzureFrontDoor az network front-door frontend-endpoint create --resource-group myResourceGroup --front-door-name myFrontDoor --name myFrontendEndpoint --host-name www.contoso.com az network front-door frontend-endpoint enable-https --resource-group myResourceGroup --front-door-name myFrontDoor --name myFrontendEndpoint --min-tls-version 1.2 --certificate-source="Microsoft.Azure.Cdn.Managed.FrontDoor.CertificateSource.AzureKeyVault" az network front-door routing-rule create --resource-group myResourceGroup --front-door-name myFrontDoor --name myRoutingRule --frontend-endpoints myFrontendEndpoint --backend-pool myBackendPool az network front-door routing-rule update --resource-group myResourceGroup --front-door-name myFrontDoor --name myRoutingRule --priority 1 --frontend-endpoints myFrontendEndpoint az storage account create --name mystorageaccount --resource-group myResourceGroup --location westus2 --sku Standard_LRS az storage account show --name mystorageaccount --resource-group myResourceGroup --query primaryEndpoints.blob az storage blob service-properties update --account-name mystorageaccount --static-website --index-document index.html az storage blob upload --account-name mystorageaccount --container-name '$web' --file "./local/path/to/index.html" --name index.html ``` -------------------------------- ### Install Specific Azure CLI Version Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/cli-install-linux-dnf.md Lists available versions of the Azure CLI and installs a specific version using the package manager. ```bash dnf list --showduplicates azure-cli sudo dnf install azure-cli--1.el7 ``` -------------------------------- ### Load Balance Multiple Websites on VMs using Bash Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/samples-azure-cli-samples-repo.md This script demonstrates how to set up an Azure Load Balancer to distribute traffic for multiple websites hosted on different virtual machines. It covers the creation of load balancing components and VM network configurations. ```bash az network lb address-pool create az network lb create az network lb frontend-ip create az network lb probe create az network lb rule create az network nic create az network nic ip-config create az network public-ip create az network vnet create az vm availability-set create az vm create az vm list ``` -------------------------------- ### Install and Manage Azure CLI Packages Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/includes/cli-install-linux-dnf.md Standard commands to install, update, or remove the Azure CLI package using the dnf package manager. ```bash sudo dnf install azure-cli sudo dnf update azure-cli sudo dnf remove azure-cli ``` -------------------------------- ### Retrieve basic VM information Source: https://github.com/microsoftdocs/azure-docs-cli/blob/main/docs-ref-conceptual/Latest-version/azure-cli-vm-tutorial-4.md Fetches the full JSON object containing configuration details for a specific virtual machine using the show command. ```azurecli az vm show --name $vmName --resource-group $resourceGroup ```