azure-developer-github-copilot-azure
azure-developer-github-copilot-azure
Get Started
e OVERVIEW
Overview
Quickstart - Building, Deploying and Improving your application with GitHub Copilot for Azure
Preview
e OVERVIEW
GitHub Copilot for Azure Preview is a GitHub Copilot extension that enables developers
to use natural language to:
GitHub Copilot for Azure is currently available for Visual Studio Code. You must have
access to an Azure subscription and be subscribed to GitHub Copilot.
GitHub Copilot is designed to help developers, including those who are new to Azure, to
be more productive as quickly as possible. For experienced Azure users, GitHub Copilot
for Azure saves time because they can access Azure functionality without needing to
look up commands and arguments, and without needing to sign in and browse through
the Azure portal.
Primary scenarios
GitHub Copilot for Azure Preview currently enables four primary scenarios:
ノ Expand table
Learn Learn about Azure services and "@azure What Azure services should I
tools from the latest Microsoft use with my app?"
Learn documentation. "@azure What are the available types of
Azure OpenAI models?"
"@azure What is Azure AI Search and
why should I use it?"
"@azure How does pricing work for
Azure SQL?"
Design and Ask for guidance and help "@azure Can you help me build a RAG
develop when building apps for the application with Python?"
cloud. "@azure Use azd to undeploy my
project."
Category Explanation Examples
Deploy Create Azure resources and "@azure Can you help me deploy my
deploy apps. application?"
"@azure I need a CI/CD pipeline so I can
get my app deployed."
"@azure Use azd to undeploy my
project."
The documentation provides a quickstart and example prompts to help you start using
GitHub Copilot for Azure as quickly as possible.
How it works
GitHub Copilot for Azure Preview is built on a foundational large language model (LLM)
like GPT-4o. It supplements the LLM's general knowledge with continuously updated
knowledge from Microsoft Learn. Its intelligent agents interact with Azure services,
systems, and Azure Resource Graph to carry out specific tasks on your behalf.
The GitHub Copilot Chat extension delivers the chat experience. You can open the chat
extension as a pane in Visual Studio Code by selecting the Chat icon on the Activity Bar.
In the chat pane, you can create a new chat, access a history of chat sessions, open a
chat session in a full editor window, and more.
Best practices
Using copilots can increase developer productivity by answering questions, executing
tasks, and generating code. However, remember these vital rules:
When you're working with any tool that's based on large language models, use good
prompt engineering techniques for the best results. The following tips come from the
article Write effective prompts for Microsoft Copilot in Azure, which provides advice for
prompt engineering in the context of Azure.
Related content
Get started with GitHub Copilot for Azure by installing the software and writing
your first prompt.
Follow the quickstart to understand how to include GitHub Copilot for Azure
Preview in your software development workflow. The quickstart describes how to
deploy services to Azure, monitor their status, and troubleshoot problems.
See example prompts for learning more about Azure and understanding your
Azure account, subscription, and resources.
See example prompts for designing and developing applications for Azure.
See example prompts for deploying your application to Azure.
See example prompts for optimizing your applications in Azure.
See example prompts for troubleshooting your Azure resources.
Feedback
Was this page helpful? Yes No
Get started with GitHub Copilot for Azure Preview to streamline your development workflow
and enhance your productivity on the Azure platform. This guide walks you through the
prerequisites and installation of the GitHub Copilot for Azure extension in Visual Studio Code,
so you can write your first prompt.
Prerequisites
To complete the steps in this article, make sure that you have:
An Azure account and access to an Azure subscription. For details on how to set them up,
see the pricing page for Azure accounts .
A GitHub account and a GitHub Copilot subscription. For details on how to set them up,
see Creating an account on GitHub and Quickstart for GitHub Copilot , respectively.
Visual Studio Code. For details on how to download and install it, see Setting up Visual
Studio Code .
The GitHub Copilot extension and the GitHub Copilot Chat extension. For instructions on
how to install these extensions, see Set up GitHub Copilot in VS Code and Getting
started with GitHub Copilot Chat in VS Code , respectively.
) Important
GitHub Copilot isn't included in Visual Studio Subscriptions and is a separate subscription
managed by GitHub. For questions regarding GitHub Copilot subscriptions and Support,
see Individual Subscriptions or Business subscriptions .
2. If the Chat window isn't already open, make sure it's open by either selecting the Toggle
Chat button in the menu bar, or select the dropdown next to the Toggle Chat button and
select Open Chat (Ctrl+Alt+I).
3. In the chat text area at the bottom of the chat pane, enter the following prompt:
prompt
By default, GitHub Copilot uses ask mode. Ask mode provides answers to your prompts in the
chat pane. Agent mode enables GitHub Copilot to take action in your workspace.
In ask mode, the @azure part indicates that you want to include the Azure chat participant in
the conversation. It scopes your prompt to a specific domain, namely, your Azure account.
The answer to your question depends on what's currently running in Azure in your
subscription.
Agent mode
Beginning in Visual Studio Code version 1.99, GitHub Copilot introduced agent mode , an
agentic experience that can perform tasks across your entire Visual Studio Code workspace,
making edits, executing terminal commands, and so on.
GitHub Copilot for Azure provides "tools" to GitHub copilot to enhance the agentic experience
through deep integration with Azure.
In agent mode, you don't need to instruct GitHub Copilot to use GitHub Copilot for Azure with
the @azure prefix.
1. In Visual Studio Code, open Settings using the Manage icon (gear).
1. In the chat pane, in the chat prompt, select the mode dropdown and choose Agent.
The completion response displays a list of GitHub Copilot for Azure specific tools
available to GitHub Copilot. The response provides a good overview of the kinds of
functionality now available to you:
I can assist you with various tasks using a range of tools. Here are the main
tools I have available:
4. Project Creation
Create new workspaces
Get project setup information
Install VS Code extensions
Create new Jupyter Notebooks
6. Azure Tools
Azure development best practices
Microsoft Learn documentation
Azure resource management
Azure authentication tools
AI model deployment and management
Azure Bicep schemas
Service configuration and deployment
Azure Developer CLI tools
Would you like me to explain any specific tool in more detail or help you
with a particular task?
4. The last entry, Azure Developer CLI tools , could be employed with the following prompt:
I'll help you generate the Azure CLI command to list all your storage
accounts ordered by location. Let me use the Azure CLI generator tool to get
the correct syntax for this command.
To list all your storage accounts ordered by location in Azure, you can use
the following Azure CLI command:
If you'd prefer a more concise output focusing on specific fields, you could
modify the query. For example, to show only the name and location in a table
format:
Make sure you're logged into the Azure CLI before running this command. If
you're not logged in yet, you can do so with az login.
2. Use the checkbox next to the list of tools to enable / disable tools (or groups of tools).
Best practices for working in agent mode
To get better agentic results, consider the following best practices.
Keep your prompts as granular as possible. Instead of a prompt like Generate a Python
web application and deploy it to Azure , you should break that up into a few prompts
Express your preferences. If GitHub Copilot wants to perform an action but you would
prefer it to take a different action, you can instruct it to do it your preferred way. For
example, if it wants to create a folder to contain bicep files called \.azure , you could
intervene and ask it to use a different folder with a prompt such as:
prompt
@azure /changeTenant
Select from a list of your available tenants in the top center drop-down.
You can also set the default tenant in the extension settings:
1. In Visual Studio Code, on the Activity Bar, select Extensions. Then scroll down to GitHub
Copilot for Azure.
2. Select the gear icon in the corner of the extension's entry, and then select Settings from
the pop-up menu.
3. On the Settings tab, set the Azure Resource Graph tenant to your Microsoft Entra tenant
ID. You can find your Microsoft Entra tenant ID in the Azure portal.
Related content
Understand what GitHub Copilot for Azure Preview is and how it works.
Follow the quickstart to understand how to include GitHub Copilot for Azure in your
software development workflow. The quickstart describes how to deploy services to
Azure, monitor their status, and troubleshoot problems.
See example prompts for learning more about Azure and understanding your Azure
account, subscription, and resources.
See example prompts for designing and developing applications for Azure.
See example prompts for deploying your application to Azure.
See example prompts for optimizing your applications in Azure.
See example prompts for troubleshooting your Azure resources.
Quickstart: Build and deploy your
application with GitHub Copilot for
Azure Preview
Article • 11/18/2024
This quickstart guides you in using GitHub Copilot for Azure Preview to create and
deploy a new website in Azure. It demonstrates one way to integrate GitHub Copilot for
Azure into your development and deployment workflow.
Prerequisites
For complete setup instructions, see the Get started article. Make sure that you have the
following items:
2. In Visual Studio Code, select View > Terminal. On the terminal pane, go to the new
folder.
3. On the Title Bar, select the Open Chat icon (the GitHub Copilot logo) to open the
chat pane in the Secondary side bar.
To start a new chat session, select the plus icon (+) on the pane's title bar.
) Important
4. In the chat text box at the bottom of the pane, type the following prompt after
@azure . Then select Send (paper airplane icon) or select Enter on your keyboard.
prompt
Could you help me create and deploy a simple Flask website by using an
azd template?
After a moment, GitHub Copilot for Azure likely suggests an azd template to use.
) Important
) Important
The exact wording of the response is different each time GitHub Copilot for
Azure answers, due to how large language models generate responses.
5. If the answer provides a command that begins with azd init in a code fence,
hover over the code fence to reveal a small pop-up action menu.
Select Insert into Terminal to insert the command into the terminal.
6. Before you run the azd init command, you might have questions about how it
affects your local computer and your Azure subscription.
prompt
7. Use the following prompt to learn more about the azd template:
prompt
prompt
9. When you're satisfied, run the azd init command in the terminal. Answer its
prompts. If you're unsure what to answer for a prompt, ask GitHub Copilot for
Azure for help.
10. After the new project is initialized, use azd up to deploy the application to your
subscription. In the terminal, run the command according to the instructions in the
original prompt's reply.
azd up
11. The azd up command asks for information about your subscription, where to
deploy the resources, and more.
If you're uncertain how to answer, you can ask GitHub Copilot for Azure for help.
For example, you might ask:
prompt
12. Continue to answer prompts from azd up . Ask GitHub Copilot for Azure questions
as needed.
Depending on the azd template that you're deploying and the location that you
selected, the template might take 20 to 40 minutes (or more) to deploy.
13. If azd up experiences an error, ask GitHub Copilot for Azure about the error and
how you can resolve it.
Tip
For an easy way to attach the last terminal command results, use the paperclip icon
at the bottom left of the chat pane. GitHub Copilot for Azure doesn't know the
terminal command results unless they are copypasted or attached via the paperclip.
14. After a successful deployment, you should be able to go to the new website in a
web browser. Use the Azure portal to view the resources that you created.
Clean up resources
You can ask GitHub Copilot for Azure how to remove all of the resources that you
created in the previous steps:
prompt
Use azd down to remove the website and all resources that you deployed to your Azure
subscription.
Related content
Understand what GitHub Copilot for Azure Preview is and how it works.
Get started with GitHub Copilot for Azure by installing the software and writing
your first prompt.
See example prompts for learning more about Azure and understanding your
Azure account, subscription, and resources.
See example prompts for designing and developing applications for Azure.
See example prompts for deploying your application to Azure.
See example prompts for optimizing your applications in Azure.
See example prompts for troubleshooting your Azure resources.
Feedback
Was this page helpful? Yes No
This quickstart guides you in using GitHub Copilot for Azure Preview to bring your
existing application to Azure. It demonstrates how GitHub Copilot for Azure helps you
create Azure infrastructure with Bicep and deploy your application to Azure.
Prerequisites
For complete setup instructions, see the Get started article. Make sure that you have the
following items:
If you want to follow along with this tutorial, you can clone the following repo from
GitHub to your local computer:
Bash
2. In Visual Studio Code, on the Title Bar, select the Open Chat icon (the GitHub
Copilot logo) to open the chat pane in the Secondary side bar.
To start a new chat session, select the plus icon (+) on the pane's title bar.
) Important
3. In the chat text box at the bottom of the pane, type the following prompt after
@azure . Then select Send (paper airplane icon) or select Enter on your keyboard.
prompt
After a moment, GitHub Copilot for Azure will recommend suitable Azure services,
bindings, and environment variables based on your project. You might see a
response like the following example.
Under "Resource bindings", you can see a table with "Default Key" and "Custom
key". GitHub Copilot for Azure uses "Default Key" as necessary environment
variable by default to make the bindings work. "Custom key" is the developer
customized key in application code.
4. If the recommendations don’t have the support you need, you can provide
information to get new recommendations. For example, you can try the following
prompt:
prompt
@azure Please use Azure App Service instead of Azure Container App for
my project.
After a moment, GitHub Copilot for Azure will provide updated recommendations.
You might see a response like the following example.
5. Once you’re satisfied with the recommendations, select the Generate button and
GitHub Copilot for Azure generates Bicep files and an azure.yaml file in your
workspace.
6. You can use the generated Bicep files to provision the infrastructure on Azure with
your favorite tool like the Azure CLI, or you can run azd up in the terminal to
provision infrastructure and deploy your application.
Related content
Understand what GitHub Copilot for Azure Preview is and how it works.
Get started with GitHub Copilot for Azure by installing the software and writing
your first prompt.
See example prompts for learning more about Azure and understanding your
Azure account, subscription, and resources.
See example prompts for designing and developing applications for Azure.
See example prompts for deploying your application to Azure.
See example prompts for optimizing your applications in Azure.
See example prompts for troubleshooting your Azure resources.
Feedback
Was this page helpful? Yes No
If you're unfamiliar with Azure and how you can use it for your application, you can ask
GitHub Copilot for Azure Preview to help you. Use best practices to achieve the best
results.
When asked to recommend an Azure service, GitHub Copilot for Azure scans the current
application in the workspace and provides recommendations for Azure services and
service bindings.
You can work in an iterative manner asking GitHub Copilot for Azure to update the
recommendations to use a different Azure service or change the bindings information.
Example prompts:
"@azure I'd like to use App Service instead of Azure Container App for my api
project"
"@azure Add a Cosmos DB to my project"
"@azure The SERVICE_URL value should be bing.com"
"@azure Add an environment variable STAGE=dev to my project"
You can follow-up by asking more detailed questions based on GitHub Copilot for
Azure's recommendations. Here are some example detailed questions to help you
understand the types of prompts you can use.
"@azure How can I create a highly available architecture in Azure?"
"@azure Explain the Azure Well-Architected Framework."
"@azure What types of app hosting solutions does Azure have?"
"@azure Help me orchestrate and automate my data processing workflows."
"@azure How can I integrate SignalR with Azure Application Gateway and Azure
API Management?"
"@azure How many units do you recommend?"
"@azure What are the benefits and applications of using Terraform?"
ノ Expand table
Azure AI "@azure What is Azure AI Search and why should I use it?"
Search "@azure How does pricing work for Azure AI Search?"
"@azure How is Azure AI Search integrated with Azure OpenAI?"
"@azure How is Azure AI Search integrated with Azure Machine Learning?"
"@azure When should I use hybrid search or vector search versus semantic ranker
in Azure AI Search?"
Service or Learn prompt examples
technology
"@azure Is Azure AI Search a vector database? How does Azure AI Search ensure
the accuracy and relevance of vector search results?"
"@azure What support do you have for high-scale multitenant applications in
Azure AI Search?"
"@azure What is the integrated vectorization feature in Azure AI Search? From
which data sources can I extract data and use integrated vectorization?"
"@azure What is AI enrichment in Azure AI Search? How does AI enrichment work?
What are the benefits of using AI enrichment?"
"@azure What is the semantic ranker in Azure AI Search? How is it different from
vector search?"
"@azure What are top recommended code samples or solution accelerators for
Azure AI Search?"
"@azure What are some real-world examples of businesses using Azure AI Search?"
Azure API "@azure What are the benefits and applications of Azure API Management?"
Management
Azure Cache "@azure Demonstrate how to configure a Redis cache in Azure for high availability
for Redis and disaster recovery."
Azure "@azure Why would I use Azure Cosmos DB instead of Azure SQL?"
Cosmos DB "@azure I want to use Azure Cosmos DB to store my data."
"@azure Why would I use an Azure Cosmos DB account over a SQL database?"
Azure Data "@azure How do I create data pipelines with Azure Data Factory?"
Factory
Azure "@azure Do you have example deployment models for Azure? SaaS, PaaS, etc."
Developer "@azure What is the best infrastructure for my application?"
CLI ( azd ) "@azure How do I set up my Azure environment?"
"@azure What are Azure Resource Manager templates and how do I use them?"
"@azure How do I manage environments with the Azure Developer CLI?"
Service or Learn prompt examples
technology
Azure Key "@azure Explain how and why I should use Azure key vaults."
Vault
Azure "@azure How do I get the status of all nodes in my AKS cluster?"
Kubernetes "@azure What's the command to set a context for my AKS cluster?"
Service (AKS)
Azure "@azure Generate a PowerShell script to create a new Azure Machine Learning
Machine workspace."
Learning "@azure What is the difference between Azure AI services and Azure Machine
Learning?"
Azure "@azure Create a guide for using Azure Logic Apps to automate responses to
Monitor Azure Monitor alerts."
Azure SQL "@azure Create a Terraform configuration to deploy an Azure SQL database."
"@azure Design a strategy for migrating on-premises SQL Server databases to
Azure SQL Managed Instance."
Related content
Understand what GitHub Copilot for Azure Preview is and how it works.
Get started with GitHub Copilot for Azure by installing the software and writing
your first prompt.
Follow the quickstart to understand how to include GitHub Copilot for Azure
Preview in your software development workflow. The quickstart describes how to
deploy services to Azure, monitor their status, and troubleshoot problems.
See example prompts for designing and developing applications for Azure.
See example prompts for deploying your application to Azure.
See example prompts for optimizing your applications in Azure.
See example prompts for troubleshooting your Azure resources.
Feedback
Was this page helpful? Yes No
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 Preview to help you design and develop
web and API applications to be deployed to your Azure account. Use best practices to
achieve the best results.
"@azure Could you help me create and deploy a simple Flask website by using
Python?"
"@azure Can you help me build a RAG application with Python?"
Examples:
"@azure Generate OpenAPI spec: Accept purchase orders for specialized coffee
bean purchases through an API"
"@azure Generate OpenAPI spec: We are a pizza company and want to create an
online customized pizza delivery solution. Create an API to accept the pizza
orders."
Related content
Understand what GitHub Copilot for Azure Preview is and how it works.
Get started with GitHub Copilot for Azure by installing the software and writing
your first prompt.
Follow the quickstart to understand how to include GitHub Copilot for Azure
Preview in your software development workflow. The quickstart describes how to
deploy services to Azure, monitor their status, and troubleshoot problems.
See example prompts for learning more about Azure and understanding your
Azure account, subscription, and resources.
See example prompts for deploying your application to Azure.
See example prompts for troubleshooting your Azure resources.
Feedback
Was this page helpful? Yes No
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 Preview to help you deploy your application.
Use best practices to achieve the best results.
Then, add more detail for better results. Here are some example prompts:
ノ Expand table
Azure "@azure Can you help me create a new deployment in my AKS cluster?"
Kubernetes "@azure What is the command to scale a deployment to 5 replicas?"
Service (AKS) "@azure Can you provide the command to expose a deployment as a
service?"
Azure App "@azure How many web app plans using the free tier do I have
Service deployed, grouped by region in my <placeholder> subscription?"
"@azure How many web apps do I have deployed in eastus?"
Azure OpenAI "@azure Create an OpenAI deployment with the gpt-3.5-turbo model by
Service using a Terraform template. Set the version of the model to 0613."
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.
You can generate various Kubectl commands for your AKS cluster using these prompts:
Example prompts:
7 Note
Currently, GitHub Copilot for Azure Preview can only undeploy an app if it was
originally deployed with AZD.
Related content
Understand what GitHub Copilot for Azure Preview is and how it works.
Get started with GitHub Copilot for Azure by installing the software and writing
your first prompt.
Follow the quickstart to understand how to include GitHub Copilot for Azure
Preview in your software development workflow. The quickstart describes how to
deploy services to Azure, monitor their status, and troubleshoot problems.
See example prompts for designing and developing applications for Azure.
See example prompts for learning more about Azure and understanding your
Azure account, subscription, and resources.
See example prompts for optimizing your applications in Azure.
See example prompts for troubleshooting your Azure resources.
Feedback
Was this page helpful? Yes No
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 Preview to help you troubleshoot problems
with your application.
Open-ended prompts
"@azure Where can I find metrics and logs?"
"@azure I want to see all the error messages in the logs."
"@azure I'm seeing errors with my app. Look at the logs to find out why."
"@azure Why are my clients being disconnected so often?"
"@azure Why did my last deployment fail?"
"@azure Help me analyze my app for high CPU usage."
"@azure Why is my application slow?"
"@azure Take a memory dump of my app."
ノ Expand table
Azure App Service "@azure How can I improve my Azure web app's performance?"
"@azure How do I improve my app's CPU usage?"
"@azure How can I improve the performance of my Azure web
app?"
"@azure Diagnose high CPU usage in Azure App Service."
"@azure Show me how to detect slow performance issues in my
App Service web app."
"@azure Investigate high CPU usage for App Service."
"@azure What's causing latency in my Azure web app?"
"@azure Can you help me diagnose high CPU usage in Azure
App Service?"
"@azure Why am I seeing high memory usage in App Service?"
"@azure Help me analyze my web app downtime."
"@azure Help me diagnose slow performance in my Azure web
app."
"@azure Help me collect a memory dump from Azure App
Service."
Service or technology Troubleshoot prompt examples
Azure Developer CLI "@azure I'm getting this error. What does it mean?"
( azd )
Azure SDK "@azure The npm Azure Resource Manager SDK is failing to
install. What should I do?"
Azure Event Hubs "@azure My application needs help with processing real-time
events."
Azure SignalR Service "@azure My SignalR client is not receiving messages. Why?"
"@azure Why are my SignalR clients being disconnected so
often?"
"@azure Where can I find metrics and logs for my SignalR app?"
Azure Storage "@azure Can you help me choose the right Azure storage
solution?"
"@azure What are some ways to secure my Azure storage
account?"
"@azure I got an error 403, unauthorized blob listing."
Azure Web PubSub "@azure My Web PubSub client is not receiving messages.
Why?"
Related content
Understand what GitHub Copilot for Azure Preview is and how it works.
Get started with GitHub Copilot for Azure by installing the software and writing
your first prompt.
Follow the quickstart to understand how to include GitHub Copilot for Azure
Preview in your software development workflow. The quickstart describes how to
deploy services to Azure, monitor their status, and troubleshoot problems.
See example prompts for learning more about Azure and understanding your
Azure account, subscription, and resources.
See example prompts for designing and developing applications for Azure.
See example prompts for deploying your application to Azure.
See example prompts for optimizing your applications in Azure.
Feedback
Was this page helpful? Yes No
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 Preview to help you optimize the
performance of your Azure resources. Use best practices to achieve the best results.
ノ Expand table
Azure SQL "@azure How can I optimize my Azure SQL database for better
performance?"
An experimentation copilot plugin for the @azure extension. This chatbot assists
with experimentation, generates feature flag code and metric, helps evaluate and
summarize experiment results, and more.
A GitHub action that can be invoked as part of the AI development workflow in
GitHub to start experiments and refresh and link to experiment results.
The goal of this project is to provide a seamless and efficient way for developers to
conduct experiments and analyze results without leaving their development
environment. It supports the creation and management of experiments and metrics,
leveraging Azure services such as Azure App Config for configuration delivery and Azure
AI for model monitoring metrics.
The preview of this plugin includes a code-first user experience in partnership with
Azure App Config, enabling streamlined evaluation and experimentation in GitHub. This
includes out-of-the-box model monitoring metrics and custom metrics. The public
preview will evolve this into a full streamline integration and easy-to-use user
experience in both App Config and AI Studio.
Azure AI evaluation is already publicly available, but if you are interested in trying out
our online experimentation feature please sign up for our preview to learn more.
Related content
Understand what GitHub Copilot for Azure Preview is and how it works.
Get started with GitHub Copilot for Azure by installing the software and writing
your first prompt.
Follow the quickstart to understand how to include GitHub Copilot for Azure
Preview in your software development workflow. The quickstart describes how to
deploy services to Azure, monitor their status, and troubleshoot problems.
See example prompts for learning more about Azure and understanding your
Azure account, subscription, and resources.
See example prompts for designing and developing applications for Azure.
See example prompts for deploying your application to Azure.
See example prompts for troubleshooting your Azure resources.
Feedback
Was this page helpful? Yes No
There are many ways to create new resources on Azure. Bicep files provide a declarative,
modular, and reusable approach to defining Azure resources. Bicep templates offer
improved readability, maintainability, and native integration with Azure Resource
Manager (ARM) compared to JSON-based ARM templates or imperative scripting
methods like PowerShell and Azure CLI. GitHub Copilot for Azure can help you create
Bicep files.
Example scenario
Suppose you want an easy way to create a repeatable, automated process for creating a
Blob container and file share. You might be familiar with how to create a Blob container
and file share using the Azure portal, but unsure how to use Bicep files to accomplish
the same task.
Example prompt
Create a New Chat (Ctrl + L), then copy and paste the following prompt into GitHub
Copilot's chat pane.
@azure Show me a Bicep file that creates an Azure Storage account with a
blob container and a file share.
Example response
7 Note
The following response is an example. GitHub Copilot for Azure responses are
nondeterministic, so you might get a different response from the one shown here.
GitHub Copilot for Azure generates a Bicep file similar to the following.
resource sa 'Microsoft.Storage/storageAccounts@2023-01-01' = {
name: storageAccountName
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
properties: {
accessTier: 'Hot'
}
}
resource blobContainer
'Microsoft.Storage/storageAccounts/blobServices/containers@2023-01-01' = {
parent: blobServices
name: blobContainerName
properties: {
publicAccess: 'None'
}
}
Create a new main.bicep file, then copy the response from GitHub Copilot for Azure and
paste into the new file.
When using the Azure CLI to execute the Bicep file, you can set the params declared as
storageAccountName , blobContainerName , and fileShareName .
Alternatively, you can edit the Bicep file initializing the storageAccountName param to
your desired value.
For example, you might ask where this Bicep file should be created in your VS Code
workspace.
@azure Where in my workspace should I create the Bicep file and what should
I call it?
It might respond by suggesting a folder and file name for your new Bicep file. For
example, infra/storageAccount.bicep .
Finally, if you're unsure about how to deploy the Bicep file, you can create a prompt that
asks for instructions.
To execute the Bicep file, you can use the Azure CLI with the following
steps:
1. **Install Azure CLI and Bicep CLI**: Ensure you have the Azure CLI and
Bicep CLI installed. You can install Bicep using the Azure CLI with the
command:
az bicep install
2. **Log in to Azure**: Use the Azure CLI to log in to your Azure account:
az login
3. **Deploy the Bicep file**: Use the `az deployment group create` command
to deploy the Bicep file to a resource group. Replace `<resource-group-
name>` with your resource group name and `<location>` with your desired
Azure region:
This command will deploy the resources defined in your Bicep file to the
specified resource group in Azure.
While following these instructions, if you get stuck or encounter a problem, continue
asking GitHub Copilot questions creating prompts with the prefix @azure in the chat
pane.
Related content
Bicep overview
What is GitHub Copilot for Azure Preview?
Get started with GitHub Copilot for Azure Preview
Feedback
Was this page helpful? Yes No