Skip to content

Commit

Permalink
Merge pull request #8 from githubpartners/briana-edits
Browse files Browse the repository at this point in the history
Briana edits
  • Loading branch information
brianamarie authored Aug 24, 2020
2 parents 467dafd + 44cb592 commit c169f68
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ before:

- type: createPullRequest
title: "Activity 3: Add a CI/CD workflow"
head: add-ci-cd-workflow
head: add-azure-ci-cd
body: ci-cd-instructions.md

- type: createPullRequest
Expand All @@ -30,7 +30,7 @@ before:

- type: createPullRequest
title: "Activity 5: Add a teardown workflow"
head: add-teardown-workflow
head: destroying-azure-resources
body: teardown-instructions.md


Expand Down
15 changes: 9 additions & 6 deletions responses/create-azure-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Luckily, using GitHub Actions, we can greatly reduce this pain point and impleme

This pull request contains a workflow that will configure all the necessary resources and deploy the current version of your Probot application automatically for us! In order to get a good understanding of what this workflow is going, it is beneficial to examine this process from a manual perspective first.

**Expand one of the following sections to lean how to configure Azure either manually or using GitHub Actions**
**Expand one of the following sections to lean how to configure Azure either manually _or_ using GitHub Actions**

<details><summary>Manually configuring Microsoft Azure</summary>

<br>
**Provisioning**

1. Configure a **subscription** (this is true even when using actions!)
Expand Down Expand Up @@ -44,15 +44,15 @@ This pull request contains a workflow that will configure all the necessary reso
```
1. When that command completes run the next one:
```
az webapp deployment source config-local-git --name probot-add-collaborator --resource-group probot-applications
az webapp deployment source config-local-git --name probot-add-collaborators --resource-group probot-applications
```
1. The previous command will present you with output similar to that below:
```
{
"url": "https://[email protected]/msdocs-node-cli.git"
}
```
1. Add a new remote to Git named `azure`
1. Add a new remote to Git named `azure` (Note: Do not copy and paste this; use the edited output of the previous step, removing your username.)
```
git remote add azure https://msdocs-node-cli.scm.azurewebsites.net/msdocs-node-cli.git
```
Expand All @@ -65,8 +65,11 @@ This pull request contains a workflow that will configure all the necessary reso
</details>

<details><summary>Using GitHub Actions to configure Azure</summary>
<br>
In this pull request you will find a workflow named `config-azure.yml`. This workflow follows all of the above steps, however it leverages a few official Azure Actions as well as some raw `az cli` commands to get the job done.

**This may take a while - anywhere from 6 to 25 minutes. If this is too long, you can use the manual method instead.**

Let's take a quick peek at the jobs in this workflow before it get's triggered and set's up your environment for you.

1. The first two jobs of this workflow are quite simple, they checkout the code from the repository into the Actions workspace and then log in to the Azure CLI using the service principle you saved as the **AZURE_CREDENTIALS** repository secret
Expand Down Expand Up @@ -150,7 +153,7 @@ The Probot app will need to make use of a private key. In a real world setting,
-----END PRIVATE KEY-----
```

2. Add your private key to your **probot-add-collaborator app service**
2. Add your private key to your **probot-add-collaborators app service**
- Go to **Settings > Configuration**
- Add a new application setting
- Paste in the private key
Expand All @@ -173,7 +176,7 @@ The Probot app will need to make use of a private key. In a real world setting,
1. **Merge** this pull request
2. Go to the issue **Setting up your environment!** issue for further instructions.

In either case, once the deployment of code is finished you need to replace the [Probot Webhook URL](https://github.com/settings/apps) in the app settings to point to your azure deployment
In either case, once the deployment of code is finished you need to replace the [Probot Webhook URL](https://github.com/settings/apps) in the app settings to point to your azure deployment. (You can find this by going to "Resource groups", clicking "probot-add-collaborators", and copying the URL from that page.)

![image](https://user-images.githubusercontent.com/38021615/89918100-77dd3680-dbae-11ea-9953-68e501e4d3fb.png)

Expand Down
19 changes: 8 additions & 11 deletions responses/new-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,14 @@
]
```
1. Next we will create the service principle, which is will allow us to manage resources in your subscription. Run this command in your terminal:
```
az ad sp create-for-rbac --name "GitHub-Actions" --role contributor \
--scopes /subscriptions/{subscription-id} \
--sdk-auth
```
az ad sp create-for-rbac --name "GitHub-Actions" --role contributor \
--scopes /subscriptions/{subscription-id} \
--sdk-auth
# Replace {subscription-id} with the id you copied to use as AZURE_SUBSCRIPTION_ID.
```

> **The \ character works as a line break on Unix based systems. If you are on a Windows based system the \ character will cause this command to fail. Place this command on a single line if you are using Windows.**
# Replace {subscription-id} with the id you copied to use as AZURE_SUBSCRIPTION_ID.
```
> **The \ character works as a line break on Unix based systems. If you are on a Windows based system the \ character will cause this command to fail. Place this command on a single line if you are using Windows.**
1. The above command will respond with an object similar to the one shown below. Copy the entire objects contents to a safe place. We will later store it as a repository secret named `AZURE_CREDENTIALS`
```
{
Expand All @@ -52,7 +49,7 @@ az ad sp create-for-rbac --name "GitHub-Actions" --role contributor \
1. Click **New secret**
1. Name your new secret **AZURE_SUBSCRIPTION_ID** and paste the value from the `id:` field from the result of step 2.
1. Click **Add secret**.
1. Repeat this process for **AZURE_CREDENTIALS** and paste the entire contents from the terminal command you ran in step 4.
1. Repeat this process for **AZURE_CREDENTIALS** and paste the entire contents from the output of the terminal command you ran in step 4.
</details>

#### Probot secrets
Expand Down

0 comments on commit c169f68

Please sign in to comment.