Skip to content

Commit

Permalink
Add instructions for 0103
Browse files Browse the repository at this point in the history
  • Loading branch information
feaselkl committed Aug 27, 2024
1 parent 69b77c0 commit 43c43dd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion docs/01_deploy_app_resources/0103.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The key tasks are as follows:
az ad sp create-for-rbac --name "TechExcelAzurePaaS" --json-auth --role contributor --scopes /subscriptions/{YOUR SUBSCRIPTION ID}/resourceGroups/{YOUR RESOURCE GROUP}
```
Retain the JSON output to use in a GitHub Actions secret.
4. Create the following GitHub Actions secrets:
1. `STREAMLIT_SECRETS` -- Paste in the entirety of your `secrets.toml` file.
2. `ACR_LOGIN_SERVER` -- Retrieve from your container registry's **Access keys** menu.
Expand Down Expand Up @@ -56,6 +57,35 @@ The key tasks are as follows:
<details markdown="block">
<summary>Expand this section to view the solution</summary>
TODO
- In [the Azure portal](https://portal.azure.com), navigate to the resource group you have created and select the **Container registry** in the resource group.
- Navigate to the **Access keys** in the **Settings** menu and make note of your **Login server**, **Username**, and **password**. You will need these for GitHub Actions secrets. Also make note of the **Registry name** in order to modify the GitHub Actions workflows.
- After copying `api.yml` and `dashboard.yml` into the `.github/workflows` folder, replace any instances of `{your_registry_name}` with the registry name you copied in the prior step. Replace any instances of `{your_prefix}` with the unique identifier for your account. This is a 13-character string and is the first 13 characters of each Azure resource in your resource group.
- Create a new service principal named `TechExcelAzurePaaS` using the following command in the az CLI, being sure to replace `{YOUR SUBSCRIPTION ID}` and `{YOUR RESOURCE GROUP}` with the appropriate values:
```cmd
az ad sp create-for-rbac --name "TechExcelAzurePaaS" --json-auth --role contributor --scopes /subscriptions/{YOUR SUBSCRIPTION ID}/resourceGroups/{YOUR RESOURCE GROUP}
```
Retain the JSON output to use in a GitHub Actions secret.
- To create a GitHub Actions secret, navigate to your forked GitHub repository and select the **Settings** menu. From there, navigate to **Secrets and variables** and select the **Actions** menu. You can then create new repository secrets.
![Add a new GitHub Actions repository-level secret.](../../media/Solution/0103_Secrets.png)
You will need to create a total of five such secrets:
1. `STREAMLIT_SECRETS` -- Paste in the entirety of your `secrets.toml` file.
2. `ACR_LOGIN_SERVER` -- Retrieve from your container registry's **Access keys** menu.
3. `ACR_USERNAME` -- Retrieve from your container registry's **Access keys** menu.
4. `ACR_PASSWORD` -- Retrieve from your container registry's **Access keys** menu.
5. `AZURE_CREDENTIALS` -- Paste in the entirety of the JSON output from running `az ad sp create-for-rbac`.
- After committing and pushing your changes to the forked GitHub repository, navigate to the **Actions** menu. You will see two workflows, API Deployment and Dashboard Deployment. Select each in turn and select the **Run workflow** dropdown and choose **Run workflow** against your **main** branch.
![Run the API Deployment GitHub Actions workflow.](../../media/Solution/0103_Workflow.png)
Each deployment may take several minutes to complete.
- To find the URL of your dashboard, navigate to your resource group in [the Azure portal](https://portal.azure.com). Then, select the **App service** whose name ends with **-dash**. You can obtain the URL from the **Default domain** entry in the Essentials section.
![Retrieve the URL to the deployed dashboard.](../../media/Solution/0103_DashboardURL.png)
</details>
Binary file added media/Solution/0103_DashboardURL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/Solution/0103_Secrets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/Solution/0103_Workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 43c43dd

Please sign in to comment.