Skip to content

Commit 5d933a2

Browse files
authored
Merge branch 'main' into peckjon-patch-7
2 parents 7790762 + 5137455 commit 5d933a2

File tree

4 files changed

+72
-7
lines changed

4 files changed

+72
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This repository contains the project for both a guided workshop and the Modern D
44

55
## Getting started
66

7-
> **[Get started learning about development and DevOps with GitHub!](pets-workshop/blob/main/content/README.md)**
7+
> **[Get started learning about development and DevOps with GitHub!](./content/README.md)**
88
99
## License
1010

content/guided-workshop/exercises/3-codespaces.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ One thing that's really great is the [default dev container](https://github.com/
2020

2121
Let's create our own dev container! The [dev container is configured](https://docs.github.com/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers) by creating the Docker files Codespaces will use to create and configure the container, and providing any customizations in the `devcontainer.json` file. Customizations provided in `devcontainer.json` can include ports to open, commands to run, and extension to install in Visual Studio Code (either running locally on the desktop or in the browser). This configuration becomes part of the repository. All developers who wish to contribute can then create a new instance of the container based on the configuration you provided.
2222

23-
1. Access the Command Palette (<kbd>F1</kbd>), then start typing **dev container**.
23+
1. Access the Command Palette (<kbd>F1</kbd> or clicking ☰ → View → Command Palette), then start typing **dev container**.
2424
1. Select **Codespaces: Add Development Container Configuration Files...** .
2525
1. Select **Create a new configuration...**.
2626
1. Select **From a predefined container configuration...**.
@@ -56,7 +56,7 @@ You've now defined a custom container!
5656

5757
Whenever someone uses the codespace you defined they'll have an environment with Node.js and Mongo DB, and the GitHub Copilot extension installed. Let's use this container!
5858

59-
1. Select <kbd>F1</kbd> to open the command palette.
59+
1. Open the command palette.
6060
1. Type **rebuild** and select **Codespaces: Rebuild container**.
6161
1. Select **Rebuild Container** on the dialog box. Your container now rebuilds.
6262

@@ -68,7 +68,7 @@ Custom containers for GitHub Codespaces become part of the source code for the r
6868

6969
> **IMPORTANT:** For purposes of this exercise we are pushing code updates directly to `main`, our default branch. Normally you would follow the [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow), which we will do in a [later exercise](6-github-flow.md).
7070
71-
1. Open the terminal window in the codespace by selecting <kbd>Ctl</kbd> + <kbd>`</kbd>.
71+
1. Open the terminal window in the codespace by selecting <kbd>Ctl</kbd> + <kbd>`</kbd> or clicking ☰ → View → Terminal.
7272
1. Find the issue number for defining the codespace by entering the following command:
7373

7474
```bash
@@ -81,7 +81,7 @@ Custom containers for GitHub Codespaces become part of the source code for the r
8181

8282
```bash
8383
git add .
84-
git commit -m "Resolves <ISSUE_NUMBER>"
84+
git commit -m "Resolves #<ISSUE_NUMBER>"
8585
git push
8686
```
8787

@@ -107,7 +107,7 @@ Let's add an environment variable, refresh the codespace to update the environme
107107
1. Select the **Settings** tab.
108108
1. On the left, under the **Security** section, expand **Secrets and variables** and select **Codespaces**.
109109
110-
![Screenshot of the Secrets and variables section](https://docs.github.com/en/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces)
110+
![Screenshot of the Secrets and variables section](./images/3-secrets-variables.png)
111111
112112
1. Select **New repository secret**.
113113
1. Create a new secret by entering the following values and pressing **Add secret**.
@@ -132,6 +132,8 @@ Let's add an environment variable, refresh the codespace to update the environme
132132
133133
1. You will now see a new tab with your website running! Notice the URL at the top, which resembles the name of your codespace. Your website is running in the container you defined in the cloud!
134134
135+
> **NOTE:** If you close this tab, you can reopen it by clicking the "Ports" tab next to the Terminal, mousing over the "Forwarded Address" starting with `https://`, then clicking the globe icon
136+
135137
1. If you wish, you can add a pet to the database by selecting **Add pet**. On the form you will notice various fields to describe the pet. If you need a URL for images, you can use any of the following:
136138
137139
- https://raw.githubusercontent.com/github/pets-workshop/main/src/pics/roscoe.jpg

content/guided-workshop/exercises/5-coding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Let's see how GitHub Copilot can help us quickly create the component. We're goi
149149
1. Finally, ask GitHub Copilot to display today's hours:
150150
151151
```javascript
152-
// display today and the hours in an div with an id of hours
152+
// display a header of "Today's Hours", and the name of today and hours (in a paragraph), inside an div with an id of "hours"
153153
```
154154
155155
1. GitHub Copilot will likely suggest the following code line-by-line, which you can accept by pressing <kbd>Tab</kbd>:

content/guided-workshop/exercises/7-create-environment.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,69 @@ You've prepped everything on both Azure and your repository, and created the wor
210210
211211
The workflow will now run and create the resources! This will take several minutes. You may need to refresh the page to see it start running. Once running, you can navigate into the workflow run to view the log and track the progress.
212212
213+
## Debugging the workflow
214+
215+
If you see error messages such as:
216+
217+
```
218+
Code: MissingSubscriptionRegistration
219+
Message: The subscription is not registered to use namespace {resource-provider-namespace}
220+
```
221+
222+
For example:
223+
224+
```
225+
Error: ERROR: ***"status":"Failed",
226+
"error":***"code":"DeploymentFailed",
227+
```
228+
229+
```
230+
"target":"/subscriptions/***/resourceGroups/pets-workshop/providers/Microsoft.Resources/deployments/main",
231+
"message":"At least one resource deployment operation failed.
232+
Please list deployment operations for details.
233+
Please see https://aka.ms/arm-deployment-operations for usage details.",
234+
```
235+
236+
```
237+
"details":[***"code":"MissingSubscriptionRegistration",
238+
"target":"Microsoft.App",
239+
"message":"The subscription is not registered to use namespace 'Microsoft.App'.
240+
See https://aka.ms/rps-not-found for how to register subscriptions."***]
241+
```
242+
243+
```
244+
"details":[***"code":"MissingSubscriptionRegistration",
245+
"target":"Microsoft.ContainerRegistry",
246+
"message":"The subscription is not registered to use namespace 'Microsoft.ContainerRegistry'.
247+
See https://aka.ms/rps-not-found for how to register subscriptions."***]
248+
```
249+
250+
```
251+
"details":[***"code":"MissingSubscriptionRegistration",
252+
"target":"Microsoft.DocumentDB",
253+
"message":"The subscription is not registered to use namespace 'Microsoft.DocumentDB'.
254+
See https://aka.ms/rps-not-found for how to register subscriptions."***]
255+
```
256+
257+
```
258+
"details":[***"code":"MissingSubscriptionRegistration",
259+
"target":"Microsoft.OperationalInsights",
260+
"message":"The subscription is not registered to use namespace 'Microsoft.OperationalInsights'.
261+
See https://aka.ms/rps-not-found for how to register subscriptions."***]
262+
```
263+
264+
You need to register resources via the Azure Portal first.
265+
266+
Specifically, you need to register:
267+
* Microsoft.App
268+
* Microsoft.ContainerRegistry
269+
* Microsoft.DocumentDB
270+
* Microsoft.OperationalInsights
271+
272+
Follow the instructions at
273+
274+
https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-register-resource-provider?tabs=azure-portal#solution
275+
213276
## Summary and next steps
214277
215278
Congratulations! You have new defined a workflow which uses infrastructure as code (IaC) to create the resources necessary for deployment. This allows you to quickly create a consistent environment, reducing overhead and errors. Let's close everything out by [implementing continuous deployment](8-deployment.md).

0 commit comments

Comments
 (0)