Breyta

Deila með


Example prompts for deploying your application with GitHub Copilot for Azure

If you're unfamiliar with Azure or you just want the tooling and AI to do most of the work, you can ask GitHub Copilot for Azure and Azure MCP Server to help you deploy your application. Use best practices to achieve the best results. Most importantly:

  • Use "Agent" mode for the best experience. Avoid "Ask" mode.
  • Include the word "Azure" in the prompt to help Copilot understand that it needs to call tools from the Azure MCP Server.
  • If using Visual Studio Code, make sure you use "Configure Tools ..." and include both "Azure MCP" and "GitHub Copilot for Azure". See the Tool calling section's Visual Studio Code tab for more details.

Example prompts for deploying an app

If you want to use GitHub Copilot for Azure for help with deploying your application, you can start with an open-ended question or request like one of these examples:

  • "Help me deploy my application to Azure."
  • "How can I deploy this app to Azure?"
  • "Deploy this project to Azure."
  • "Run this app on Azure."

Then, add more detail for better results. Here are some example prompts:

Service or technology Deploy prompt examples
Azure Kubernetes Service (AKS)
  • "Can you help me create a new deployment in my AKS cluster?"
  • "What is the Azure command to scale a deployment to 5 replicas?"
  • "Can you provide the Azure command to expose a deployment as a service?"
Azure App Service
  • "How many Azure web app plans using the free tier do I have deployed, grouped by region in my <your-subscription-id> subscription?"
  • "How many Azure web apps do I have deployed in eastus?"
Azure Container Apps
  • "How can I deploy my container app to Azure?"
Azure Developer CLI (azd)
  • "Use azd to deploy my Azure project."
  • "I want to use azd to create a deployment pipeline for my Azure application."
  • "Initialize my project with the Azure Developer CLI."
  • "Please start an azd deployment pipeline in Azure."
Azure DevOps
  • "Create a deployment pipeline for my Azure project."
  • "I don't want to deploy my app from my local machine — can you set up a remote Azure solution instead?"
  • "I need a CI/CD pipeline so I can deploy my app to Azure."
  • "I need help setting up a pipeline to deploy my app to Azure."
  • "Please help me create an automated Azure deployment pipeline for my app."
  • "This project is ready for automated deployment — set it up in Azure."
Azure OpenAI Service
  • "Create an Azure OpenAI deployment using the gpt-3.5-turbo model with a Terraform template, setting the model version to 0613."
GitHub Actions
  • "Let's use GitHub Actions to deploy my app to Azure."
  • "Set up a GitHub Actions pipeline to deploy my Azure app."

In many cases, when you ask GitHub Copilot for Azure to choose Azure services and deploy your application to Azure, it will create Bicep templates and give you the option to use azd to begin deployment.

Important

You should always inspect the Bicep templates to ensure you understand what GitHub Copilot for Azure is recommending. Furthermore, the templates are intended to be a starting point. You should plan on editing the templates to suit your needs.

GitHub Copilot for Azure to deploy models to Azure OpenAI Service

In addition to the example prompts for deploying to Azure OpenAI Service, GitHub Copilot for Azure has the following capabilities:

  • Given an existing OpenAI resource, user can deploy a model and optionally input a name for model to deploy.
  • Given the name of an existing resource group, and optionally location, user can deploy a model, and GitHub Copilot for Azure will deploy a new OpenAI resource. User needs to input the name of the new OpenAI resource to create.
  • Given the location, user can deploy a model, and GitHub Copilot for Azure will deploy a new resource group and OpenAI resource. User needs to input the name of the new resource group and OpenAI resource to create.
  • If there is insufficient quota error, the user will be asked to choose a different region.

Example prompts for Azure Kubernetes Service (AKS)

GitHub Copilot for Azure enables users to perform a robust set of tasks related to Azure Kubernetes Service (AKS) directly from the GitHub Copilot Chat view. These skills include creating an AKS cluster, deploying a manifest to an AKS cluster, and generating Kubectl commands.

Create an AKS Cluster

Users can quickly set up an AKS cluster using simple, natural language prompts. GitHub Copilot for Azure reduces the complexity and time required to manually configure and deploy a Kubernetes cluster.

You can create an AKS cluster using the following prompts:

  • "Can you help me create a Kubernetes cluster in Azure?"
  • "Can you set up an AKS cluster for me?"
  • "I have a containerized application—can you help me create an AKS cluster to host it?"
  • "Create an AKS cluster."
  • "Help me create a Kubernetes cluster in Azure to host my application."

Deploy a Manifest to an AKS Cluster

Users can deploy their application manifests to an AKS cluster directly from the GitHub Copilot Chat view. This simplifies the deployment process and ensures consistency. Use these predefined prompts to reduce the risk of errors during deployment, leading to more reliable and stable deployments.

To deploy a manifest file to an AKS cluster, you can use these prompts:

  • "Help me deploy my manifest file to Azure."
  • "Can you deploy my manifest to my AKS cluster?"
  • "Can you deploy my manifest to my Azure Kubernetes cluster?"
  • "Deploy my application manifest to an AKS cluster."
  • "Deploy the manifest for my AKS cluster."

Generate Kubectl Command

Users can generate various Kubectl commands to manage their AKS clusters without needing to remember complex command syntax. Using GitHub Copilot for Azure makes cluster management more accessible and efficient, especially for users who aren't Kubernetes experts.

You can generate various Kubectl commands for your AKS cluster using these prompts:

  • "List all services for my AKS cluster."
  • "Show the kubectl command to get deployments with at least 2 replicas in my AKS cluster."
  • "Get all services in my AKS cluster with external IPs."
  • "What is the kubectl command to get pod info for my AKS cluster?"
  • "Get the kubectl command for listing all API resources in Azure."

Example prompts for undeploying an app

If you deployed your application with azd, you can ask GitHub Copilot for Azure for undeploying assistance. As a Visual Studio Code extension, it has context about where and how you deployed your application to Azure.

Example prompts:

  • "Undeploy my project using the Azure Developer CLI."
  • "Use azd to undeploy my Azure project."
  • "Undeploy this project from Azure."
  • "Stop this app running on Azure."
  • "Remove this code from running on Azure."

Note

Currently, GitHub Copilot for Azure can only undeploy an app if it was originally deployed with AZD.