209 | ```
210 |
211 | Both tests running should be like these ones:
212 |
213 | 
214 |
215 |
216 | 🚀 Congratulations, through the exercise, you haven't only used GitHub Copilot to generate code but also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.
217 |
218 |
219 | ## Legal Notices
220 |
221 | Microsoft and any contributors grant you a license to the Microsoft documentation and other content
222 | in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode),
223 | see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the
224 | [LICENSE-CODE](LICENSE-CODE) file.
225 |
226 | Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation
227 | may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries.
228 | The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks.
229 | Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.
230 |
231 | Privacy information can be found at https://privacy.microsoft.com/en-us/
232 |
233 | Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents,
234 | or trademarks, whether by implication, estoppel or otherwise.
235 |
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2 | // README at: https://github.com/devcontainers/templates/tree/main/src/python
3 | {
4 | "name": "Python 3",
5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6 | "image": "mcr.microsoft.com/devcontainers/python:0-3.11",
7 |
8 | // Features to add to the dev container. More info: https://containers.dev/features.
9 | // "features": {},
10 |
11 | // Configure tool-specific properties.
12 | "customizations": {
13 | // Configure properties specific to VS Code.
14 | "vscode": {
15 | "settings": {},
16 | "extensions": [
17 | "streetsidesoftware.code-spell-checker",
18 | "ms-python.python",
19 | "ms-python.vscode-pylance"
20 | ]
21 | }
22 | },
23 |
24 | // Use 'forwardPorts' to make a list of ports inside the container available locally.
25 | // "forwardPorts": [9000],
26 |
27 | // Use 'portsAttributes' to set default properties for specific forwarded ports.
28 | // More info: https://containers.dev/implementors/json_reference/#port-attributes
29 | "portsAttributes": {
30 | "9000": {
31 | "label": "Hello Remote World",
32 | "onAutoForward": "notify"
33 | }
34 | }
35 |
36 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
37 | // "remoteUser": "root"
38 | }
39 |
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/LICENSE.md:
--------------------------------------------------------------------------------
1 | Attribution 4.0 International
2 |
3 | =======================================================================
4 |
5 | Creative Commons Corporation ("Creative Commons") is not a law firm and
6 | does not provide legal services or legal advice. Distribution of
7 | Creative Commons public licenses does not create a lawyer-client or
8 | other relationship. Creative Commons makes its licenses and related
9 | information available on an "as-is" basis. Creative Commons gives no
10 | warranties regarding its licenses, any material licensed under their
11 | terms and conditions, or any related information. Creative Commons
12 | disclaims all liability for damages resulting from their use to the
13 | fullest extent possible.
14 |
15 | Using Creative Commons Public Licenses
16 |
17 | Creative Commons public licenses provide a standard set of terms and
18 | conditions that creators and other rights holders may use to share
19 | original works of authorship and other material subject to copyright
20 | and certain other rights specified in the public license below. The
21 | following considerations are for informational purposes only, are not
22 | exhaustive, and do not form part of our licenses.
23 |
24 | Considerations for licensors: Our public licenses are
25 | intended for use by those authorized to give the public
26 | permission to use material in ways otherwise restricted by
27 | copyright and certain other rights. Our licenses are
28 | irrevocable. Licensors should read and understand the terms
29 | and conditions of the license they choose before applying it.
30 | Licensors should also secure all rights necessary before
31 | applying our licenses so that the public can reuse the
32 | material as expected. Licensors should clearly mark any
33 | material not subject to the license. This includes other CC-
34 | licensed material, or material used under an exception or
35 | limitation to copyright. More considerations for licensors:
36 | wiki.creativecommons.org/Considerations_for_licensors
37 |
38 | Considerations for the public: By using one of our public
39 | licenses, a licensor grants the public permission to use the
40 | licensed material under specified terms and conditions. If
41 | the licensor's permission is not necessary for any reason--for
42 | example, because of any applicable exception or limitation to
43 | copyright--then that use is not regulated by the license. Our
44 | licenses grant only permissions under copyright and certain
45 | other rights that a licensor has authority to grant. Use of
46 | the licensed material may still be restricted for other
47 | reasons, including because others have copyright or other
48 | rights in the material. A licensor may make special requests,
49 | such as asking that all changes be marked or described.
50 | Although not required by our licenses, you are encouraged to
51 | respect those requests where reasonable. More_considerations
52 | for the public:
53 | wiki.creativecommons.org/Considerations_for_licensees
54 |
55 | =======================================================================
56 |
57 | Creative Commons Attribution 4.0 International Public License
58 |
59 | By exercising the Licensed Rights (defined below), You accept and agree
60 | to be bound by the terms and conditions of this Creative Commons
61 | Attribution 4.0 International Public License ("Public License"). To the
62 | extent this Public License may be interpreted as a contract, You are
63 | granted the Licensed Rights in consideration of Your acceptance of
64 | these terms and conditions, and the Licensor grants You such rights in
65 | consideration of benefits the Licensor receives from making the
66 | Licensed Material available under these terms and conditions.
67 |
68 |
69 | Section 1 -- Definitions.
70 |
71 | a. Adapted Material means material subject to Copyright and Similar
72 | Rights that is derived from or based upon the Licensed Material
73 | and in which the Licensed Material is translated, altered,
74 | arranged, transformed, or otherwise modified in a manner requiring
75 | permission under the Copyright and Similar Rights held by the
76 | Licensor. For purposes of this Public License, where the Licensed
77 | Material is a musical work, performance, or sound recording,
78 | Adapted Material is always produced where the Licensed Material is
79 | synched in timed relation with a moving image.
80 |
81 | b. Adapter's License means the license You apply to Your Copyright
82 | and Similar Rights in Your contributions to Adapted Material in
83 | accordance with the terms and conditions of this Public License.
84 |
85 | c. Copyright and Similar Rights means copyright and/or similar rights
86 | closely related to copyright including, without limitation,
87 | performance, broadcast, sound recording, and Sui Generis Database
88 | Rights, without regard to how the rights are labeled or
89 | categorized. For purposes of this Public License, the rights
90 | specified in Section 2(b)(1)-(2) are not Copyright and Similar
91 | Rights.
92 |
93 | d. Effective Technological Measures means those measures that, in the
94 | absence of proper authority, may not be circumvented under laws
95 | fulfilling obligations under Article 11 of the WIPO Copyright
96 | Treaty adopted on December 20, 1996, and/or similar international
97 | agreements.
98 |
99 | e. Exceptions and Limitations means fair use, fair dealing, and/or
100 | any other exception or limitation to Copyright and Similar Rights
101 | that applies to Your use of the Licensed Material.
102 |
103 | f. Licensed Material means the artistic or literary work, database,
104 | or other material to which the Licensor applied this Public
105 | License.
106 |
107 | g. Licensed Rights means the rights granted to You subject to the
108 | terms and conditions of this Public License, which are limited to
109 | all Copyright and Similar Rights that apply to Your use of the
110 | Licensed Material and that the Licensor has authority to license.
111 |
112 | h. Licensor means the individual(s) or entity(ies) granting rights
113 | under this Public License.
114 |
115 | i. Share means to provide material to the public by any means or
116 | process that requires permission under the Licensed Rights, such
117 | as reproduction, public display, public performance, distribution,
118 | dissemination, communication, or importation, and to make material
119 | available to the public including in ways that members of the
120 | public may access the material from a place and at a time
121 | individually chosen by them.
122 |
123 | j. Sui Generis Database Rights means rights other than copyright
124 | resulting from Directive 96/9/EC of the European Parliament and of
125 | the Council of 11 March 1996 on the legal protection of databases,
126 | as amended and/or succeeded, as well as other essentially
127 | equivalent rights anywhere in the world.
128 |
129 | k. You means the individual or entity exercising the Licensed Rights
130 | under this Public License. Your has a corresponding meaning.
131 |
132 |
133 | Section 2 -- Scope.
134 |
135 | a. License grant.
136 |
137 | 1. Subject to the terms and conditions of this Public License,
138 | the Licensor hereby grants You a worldwide, royalty-free,
139 | non-sublicensable, non-exclusive, irrevocable license to
140 | exercise the Licensed Rights in the Licensed Material to:
141 |
142 | a. reproduce and Share the Licensed Material, in whole or
143 | in part; and
144 |
145 | b. produce, reproduce, and Share Adapted Material.
146 |
147 | 2. Exceptions and Limitations. For the avoidance of doubt, where
148 | Exceptions and Limitations apply to Your use, this Public
149 | License does not apply, and You do not need to comply with
150 | its terms and conditions.
151 |
152 | 3. Term. The term of this Public License is specified in Section
153 | 6(a).
154 |
155 | 4. Media and formats; technical modifications allowed. The
156 | Licensor authorizes You to exercise the Licensed Rights in
157 | all media and formats whether now known or hereafter created,
158 | and to make technical modifications necessary to do so. The
159 | Licensor waives and/or agrees not to assert any right or
160 | authority to forbid You from making technical modifications
161 | necessary to exercise the Licensed Rights, including
162 | technical modifications necessary to circumvent Effective
163 | Technological Measures. For purposes of this Public License,
164 | simply making modifications authorized by this Section 2(a)
165 | (4) never produces Adapted Material.
166 |
167 | 5. Downstream recipients.
168 |
169 | a. Offer from the Licensor -- Licensed Material. Every
170 | recipient of the Licensed Material automatically
171 | receives an offer from the Licensor to exercise the
172 | Licensed Rights under the terms and conditions of this
173 | Public License.
174 |
175 | b. No downstream restrictions. You may not offer or impose
176 | any additional or different terms or conditions on, or
177 | apply any Effective Technological Measures to, the
178 | Licensed Material if doing so restricts exercise of the
179 | Licensed Rights by any recipient of the Licensed
180 | Material.
181 |
182 | 6. No endorsement. Nothing in this Public License constitutes or
183 | may be construed as permission to assert or imply that You
184 | are, or that Your use of the Licensed Material is, connected
185 | with, or sponsored, endorsed, or granted official status by,
186 | the Licensor or others designated to receive attribution as
187 | provided in Section 3(a)(1)(A)(i).
188 |
189 | b. Other rights.
190 |
191 | 1. Moral rights, such as the right of integrity, are not
192 | licensed under this Public License, nor are publicity,
193 | privacy, and/or other similar personality rights; however, to
194 | the extent possible, the Licensor waives and/or agrees not to
195 | assert any such rights held by the Licensor to the limited
196 | extent necessary to allow You to exercise the Licensed
197 | Rights, but not otherwise.
198 |
199 | 2. Patent and trademark rights are not licensed under this
200 | Public License.
201 |
202 | 3. To the extent possible, the Licensor waives any right to
203 | collect royalties from You for the exercise of the Licensed
204 | Rights, whether directly or through a collecting society
205 | under any voluntary or waivable statutory or compulsory
206 | licensing scheme. In all other cases the Licensor expressly
207 | reserves any right to collect such royalties.
208 |
209 |
210 | Section 3 -- License Conditions.
211 |
212 | Your exercise of the Licensed Rights is expressly made subject to the
213 | following conditions.
214 |
215 | a. Attribution.
216 |
217 | 1. If You Share the Licensed Material (including in modified
218 | form), You must:
219 |
220 | a. retain the following if it is supplied by the Licensor
221 | with the Licensed Material:
222 |
223 | i. identification of the creator(s) of the Licensed
224 | Material and any others designated to receive
225 | attribution, in any reasonable manner requested by
226 | the Licensor (including by pseudonym if
227 | designated);
228 |
229 | ii. a copyright notice;
230 |
231 | iii. a notice that refers to this Public License;
232 |
233 | iv. a notice that refers to the disclaimer of
234 | warranties;
235 |
236 | v. a URI or hyperlink to the Licensed Material to the
237 | extent reasonably practicable;
238 |
239 | b. indicate if You modified the Licensed Material and
240 | retain an indication of any previous modifications; and
241 |
242 | c. indicate the Licensed Material is licensed under this
243 | Public License, and include the text of, or the URI or
244 | hyperlink to, this Public License.
245 |
246 | 2. You may satisfy the conditions in Section 3(a)(1) in any
247 | reasonable manner based on the medium, means, and context in
248 | which You Share the Licensed Material. For example, it may be
249 | reasonable to satisfy the conditions by providing a URI or
250 | hyperlink to a resource that includes the required
251 | information.
252 |
253 | 3. If requested by the Licensor, You must remove any of the
254 | information required by Section 3(a)(1)(A) to the extent
255 | reasonably practicable.
256 |
257 | 4. If You Share Adapted Material You produce, the Adapter's
258 | License You apply must not prevent recipients of the Adapted
259 | Material from complying with this Public License.
260 |
261 |
262 | Section 4 -- Sui Generis Database Rights.
263 |
264 | Where the Licensed Rights include Sui Generis Database Rights that
265 | apply to Your use of the Licensed Material:
266 |
267 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right
268 | to extract, reuse, reproduce, and Share all or a substantial
269 | portion of the contents of the database;
270 |
271 | b. if You include all or a substantial portion of the database
272 | contents in a database in which You have Sui Generis Database
273 | Rights, then the database in which You have Sui Generis Database
274 | Rights (but not its individual contents) is Adapted Material; and
275 |
276 | c. You must comply with the conditions in Section 3(a) if You Share
277 | all or a substantial portion of the contents of the database.
278 |
279 | For the avoidance of doubt, this Section 4 supplements and does not
280 | replace Your obligations under this Public License where the Licensed
281 | Rights include other Copyright and Similar Rights.
282 |
283 |
284 | Section 5 -- Disclaimer of Warranties and Limitation of Liability.
285 |
286 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
287 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
288 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
289 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
290 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
291 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
292 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
293 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
294 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
295 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
296 |
297 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
298 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
299 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
300 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
301 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
302 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
303 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
304 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
305 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
306 |
307 | c. The disclaimer of warranties and limitation of liability provided
308 | above shall be interpreted in a manner that, to the extent
309 | possible, most closely approximates an absolute disclaimer and
310 | waiver of all liability.
311 |
312 |
313 | Section 6 -- Term and Termination.
314 |
315 | a. This Public License applies for the term of the Copyright and
316 | Similar Rights licensed here. However, if You fail to comply with
317 | this Public License, then Your rights under this Public License
318 | terminate automatically.
319 |
320 | b. Where Your right to use the Licensed Material has terminated under
321 | Section 6(a), it reinstates:
322 |
323 | 1. automatically as of the date the violation is cured, provided
324 | it is cured within 30 days of Your discovery of the
325 | violation; or
326 |
327 | 2. upon express reinstatement by the Licensor.
328 |
329 | For the avoidance of doubt, this Section 6(b) does not affect any
330 | right the Licensor may have to seek remedies for Your violations
331 | of this Public License.
332 |
333 | c. For the avoidance of doubt, the Licensor may also offer the
334 | Licensed Material under separate terms or conditions or stop
335 | distributing the Licensed Material at any time; however, doing so
336 | will not terminate this Public License.
337 |
338 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
339 | License.
340 |
341 |
342 | Section 7 -- Other Terms and Conditions.
343 |
344 | a. The Licensor shall not be bound by any additional or different
345 | terms or conditions communicated by You unless expressly agreed.
346 |
347 | b. Any arrangements, understandings, or agreements regarding the
348 | Licensed Material not stated herein are separate from and
349 | independent of the terms and conditions of this Public License.
350 |
351 |
352 | Section 8 -- Interpretation.
353 |
354 | a. For the avoidance of doubt, this Public License does not, and
355 | shall not be interpreted to, reduce, limit, restrict, or impose
356 | conditions on any use of the Licensed Material that could lawfully
357 | be made without permission under this Public License.
358 |
359 | b. To the extent possible, if any provision of this Public License is
360 | deemed unenforceable, it shall be automatically reformed to the
361 | minimum extent necessary to make it enforceable. If the provision
362 | cannot be reformed, it shall be severed from this Public License
363 | without affecting the enforceability of the remaining terms and
364 | conditions.
365 |
366 | c. No term or condition of this Public License will be waived and no
367 | failure to comply consented to unless expressly agreed to by the
368 | Licensor.
369 |
370 | d. Nothing in this Public License constitutes or may be interpreted
371 | as a limitation upon, or waiver of, any privileges and immunities
372 | that apply to the Licensor or You, including from the legal
373 | processes of any jurisdiction or authority.
374 |
375 |
376 | =======================================================================
377 |
378 | Creative Commons is not a party to its public
379 | licenses. Notwithstanding, Creative Commons may elect to apply one of
380 | its public licenses to material it publishes and in those instances
381 | will be considered the “Licensor.” The text of the Creative Commons
382 | public licenses is dedicated to the public domain under the CC0 Public
383 | Domain Dedication. Except for the limited purpose of indicating that
384 | material is shared under a Creative Commons public license or as
385 | otherwise permitted by the Creative Commons policies published at
386 | creativecommons.org/policies, Creative Commons does not authorize the
387 | use of the trademark "Creative Commons" or any other trademark or logo
388 | of Creative Commons without its prior written consent including,
389 | without limitation, in connection with any unauthorized modifications
390 | to any of its public licenses or any other arrangements,
391 | understandings, or agreements concerning use of licensed material. For
392 | the avoidance of doubt, this paragraph does not form part of the
393 | public licenses.
394 |
395 | Creative Commons may be contacted at creativecommons.org.
396 |
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Creating a Mini Game with GitHub Copilot
4 |
5 | In this module, we’ll explore how to use GitHub Copilot to build a classic rock, paper, scissors minigame. This hands-on project is designed to sharpen your programming skills and enhance your ability to develop console applications in Python. Best of all, we’ll use GitHub Codespaces, so there’s no need to worry about setting up a development environment. With GitHub Copilot as your AI pair programmer, you can focus on creating your application while effortlessly collaborating with your intelligent coding assistant. Lets begin.
6 |
7 |
8 |
9 |
10 | - **Who this is for**: Developers, DevOps Engineers, Software development managers, Testers.
11 | - **What you'll learn**: Harnessing GitHub Copilot to create code and add comments to your work.
12 | - **What you'll build**: Python files that will have code generated by Copilot AI for code and comment suggestions.
13 | - **Prerequisites**: GitHub Copilot is available to use for free, sign up for [GitHub Copilot](https://gh.io/copilot).
14 | - **Timing**: This course can be completed in under an hour.
15 |
16 | By the end of this module, you'll acquire the skills to be able to:
17 |
18 | - Experience GitHub Codespaces as a development environment.
19 | - Develop input and output routines in a Python console application.
20 | - Use GitHub Copilot as an assistant.
21 |
22 | ## Prerequisite reading:
23 | - [Introduction to prompt engineering with GitHub Copilot](https://learn.microsoft.com/training/modules/introduction-prompt-engineering-with-github-copilot//?WT.mc_id=academic-113596-abartolo)
24 | - [Challenge project - Build a minigame with GitHub Copilot and Python](https://learn.microsoft.com/training/modules/challenge-project-create-mini-game-with-copilot/?WT.mc_id=academic-113596-abartolo)
25 | - Learn Live: Build a minigame console app with GitHub Copilot (Video below)
26 | - [](https://youtu.be/Fi_jl3G7i8Y?si=v56VPYfTHYBBEX11)
27 | (Click the image above to view video of this lesson)
28 |
29 |
30 | ## Requirements
31 |
32 | - Enable your [GitHub Copilot service](https://github.com/github-copilot/signup)
33 |
34 | ## 💪🏽 Exercise
35 |
36 | **Right click the "Open in GitHub Codespaces" button to open your Codespace in a new tab**
37 |
38 | [](https://codespaces.new/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming)
39 |
40 | You have already learned a bit about GitHub Codespaces and GitHub Copilot and how they work. In this challenge exercise, your goal is to develop a minigame in Python using GitHub Copilot.
41 |
42 | #### Testing your GitHub Codespace
43 |
44 | 1. Access your Codespaces and create a new file called *app.py* in Visual Studio Code.
45 |
46 | **Note:** You may need to install the Python Extension in Visual Studio Code if it isn't currently installed.
47 |
48 | 2. Type the following comment:
49 |
50 | ```python
51 | # write 'hello world' to the console
52 | ```
53 |
54 | 3. GitHub Copilot should complete the code for you and provide the following result:
55 |
56 | ```python
57 | # write 'hello world' to the console
58 | print('hello world')
59 | ```
60 |
61 | 4. Run the application with the *python app.py* command in the terminal and check if the result is similar to the following console message:
62 |
63 | ```bash
64 | hello world
65 | ```
66 |
67 | ### Creating the game logic
68 |
69 | Now that you've verified that Codespaces working with GitHub Copilot, your next step is to develop the logic of the Python minigame with the help of GitHub Copilot based on the following specifications:
70 |
71 | The winner of the game is determined by three simple rules:
72 |
73 | - **Rock** beats scissors.
74 | - **Scissors** beat paper.
75 | - **Paper** beats rock.
76 |
77 | #### Game interaction considerations
78 |
79 | The computer will be your opponent and can randomly choose one of the elements (**rock**, **paper**, or **scissors**). Your game interaction will be through the console (Terminal).
80 |
81 | - The player can choose one of the three options rock, paper, or scissors and should be warned if they enter an invalid option.
82 | - At each round, the player must enter one of the options in the list and be informed if they won, lost, or tied with the opponent.
83 | - By the end of each round, the player can choose whether to play again.
84 | - Display the player's score at the end of the game.
85 | - The minigame must handle user inputs, putting them in lowercase and informing the user if the option is invalid.
86 |
87 | In your GitHub Codespaces, follow the given instructions to set up prompts that GitHub Copilot can understand and use to help you build the minigame. Keep in mind that GitHub Copilot relies on comments to grasp the context and give you helpful suggestions while you're working on your project.
88 |
89 | #### Verify your work
90 |
91 | 1. Run the minigame on the console with the *python app.py* command.
92 | 2. At the prompt, type one of the game options: *rock*, *paper*, or *scissors*.
93 | 3. The minigame should inform the player whether the player won, lost, or tied with the opponent.
94 | 4. Choose to continue playing.
95 | 5. At the prompt, type *screen*.
96 | 6. The minigame should inform the player if the option entered by the player is invalid.
97 | 7. Repeat steps 2 and 4 to play a few rounds and choose not to continue playing.
98 | 8. Check if the minigame is terminated and if it displays your score, informing you of the number of wins and rounds.
99 |
100 | Congratulations on completing this challenge exercise! You've created a Python console minigame using GitHub Copilot.
101 |
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
40 |
41 |
42 |
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/app.py:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/images/06-Creating-Mini-Game-with-GitHub-Copilot-001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyz/Mastering-GitHub-Copilot-for-Paired-Programming/2cb8564b5bfa03c2a657b5f5bea59f7b71008500/07-Creating-Mini-Game-with-GitHub-Copilot/images/06-Creating-Mini-Game-with-GitHub-Copilot-001.png
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/images/06-Creating-Mini-Game-with-GitHub-Copilot-002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyz/Mastering-GitHub-Copilot-for-Paired-Programming/2cb8564b5bfa03c2a657b5f5bea59f7b71008500/07-Creating-Mini-Game-with-GitHub-Copilot/images/06-Creating-Mini-Game-with-GitHub-Copilot-002.png
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/images/06-Creating-Mini-Game-with-GitHub-Copilot-003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cyz/Mastering-GitHub-Copilot-for-Paired-Programming/2cb8564b5bfa03c2a657b5f5bea59f7b71008500/07-Creating-Mini-Game-with-GitHub-Copilot/images/06-Creating-Mini-Game-with-GitHub-Copilot-003.png
--------------------------------------------------------------------------------
/07-Creating-Mini-Game-with-GitHub-Copilot/images/requirements.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/08-Using-Advanced-GitHub-Copilot-Features/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Using Advanced GitHub Copilot Features
4 |
5 | GitHub Copilot offers much more than just code suggestions. As a Software Engineer, you often need to understand existing code and improve it with documentation, tests, and automation.
6 |
7 | In this module, you’ll explore the advanced features of GitHub Copilot, enabling you to interactively work with your code while applying suggestions and insights more effectively.
8 |
9 | Using a Python-based HTTP API, you’ll make modifications, fix bugs, create documentation, and write tests for a new endpoint that you’ll implement.
10 |
11 |
12 |
13 | - **Who this is for**: Developers, DevOps Engineers, Software development managers, Testers.
14 | - **What you'll learn**: Using Advanced GitHub Copilot features to test, document, and work with code.
15 | - **What you'll build**: A new HTTP API route, along with documentation and tests to verify its correctness.
16 | - **Prerequisites**: GitHub Copilot is available to use for free, sign up for [GitHub Copilot](https://gh.io/copilot).
17 | - **Timing**: This module can be completed in under an hour.
18 |
19 | By the end of this module, you'll acquire the skills to be able to:
20 |
21 | - Use advanced GitHub Copilot features like inline chat, slash commands, and agents.
22 | - Interact with GitHub Copilot with deeper context on your project and ask questions about it.
23 |
24 | ## Prerequisite reading:
25 | - [Introduction to prompt engineering with GitHub Copilot](https://learn.microsoft.com/training/modules/introduction-prompt-engineering-with-github-copilot//?WT.mc_id=academic-113596-abartolo)
26 | - [Using advanced GitHub Copilot features](https://learn.microsoft.com/training/modules/advanced-github-copilot/?WT.mc_id=academic-113596-abartolo)
27 |
28 | ## Requirements
29 |
30 | 1. Enable your [GitHub Copilot service](https://github.com/github-copilot/signup)
31 | 1. Open [this repository with Codespaces](https://codespaces.new/MicrosoftDocs/mslearn-advanced-copilot)
32 |
33 | ## 💪🏽 Exercise
34 |
35 | **Right click the following Codespaces button to open your Codespace in a new tab**
36 |
37 | [](https://codespaces.new/MicrosoftDocs/mslearn-copilot-codespaces-python)
38 |
39 | The current API is not exposing country/{country} which needs to be implemented to list cities. The route should allow only GET HTTP requests with a JSON response providing information from the historical high and low for that country, city, and given month.
40 |
41 | As with any implementation, this addition should include at least one test function to work with the pytest runner and test framework.
42 |
43 | ### 🛠 Step 1: Add a new route
44 | In our first exercise we will create a new route in our API. Go to the main.py file, and by using the inline chat with the following command `ctrl` + `i` (on Windows) or `cmd` + `i`(on Mac) ask GitHub Copilot to help you create a new API that shows you the cities of a country.
45 |
46 | Use the following prompt in inline-chat:
47 |
48 | ```
49 | Create a new route that exposes the cities of a country.
50 | ```
51 |
52 | This prompt should give you something similar like this:
53 |
54 |
55 | ```python
56 | # Create a new route that exposes the cities of a country:
57 | @app.get('/countries/{country}')
58 | def cities(country: str):
59 | return list(data[country].keys())
60 |
61 | ```
62 |
63 | > [!NOTE]
64 | > Try your new route and refine your prompt until the result is as desired.
65 |
66 | ### 🔎 Step 2: Create a test
67 | Now that you have created a new route, let's create a test with Copilot Chat for this route that uses Spain as the country. Remember to select your code and ask Copilot Chat to help you with this specific API that we just have created.
68 |
69 | Use the following prompt with GitHub Copilot Chat:
70 |
71 | ```
72 | /tests help me to create a new test for this route that uses Spain as the country.
73 | ```
74 |
75 | 
76 |
77 |
78 | Once Copilot has helped you to create your test, try it. If this is not functioning as expected, feel free to share those details with Copilot in the chat. For example:
79 |
80 | ```
81 | This test is not quite right, it is not including cities that doesn't exist. Only Seville is part of the API.
82 | ```
83 |
84 | It should give you another solution. Keep trying until you achieve the desired result.
85 |
86 | ### 🐍 Step 3: Use an agent to write the project
87 | During this step we will be using an agent (workspace) to write the project documentation on how to run this project. In the GitHub Copilot Chat, we will try the following prompt:
88 |
89 | `> @workspace help me to use an agent to write the project documentation on how to run it .`
90 |
91 | Finally, verify the new endpoint is working by trying it out by going to the `/docs` endpoint and confirming that the endpoint shows up.
92 |
93 |
94 | ### 💡 Step 4: Using Slash Commands
95 |
96 | Now that you've used GitHub Copilot to generate and explain code, you can also explore some other alternative approaches to perform developer tasks. These extra challenges will help you dive deeper into other GitHub Copilot features in addition to the ones you already know. For these extra challenges, you will use the Chat interface. Click on the GitHub Copilot Chat icon on the left sidebar if you don't have it open yet.
97 |
98 | 🚀 Congratulations, through the exercise, you have used GitHub Copilot with many different features that will allow you to work better with different projects. You interactively used some features to write tests, documentation, and find out more about existing code.
99 |
100 | ## Legal Notices
101 |
102 | Microsoft and any contributors grant you a license to the Microsoft documentation and other content
103 | in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode),
104 | see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the
105 | [LICENSE-CODE](LICENSE-CODE) file.
106 |
107 | Microsoft, Windows, Microsoft Azure, and/or other Microsoft products and services referenced in the documentation
108 | may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries.
109 | The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks.
110 | Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.
111 |
112 | Privacy information can be found at https://privacy.microsoft.com/en-us/
113 |
114 | Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents,
115 | or trademarks, whether by implication, estoppel, or otherwise.
116 |
--------------------------------------------------------------------------------
/09-Using-GitHub-Copilot-for-Azure-to-Deploy-to-Cloud/01-Getting-Started-with-GitHub-Copilot-for-Azure.md:
--------------------------------------------------------------------------------
1 | # Getting Started with GitHub Copilot for Azure
2 |
3 | Unlock a more efficient workflow and boost your productivity with GitHub Copilot for Azure Preview. This quick-start guide takes you through everything you need to know, from preparing the prerequisites to installing the GitHub Copilot for Azure extension in Visual Studio Code. By the end, you’ll be equipped to craft your first prompt and fully leverage the Azure platform’s potential.
4 |
5 |
6 |
7 |
8 | - **Who is this for**: Developers, Operations (ITPRO), and AI Engineers.
9 | - **What you'll learn**: Setup steps in getting started with GitHub Copilot for Azure.
10 | - **What you'll build**: You’ll confidently setup your AI enabled workspace.
11 |
12 |
13 | ## Prerequisite reading:
14 | - [What is GitHub Copilot for Azure Preview?](https://learn.microsoft.com/azure/developer/github-copilot-azure/introduction)
15 |
16 |
17 | ## 👉 Prerequisites
18 |
19 | To complete the steps in this lab, make sure that you have:
20 |
21 | 1. An Azure account and access to an Azure subscription. For details on how to set them up, see the [pricing page for Azure accounts.](https://azure.microsoft.com/pricing/purchase-options/azure-account)
22 |
23 | 1. A GitHub account. Steps on setting one up can be found here: [Creating an account on GitHub](https://docs.github.com/en/get-started/start-your-journey/creating-an-account-on-github)
24 |
25 | 1. GitHub Copilot subscription. Details on how to enable GitHub Copilot can be found here: [Quickstart for GitHub Copilot](https://docs.github.com/en/copilot/quickstart)
26 |
27 | 1. Visual Studio Code. For details on how to download and install it, see [Setting up Visual Studio Code.](https://code.visualstudio.com/docs/setup/setup-overview)
28 |
29 | 1. The GitHub Copilot extension and the GitHub Copilot Chat extension. For instructions on how to install this extension, see [Set up GitHub Copilot in VS Code.](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot)
30 |
31 |
32 | ## 💪🏽 Exercise
33 |
34 |
35 | ### 🛠 Step 1: Authenticate to GitHub and login to GitHub Copilot chat to enable the Copilot for Azure Preview
36 |
37 | **Right click the following Codespaces button to open your Codespace in a new tab**
38 |
39 | [](https://codespaces.new/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming)
40 |
41 | 1. Upon opening VS Code, in the right hans side, click **"Sign in with a GitHub.com account"**.
42 |
43 | 1. Visual Studio Code will pop up a message asking **"The extension 'GitHub Copilot Chat' wants to sign in using GitHub."** Click **Allow**.
44 |
45 | 1. You will need to authorize Visual Studio Code to continue with the user signed in. Click the **Continue** button.
46 |
47 | 1. And complete the authorization by clicking the **Authorize Visual-Studio-Code** button.
48 |
49 | 1. A popup message will ask to open VS Code. Click **Open**. you will be returned to VS Code, you will be authenticated to GitHub and will have access to **GitHub Copilot**.
50 |
51 |
52 | 1. In Visual Studio Code, select the **Extensions** icon.
53 |
54 | 1. Verify that you have the following Extensions installed.
55 | 1. **Azure Tools**
56 | 1. **GitHub Copilot**
57 | 1. **GitHub Copilot Chat**
58 | 1. **GitHub Copilot for Azure**
59 | 1. **.NET Install**
60 | 1. **Python**
61 |
62 | 1. If one is missing install it from the marketplace.
63 |
64 | ### ✍️ Step 2: Write your first prompt
65 |
66 | 1. Now that the extensions are installed, that you're properly authenticated, and that the extension is working correctly.
67 |
68 | 1. On the Activity Bar, select the **Chat** icon if the **Ask Copilot** pane is closed.
69 |
70 | 1. In the chat text area at the bottom of the chat pane, enter the following prompt:
71 |
72 | ```prompt
73 | @azure Do I have any resources currently running?
74 | ```
75 | > In the next section you will be asked to authorize applications and services multiple times. This is for your protection and will only be done once. We are authorizing **GitHub**, **VS Code** and **Azure** to trust the prompts with the credentials supplied.
76 |
77 | 1. You might get a message in the GitHub Copilot Chat pane that states "you need to sign in your Microsoftaccount to use GitHub Copilot for Azure (@Azure)".
78 |
79 | 1. If you do, click the link in the **"Already have an account? Sign in"** line.
80 | 1. Visual Studio Code will pop up a message asking **"The extension 'GitHub Copilot for Azure' wants to sign in using Microsoft."** Click **Allow**.
81 | 1. login using the credentials in the existing session, or the credentials found in the Resource Tab of the lab instructions. The same credential as the Azure subscriptions.
82 | 1. Close the tab. Not the browser.
83 | 1. Return to VS Code. Visual Studio Code will pop up a message asking **"The extension 'GitHub Copilot for Azure' wants to access the language models provided by GitHub Copilot Chat."** Click **Allow**.
84 | 1. Visual Studio Code will pop up another message asking **"The extension 'GitHub Copilot for Azure' wants to sign in using GitHub."** Click **Allow** again.
85 | 1. You will need to authorize Visual Studio Code to continue with the user signed in. Click the **Continue** button
86 | 1. Complete the authorization by clicking the **Authorize Visual-Studio-Code** button.
87 | 1. A popup message will ask to open VS Code. Click **Open**. you will be returned to VS Code, you will be authenticated to GitHub and will have access to **GitHub Copilot**.
88 |
89 | 1. The Copilot for Azure extension will query the Azure Resource graph, provide you with the resource query and provide the answer. Which at this point should be **You currently do not have any running resources across all your subscriptions.**
90 |
91 | ### Conclusion
92 |
93 | Congratulations, through the exercise, you have setup VS Code to use GitHub Copilot for Azure and have inquired it to let you know of any resources running in your Azure subscription.
94 |
--------------------------------------------------------------------------------
/09-Using-GitHub-Copilot-for-Azure-to-Deploy-to-Cloud/02-Build-and-deploy-your-application-with-GitHub-Copilot-for-Azure.md:
--------------------------------------------------------------------------------
1 | # Build and deploy your application with GitHub Copilot for Azure
2 |
3 | This module is a continuation of module 1 and provides a step-by-step guide on using GitHub Copilot for Azure Preview to create and deploy a new website in Azure.
4 |
5 | It highlights an approach to seamlessly integrating GitHub Copilot for Azure into your development and deployment workflow.
6 |
7 | ## Prerequisites
8 |
9 | Completion of [Module 1 - Getting Started to use GitHub Copilot for Azure](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/09-Using-GitHub-Copilot-for-Azure-to-Deploy-to-Cloud/01-Getting-Started-with-GitHub-Copilot-for-Azure.md)
10 |
11 | ## Create and deploy a website by using GitHub Copilot for Azure Preview
12 |
13 | 1. Create a new folder on your local computer where you can create a local clone of a GitHub repository.
14 | 1. In VS Code click **File**, Then **Open Folder**
15 | 1. in the **Open Folder** dialogue box, click **New Folder**, Give the folder a name, select it, then click **Select Folder**
16 |
17 | 1. VS Code will ask you **Do you trust the Authors of the files in this folder?**
18 | 1. click the **Yes, I trust the authors**
19 |
20 | 1. In Visual Studio Code, select **View** > **Terminal**. On the terminal pane, go to the new folder.
21 |
22 | 1. On the status Bar, select the **Chat** (GitHub) icon to open the chat pane.
23 |
24 | 1. Start a new chat session by selecting the plus icon (**+**) on the pane's title bar.
25 |
26 | 
27 |
28 | > If you closed the GitHub Copilot Chat after the last Module, click the GitHub icon in the status bar. Bottom-right of your VS Code screen. And select **"GitHub Copilot Chat"** in the option menu.
29 | >
30 | > 
31 |
32 | 6. In the chat text box, type the following prompt. Then select **Send** (paper airplane icon) or select Enter on your keyboard.
33 |
34 | ```prompt
35 | @azure Could you help me create and deploy a simple Flask website by using Python?
36 | ```
37 |
38 | > **IMPORTANT**
39 | The exact wording of the response is different each time GitHub Copilot for Azure answers, due to how large language models generate responses.
40 |
41 | After a moment, GitHub Copilot for Azure likely suggests an `azd` template to use. Or in some cases will provide an answer like the following:
42 |
43 | 
44 |
45 | Just Remember that the Large Language Model will understand what you tell it. Therefore, just have the conversation with it.
46 |
47 | 1. 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.
48 |
49 | 
50 |
51 | Select **Insert into Terminal** to insert the command into the terminal.
52 |
53 | 
54 |
55 | 1. Before you run the `azd init` command, you might have questions about how it affects your local computer and your Azure subscription.
56 |
57 | Use the following prompt:
58 |
59 | ```prompt
60 | @azure Before I execute azd init, what does it do?
61 | ```
62 |
63 | You might see a response that resembles the following screenshot.
64 |
65 | 
66 |
67 | 1. Use the following prompt to learn more about the `azd` template:
68 |
69 | ```prompt
70 | @azure What resources are created with this template?
71 | ```
72 |
73 | You might see a response that resembles the following screenshot.
74 |
75 | 
76 |
77 | 1. Ask questions about the services that the template uses with a prompt like:
78 |
79 | ```prompt
80 | @azure What is the purpose of a virtual network?
81 | ```
82 |
83 | You might see a response that resembles the following screenshot.
84 |
85 | 
86 |
87 | 1. 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.
88 |
89 | 1. Before you can continue, you must authenticate the `azd` tool by running in the terminal, the following command:
90 |
91 | ```cmd
92 | azd auth login
93 | ```
94 |
95 | 1. This will open a browser that will require you to authenticate to Azure. select the same credentials as before.
96 |
97 | 1. Once the new project is initialized,and that you've authenticated to Azure, use **azd up** command to deploy the application to your subscription. In the terminal, run the command according to the instructions in the original prompt's reply.
98 |
99 | ```
100 | azd up
101 | ```
102 |
103 | 1. The `azd up` command asks for information about your subscription, where to deploy the resources, and more.
104 |
105 | If you're uncertain how to answer, you can ask GitHub Copilot for Azure for help. For example, you might ask:
106 |
107 | ```prompt
108 | @azure azd up is asking me what location I want to deploy the website into. How should I respond?
109 | ```
110 |
111 | You might see a response that resembles the following screenshot.
112 |
113 | 
114 |
115 | 5. Continue to answer prompts from `azd up`. Ask GitHub Copilot for Azure questions as needed.
116 |
117 | 1. When asked the location select **Canada Central**.
118 |
119 | 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. But we can Move on to [Module 3](https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming/blob/main/09-Using-GitHub-Copilot-for-Azure-to-Deploy-to-Cloud/03-Get-Answers-to-your-Questions-about-Azure-Services-and-Resources.md) while it completes
120 |
121 | 1. If `azd up` experiences an error, ask GitHub Copilot for Azure about the error and how you can resolve it.
122 |
123 | > **TIP**
124 | > 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 copy/pasted or attached via the paperclip.
125 |
--------------------------------------------------------------------------------
/09-Using-GitHub-Copilot-for-Azure-to-Deploy-to-Cloud/03-Get-Answers-to-your-Questions-about-Azure-Services-and-Resources.md:
--------------------------------------------------------------------------------
1 | # Get answers to your questions about Azure services and resources
2 |
3 | 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 this lab like a *Choose your own adventure* novel. Explore the many prompts below and try and craft your own prompts based on what you think you would need the @azure extension to do for you.
4 |
5 | ## Best practices
6 |
7 | Using copilots can increase developer productivity by answering questions, executing tasks, and generating code. However, remember these vital rules:
8 |
9 | - Review all AI-generated responses. Validate their correctness, applicability, potential outcomes (such as costs and security) before taking action based on those responses.
10 | - Never save application secrets or credentials in source code.
11 | - Never submit application secrets or credentials in questions or in code when you ask questions.
12 |
13 | 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](https://learn.microsoft.com/azure/copilot/write-effective-prompts), which provides advice for prompt engineering in the context of Azure.
14 |
15 | - Be clear and specific
16 | - Set expectations
17 | - Add context about your scenario
18 | - Break down your requests
19 | - Customize your code
20 | - Use Azure terminology
21 | - Use the feedback loop
22 |
23 | ## Learn about Azure Services Using GitHub Copilot for Azure
24 |
25 | In this exercise, we will use GitHub Copilot for Azure Preview to learn about how to use Azure for your application, We will start with open-ended question or request. Then, add details like specific services and technologies for better results. Try the following example prompts.
26 |
27 | ## Learn about system architecture on Azure
28 |
29 | 1. "@azure How can I create a highly available architecture in Azure?"
30 | 1. "@azure Explain the Azure Well-Architected Framework."
31 | 1. "@azure What types of app hosting solutions does Azure have?"
32 | 1. "@azure Help me orchestrate and automate my data processing workflows."
33 | 1. "@azure How can I integrate SignalR with Azure Application Gateway and Azure API Management?"
34 | 1. "@azure How many units do you recommend?"
35 | 1. "@azure What are the benefits and applications of using Terraform?"
36 |
37 | ## Learn about AI on Azure
38 |
39 | 8. "@azure I want to build an AI application. What services can I use?"
40 |
41 | ## Learn about web and application hosting on Azure
42 |
43 | 9. "@azure Which Azure service is best for hosting a scalable web application?"
44 | 1. "@azure Which service should I use to create a website?"
45 | 1. "@azure How can I use Azure to build a scalable web application?"
46 | 1. "@azure For what scenarios is Azure Functions better than Web Apps?"
47 |
48 | ## Learn about containers on Azure
49 |
50 | - "@azure What types of containerized applications does Azure support?"
51 | - "@azure What are the options for managing containers in Azure?"
52 | - "@azure When should I use Azure Kubernetes Service instead of Azure Container Apps?"
53 | - "@azure What's the difference between Azure Container Apps and AKS?"
54 | - "@azure Why would I choose Azure Container Apps over AKS?"
55 |
56 | ### Learn how to use Azure services for your app
57 |
58 | |Service or technology|Learn prompt examples|
59 | |---|---|
60 | |Azure AI Search|- "@azure What is Azure AI Search and why should I use it?"
- "@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?"
- "@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 multi-tenant 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?"
|
61 | |Azure API Management|- "@azure What are the benefits and applications of Azure API Management?"
|
62 | |Azure App Service|- "@azure How do I deploy a web app in Azure?"
- "@azure How do I create an App Service app and deploy code to a staging environment by using the CLI?"
- "@azure Create a script to deploy a web app that will run in Python."
- "@azure What database options does Azure have for web apps?"
- "@azure What serverless options does Azure have for web apps?"
- "@azure Create a guide for maximizing Azure App Service."
|
63 | |Azure Cache for Redis|- "@azure Demonstrate how to configure a Redis cache in Azure for high availability and disaster recovery."
|
64 | |Azure Container Apps|- "@azure What is the Azure Container Apps service?"
- "@azure Tell me the difference between a container app and a container app environment."
|
65 | |Azure Cosmos DB|- "@azure Why would I use Azure Cosmos DB instead of Azure SQL?"
- "@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?"
|
66 | |Azure Data Factory|- "@azure How do I create data pipelines with Azure Data Factory?"
|
67 | |Azure Developer CLI (`azd`)|- "@azure Do you have example deployment models for Azure? SaaS, PaaS, etc."
- "@azure What is the best infrastructure for my application?"
- "@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?"
- "@azure What is the Azure Developer CLI?"
- "@azure What is the difference between Bicep and ARM templates?"
- "@azure How do I make sure my environments have the best security patterns?"
- "@azure How do I deploy by using my CI/CD pipeline?"
|
68 | |Azure Functions|- "@azure How do I create a new Azure function?"
- "@azure What is the difference between Azure Functions and Azure Logic Apps?"
- "@azure Create a guide for integrating Azure Logic Apps with Azure Functions."
- "@azure I want to create an Azure function in Node.js."
|
69 | |Azure Key Vault|- "@azure Explain how and why I should use Azure key vaults."
|
70 | |Azure Kubernetes Service (AKS)|- "@azure How do I get the status of all nodes in my AKS cluster?"
- "@azure What's the command to set a context for my AKS cluster?"
|
71 | |Azure Machine Learning|- "@azure Generate a PowerShell script to create a new Azure Machine Learning workspace."
- "@azure What is the difference between Azure AI services and Azure Machine Learning?"
|
72 | |Azure Monitor|- "@azure Create a guide for using Azure Logic Apps to automate responses to Azure Monitor alerts."
|
73 | |Azure Virtual Network|- "@azure How do I balance inbound network traffic to my application?"
|
74 | |Azure OpenAI Service|- "@azure What services does Azure OpenAI provide?"
- "@azure Where is GPT-4o mini available?"
- "@azure What are the prerequisites for integrating Azure OpenAI?"
- "@azure Create a guide for creating and using Azure OpenAI resources."
- "@azure What are the available types of Azure OpenAI models?"
|
75 | |Azure SDK|- "@azure Can I use Azure SDKs in the browser?"
- "@azure Does the C# storage SDK support chunked blob uploads and downloads?"
|
76 | |Azure SignalR Service|