title | description | ms.date | ms.topic | ms.service | ms.custom | keywords |
---|---|---|---|---|---|---|
Use Microsoft Copilot in Azure to learn Azure CLI | Microsoft Docs |
How to use the new AI functionalities of Microsoft Copilot in Azure to learn Azure CLI. |
04/22/2025 |
concept-article |
azure-cli |
devx-track-azurecli |
azure cli microsoft copilot, copilot for azure, azure command line |
Microsoft Copilot in Azure is an AI-powered tool to help you do more with Azure. It unifies knowledge and data across hundreds of Azure services to increase productivity, reduce costs, and provide deep insights. Copilot in Azure helps you learn about Azure by answering questions, and it provides information tailored to your own Azure resources and environment. By letting you express your goals in natural language, Copilot simplifies your Azure management experience. This benefits Azure CLI users because the knowledge of Azure CLI is built into Copilot!
Here are some of the benefits of using Copilot in Azure:
- Design: Create and configure the services needed and align with organizational policies.
- Operate: Answer questions, author complex commands, and manage resources.
- Troubleshoot: Orchestrate across Azure services for insights to summarize issues, identify causes, and suggest solutions.
- Optimize: Receive recommendations to improve costs, scalability, and reliability.
By default, Copilot in Azure is available to all users in an organization. Check with your administrator if you have questions about access.
To use Copilot in Azure, go to the Azure portal and select the Copilot icon in the page header. A new pane will open with a chat assistant where you can ask questions.
:::image type="content" source="./media/azure-cli-copilot/copilot-cli-1.png" alt-text="":::
When you tell Copilot in Azure about a task you want to perform with Azure CLI, it provides a script with the necessary commands.
Ask Copilot in Azure to help you with a specific Azure CLI command. For example, you can ask how to create a virtual machine in Azure.
:::image type="content" source="./media/azure-cli-copilot/copilot-cli-2.png" alt-text="":::
You can copy the script and use it. Be sure to replace the variables with actual values or define them in a variable block before running the command.
Suppose you encounter an Azure CLI script that includes references and parameters that are new to you. Use Copilot in Azure to look up the reference command by entering the command as if you were in a terminal:
:::image type="content" source="./media/azure-cli-copilot/copilot-cli-3.png" alt-text="":::
You can use Azure CLI with Copilot in Azure to help with tasks such as creating an Azure SQL database.
:::image type="content" source="./media/azure-cli-copilot/copilot-cli-4.png" alt-text="":::
Follow the steps provided:
-
Create an Azure SQL server:
# Variable block serverName="myServerName" resourceGroup="myResourceGroup" locationName="eastus2" adminUser="myAdminUser" adminPassword="myPassword" az sql server create --name $serverName --resource-group $resourceGroup --location $location --admin-user $adminUser --admin-password $adminPassword
-
Create your Azure SQL database:
# Variable block resourceroup= "myResourceGroup" serverName="myServerName" databaseName="myDatabaseName" serviceObjective="basic" az sql db create --resource-group $resourceGroup --server $serverName --name $databaseName --service-objective $serviceObjective
Microsoft Copilot in Azure values your feedback. At the bottom of the Copilot response, give us a thumbs up if the Copilot response was helpful to you. Give us a thumbs down when we need to make improvements.