Skip to content

Commit fb17ea5

Browse files
Merge pull request #271498 from JnHs/jh-copilot-pg2
prompt topic
2 parents 23a12da + 48b948f commit fb17ea5

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

articles/copilot/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
href: limited-access.md
1111
- name: Responsible AI FAQ
1212
href: responsible-ai-faq.md
13+
- name: How-to guides
14+
items:
15+
- name: Write effective prompts
16+
href: write-effective-prompts.md
1317
- name: Enhanced scenarios
1418
items:
1519
- name: Get resource information
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Write effective prompts for Microsoft Copilot for Azure (preview)
3+
description: Maximize productivity and intent understanding with prompt engineering in Microsoft Copilot for Azure (preview).
4+
ms.date: 04/16/2024
5+
ms.topic: how-to
6+
ms.service: copilot-for-azure
7+
ms.author: jenhayes
8+
author: JnHs
9+
---
10+
11+
# Write effective prompts for Microsoft Copilot for Azure (preview)
12+
13+
Prompt engineering is the process of designing prompts that elicit the best and most accurate responses from large language models (LLMs) like Microsoft Copilot for Azure (preview). As these models become more sophisticated, understanding how to create effective prompts becomes even more essential.
14+
15+
This article explains how to use prompt engineering to create effective prompts for Microsoft Copilot for Azure (preview).
16+
17+
[!INCLUDE [preview-note](includes/preview-note.md)]
18+
19+
## What is prompt engineering?
20+
21+
Prompt engineering involves strategically crafting inputs for AI models like Copilot for Azure, enhancing their ability to deliver precise, relevant, and valuable outcomes. These models rely on pattern recognition from their training data, lacking real-world understanding or awareness of user goals. By incorporating specific contexts, examples, constraints, and directives into prompts, you can significantly elevate the response quality.
22+
23+
Good prompt engineering practices help you unlock more of Copilot for Azure's potential for code generation, recommendations, documentation retrieval, and navigation. By crafting your prompts thoughtfully, you can reduce the chance of seeing irrelevant suggestions. Prompt engineering is a crucial technique to help improve responses and complete tasks more efficiently. Taking the time to write great prompts ultimately fosters efficient code development, drives down cost, and minimizes errors by providing clear guidelines and expectations.
24+
25+
## Tips for writing better prompts
26+
27+
Microsoft Copilot for Azure can't read your mind. To get meaningful help, guide it: ask for shorter replies if its answers are too long, request complex details if replies are too basic, and specify the format you have in mind. Taking the time to write detailed instructions and refine your prompts helps you get what you're looking for.
28+
29+
The following tips can be useful when considering how to write effective prompts.
30+
31+
### Be clear and specific
32+
33+
Start with a clear intent. For example, if you say "Check performance," Microsoft Copilot for Azure won't know what you're referring to. Instead, be more specific with prompts like "Check the performance of Azure SQL Database in the last 24 hours."
34+
35+
For code generation, specify the language and the desired outcome. For example:
36+
37+
- **Create a YAML file that represents ...**
38+
- **Generate CLI script to ...**
39+
- **Give me a Kusto query to retrieve ...**
40+
- **Help me deploy my workload by generating Terraform that ...**
41+
42+
### Set expectations
43+
44+
The words you use help shape Microsoft Copilot for Azure's responses. Slightly different verbs can return different results, so consider the best ways to phrase your requests. For example:
45+
46+
- For high-level information, use phrases like **How to** or **Create a guide**.
47+
- For actionable responses, use words like **Generate**, **Deploy**, or **Stop**.
48+
- To fetch information and display it in your chat, use terms like **Fetch**, **List**, or **Retrieve**.
49+
- To change your view or navigate to a new page, try phrases like **Show me**, **Take me to**, or **Navigate to**.
50+
51+
You can also mention your expertise level to tailor the advice to your understanding, whether you're a beginner or an expert.
52+
53+
### Add context about your scenario
54+
55+
Detail your goals and why you're undertaking a task to get more precise assistance, or clarify the technologies you're interested in. For example, instead of just saying **Deploy Azure function**, describe your end goal in detail, such as **Deploy Azure function for processing data from IoT devices with a new resource**.
56+
57+
### Break down your requests
58+
59+
For complex issues or tasks, break down your request into smaller, manageable parts. For example: **First, identify virtual machines that are running right now. After you have a working query, stop them.** You can also try using separate prompts for different parts of a larger scenario.
60+
61+
### Customize your code
62+
63+
When asking for on-demand code generation, specify known parameters, resource names, and locations. When you do so, Microsoft Copilot for Azure generates code with those values, so that you don't have to update them yourself. For example, rather than saying **Give me a CLI script to create a storage account**, you can say **Give me a CLI script to create a storage account named Storage1234 in the TestRG resource group in the EastUS region.**
64+
65+
### Use Azure terminology
66+
67+
When possible, use Azure-specific terms for resources, services, and tasks. Copilot may not grasp your intent if it doesn't know which parts of Azure you're referring to. If you aren't sure about which term to use, you can ask Copilot for general information about your scenario, then use the terms it provides in your prompt.
68+
69+
### Use the feedback loop
70+
71+
If you don't get the response you were looking for, try again, using the previous response to help refine your prompts. For example, you can ask Microsoft Copilot for Azure to tell you more about a previous response or to explain more about one aspect. For generated code, you can ask to change one aspect or add another step. Don't be afraid to experiment to see what works best.
72+
73+
To leave feedback on any response that Microsoft Copilot for Azure provides, use the thumbs up/down control. This feedback helps us understand your expectations so that we can improve the Microsoft Copilot for Azure experience over time.
74+
75+
## Next steps
76+
77+
- Learn about [some of the things you can do with Microsoft Copilot for Azure](capabilities.md).
78+
- Review our [Responsible AI FAQ for Microsoft Copilot for Azure](responsible-ai-faq.md).
79+
- [Request access](https://aka.ms/MSCopilotforAzurePreview) to Microsoft Copilot for Azure (preview).

0 commit comments

Comments
 (0)