Skip to content

Commit 4d3a08c

Browse files
KSchlobohmAdrian Hallnishanilstephen-sumnermjrousos
authored
Rwa version 1.1 (#369)
* Rwa version 1.1 (#345) * standardize git settings * generic container name * replace infra * version 1.1 * move directory * pin AZD version * add additional-resources.md * src version 1.1 * add isolated deployment doc * add prerequisites * remove unused file * replace steps to deploy * match telemetry * update comment * new telemetryId * no longer beta * fix redis race condition * add local-development * cleaning up image folder * update image * web app name * workflow updates * update simulate the patterns * new re-open image * local-development workflow * updates based on azd workflow * Add Az module installation and update environment creation instructions * Update application name in README * Remove unnecessary information from README.md * Remove Azure deployment deletion instructions * Fix typo in simulate-patterns.md * Update simulation patterns and cleanup screenshots * Add secondary resource group output * Update output variable names in main.bicep file * Fix variable assignment in README.md * Update deployment instructions to use PowerShell scripts * Update App Insights with timing information * Update README.md and isolated-deployment.md * Update deployment instructions for multi-region deployment * Update front-door-route.bicep to add uri * add navigation to redis console * Update deployment commands and add instructions to find application URL * Update isolated deployment configuration * Update secondary region variable name in isolated deployment guide * Update authentication link in isolated deployment guide * unique deployment names * skip SSMS * unique dns zone link deployment name * Update module names based on deployment settings * Remove code for peering spoke to spoke * Support for secondary region in cleanup.ps1 * deployment instructions * reduced deployment time average * align with latest cleanup.ps1 * Update relecloud-solution-diagram.png * Fix variable interpolation in cleanup script * Update module names to include network names in peer connections * Update Az module import in cleanup and setup scripts --------- Co-authored-by: Adrian Hall <[email protected]> * update file perm * Azd upgrade (#346) * fix missing dependencies * align with azd latest * target supported version * Incorporate testing feedback (#347) * toggle prompts by support * describe kv location * Update module comments * Remove link * Update template comments * Update Azure Firewall resource description * Update comments front door templates * remove unused param * Update comments in azure-monitor.bicep file * Update comments for peer-networks.bicep file * Update shared-frontdoor.bicep file * Update telemetry module documentation * Add Relecloud VNet Diagram.vsdx diagram * remove unused param * increment AZD version * front door private endpoint approval * Entra update * Add Azure App Configuration service * Fix null reference exception and add user creation * Update error message for null purchase ticket request * deployment parameter validation * deploy resources to secondary location * reference Microsoft Entra ID * update workflow * add budget cleanup scripts * add principal type * file perm * update with troubleshooting * update troubleshooting * set telemetry (#355) * Diagram updates (#356) * add diagram * update workflow * update workflow * support vs * purge support * Update README.md Co-authored-by: Nish Anil <[email protected]> * Update README.md Co-authored-by: Nish Anil <[email protected]> --------- Co-authored-by: Nish Anil <[email protected]> * update annotation * add network diagram to prod-deployment.md * Rwa 1.1 updates (#358) * Update README.md * added new rwa dotnet 1.1 image * deleted old image file * update link to diagram * fixed bullet points in readme * fixed bullet points * Update README.md * Update README.md * Apply suggestions from code review Co-authored-by: Ken Schlobohm <[email protected]> --------- Co-authored-by: Ken Schlobohm <[email protected]> * Simplify AZD experience (#360) * cleanup on azd down * update steps * azd up for dev * format web_uri output * update formatting * update logic * align deployment steps * resourceToken for naming deployments * updated steps * fix deployment name conflicts * support cleanup when provision fails * update secondaryResourceToken * update test regions * fix delete groups condition * align with new script switch * update timing * add postconfiguration * describe deployment steps * simplify steps * update instructions * azd vars to make prod-deployment easier * az module * prod file cleanup * secondary region instructions * hub resource token * fix secondary region deploy * instruction updates * add resourceToken to hub * convert jq commands to pwsh * fix intermittent delete erorr * describe fingerprint issue * update workflow for azd hooks * remove location * Update infra/scripts/predeploy/set-app-configuration.ps1 Co-authored-by: Mike Rousos <[email protected]> * fix error msg * default to trusted launch * conditionally define var * single chmod * provide region help * script permission * update perm * update perm * add post-deployment * Azure pwsh installed by script * describe troubleshooting link * fix conditional typo * fix conditional typo2 * principal check * update env vars * Rwa 1.1 updates (#358) * Update README.md * added new rwa dotnet 1.1 image * deleted old image file * update link to diagram * fixed bullet points in readme * fixed bullet points * Update README.md * Update README.md * Apply suggestions from code review Co-authored-by: Ken Schlobohm <[email protected]> --------- Co-authored-by: Ken Schlobohm <[email protected]> * remove unused line * arrange tags * remove echo * remove toLower (#361) * remove ToLower * clarify step * unique module names * unique module name * add WSL clone instructions * instruction update * update page name * add DDoS link * update SCP cmd * align SDK to MWA * fix scp command --------- Co-authored-by: Mike Rousos <[email protected]> Co-authored-by: Stephen Sumner <[email protected]> Co-authored-by: Mark Tinderholt <[email protected]> * Add composite docs (#363) * add sla-calculation * add storage * Update readme (#362) * update readme * fix link * quick updates to developer-experience.md * rename simulate-patterns doc * Update README deployment description * fix title * describe PSVersion * fix link * add trademarks * Update deployment teardown instructions * link to SLA doc * fix link * prod deployment title * typos * Update Redis Console commands to clarify their purpose * fix typo * Update README.md * update demo.md * describe region pairs * update README * update prerequisites.md * Workflow commands (#366) * align steps with readme * azd env new * swap AZURE_PRINCIPAL_TYPE * AZURE_PRINCIPAL_TYPE * select subscription * include jq for teardown * consolidate teardown * fix typo * update teardown * update step label * support purge * set AZURE_RESOURCE_GROUP * add Read-ApplicationPrompt * enable purge option * data validation * add concurrency * Update Dockerfile * label jump host * Hub jump (#367) * wip - move to hub * add var needed for cleanup * remove unused params * remove unused params * add output var type * redefine devopsSubnet * rename * rename host * update deployment instructions * jumpbox * Updated steps for Visual Studio experience (#368) * align with main parameters file * support dev experience auth * updated steps * support dev commands * scripted support to make azure sql accessible * add steps to start the solution * remove unused images * update diagram * update diagram names * fix param validation --------- Co-authored-by: Adrian Hall <[email protected]> Co-authored-by: Nish Anil <[email protected]> Co-authored-by: Stephen Sumner <[email protected]> Co-authored-by: Mike Rousos <[email protected]> Co-authored-by: Mark Tinderholt <[email protected]>
1 parent 737ddf4 commit 4d3a08c

File tree

383 files changed

+19568
-6494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

383 files changed

+19568
-6494
lines changed

.azdo/pipelines/README.md renamed to .azdo/README.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
# Azure DevOps Pipeline Configuration
22

3-
This document is included to help you quickly set up this sample as part of an Azure DevOps pipeline that could be used as a starting point for your DevOps automations.
3+
This document will help you create an Azure DevOps pipeline that uses the Azure Developer CLI to deploy this sample.
44

5-
## Other considerations
6-
Your devOps process should be customized to automate the build, test, and deployment steps specific to your business needs.
7-
We recommend these following considerations to expand on the `azure-dev.yml` sample.
5+
> This pipeline does not include the QA processes that we recommend, it is included to help you quickstart your learning journey. This pipeline also does not include the Database lifecycle management processes that we recommend. You should review your needs with your team to identify a mature solution for deploying database changes, and versioning your database schema with source control.
86
9-
- You may want to review `scheduled-azure-dev.yml` to see how to add more steps such as validation testing
10-
- You may want multiple workflows defined in different files for different purposes
11-
- Consider database lifecycle management
12-
- Consider quality testing processes (e.g. integration testing)
13-
14-
## Setting up Azure DevOps Pipelines
15-
The following content show you how to configure an Azure DevOps pipeline that uses the Azure Developer CLI.
16-
17-
You will find a default Azure DevOps pipeline file in `./.azdo/pipelines/daily-azure-dev.yml`. It will provision your Azure resources and deploy your code on a daily schedule.
7+
You will find a default Azure DevOps pipeline file in `./.azdo/pipelines/azure-dev.yml`. It will provision your Azure resources and deploy your code on a daily schedule.
188

199
You are welcome to use the file as-is or modify it to suit your needs.
2010

21-
> First time setup: This pipeline does not ask you to store credentials that can access Azure AD. As such, you will need to run the `createAppRegistrations.sh` script with your account for a first time setup. This process can be added to the pipeline as an idempotent script but will require an Azure AD account to create the App Registrations.
11+
> First time setup: This pipeline does not ask you to store credentials that can access Microsoft Entra ID. As such, you will need to run the `create-app-registrations.ps1` script with your account for a first time setup. This process can be added to the pipeline as an idempotent script but will require an Microsoft Entra ID account to create the App Registrations.
2212
2313
## Getting Started
2414
The following steps are required to get started.
@@ -43,34 +33,34 @@ The following steps walk-through creating the Azure Pipeline.
4333

4434
1. Start by navigating to the Azure DevOps Pipeline page
4535

46-
![#Azure DevOps Pipeline Page](../../assets/AzdoSetup/1CreateAPipeline.png)
36+
![#Azure DevOps Pipeline Page](../assets/images/AzdoSetup/1CreateAPipeline.png)
4737

4838
<sup>Image of Azure DevOps Pipeline Page</sup>
4939

5040
2. Click the `New pipeline` button
5141

5242
3. Choose **Azure Repos Git** and the appropriate git repository
5343

54-
![#Azure Pipeline asks where your code is](../../assets/AzdoSetup/2CreateAPipeline.png)
44+
![#Azure Pipeline asks where your code is](../assets/images/AzdoSetup/2CreateAPipeline.png)
5545

5646
<sup>Azure Pipeline asks where your code is</sup>
5747

5848
4. Choose **Existing Azure Pipelines YAML file**
5949

6050

61-
![#Azure Pipeline asks to pick a template](../../assets/AzdoSetup/3CreateAPipeline.png)
51+
![#Azure Pipeline asks to pick a template](../assets/images/AzdoSetup/3CreateAPipeline.png)
6252

6353
<sup>Azure Pipeline asks to pick a template</sup>
6454

6555
5. Select the *daily-azure-dev.yml* file from your repo
6656

67-
![#Pick the daily-azure-dev.yml file](../../assets/AzdoSetup/4CreateAPipeline.png)
57+
![#Pick the daily-azure-dev.yml file](../assets/images/AzdoSetup/4CreateAPipeline.png)
6858

6959
<sup>Pick the daily-azure-dev.yml file</sup>
7060

7161
6. On the next screen you must provide 3 pipeline variables
7262

73-
![#Set Pipeline variables](../../assets/AzdoSetup/5CreateAPipeline.png)
63+
![#Set Pipeline variables](../assets/images/AzdoSetup/5CreateAPipeline.png)
7464

7565
<sup>Set Pipeline variables</sup>
7666

@@ -82,5 +72,5 @@ The following steps walk-through creating the Azure Pipeline.
8272

8373
7. Click the `Run` button to start your first pipeline
8474

85-
> Note: Because the pipeline does not configure your Azure AD resources you must configure the Azure AD App Registrations and place those values into Key Vault and App Configuration Service before the application will run successfully. We provide the `createAppRegistration.sh` script to do this one-time setup.
75+
> Note: Because the pipeline does not configure your Microsoft Entra ID resources you must configure the Microsoft Entra ID App Registrations and place those values into Key Vault and App Configuration Service before the application will run successfully. We provide the `createAppRegistration.sh` script to do this one-time setup.
8676

.azdo/pipelines/azure-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trigger:
77
pool:
88
vmImage: ubuntu-latest
99

10-
container: mcr.microsoft.com/azure-dev-cli-apps:latest
10+
container: mcr.microsoft.com/azure-dev-cli-apps:1.5.0
1111
variables:
1212
- name: env_name
1313
value: $(AZD_AZURE_ENV_NAME)daily

.devcontainer/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
ARG VARIANT
2-
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
2+
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:${VARIANT}
3+
4+
# Install Az module
5+
RUN pwsh -Command "Install-Module -Name Az -Force -AllowClobber -Scope AllUsers"
6+
RUN pwsh -Command "Install-Module -Name SqlServer -Force -AllowClobber -Scope AllUsers"

.devcontainer/devcontainer.json

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/dotnet
31
{
4-
"name": "reliable-web-app-pattern-dotnet",
2+
"name": "web-app-pattern-dotnet",
53
"build": {
64
"dockerfile": "Dockerfile",
75
"args": {
8-
"VARIANT": "6.0-bullseye"
9-
}
6+
"VARIANT": "8.0-bookworm"
7+
}
108
},
119
"runArgs": ["--init", "--privileged"],
1210

1311
"customizations": {
1412
"vscode": {
1513
"extensions": [
16-
"ms-dotnettools.csharp",
17-
"ms-azuretools.vscode-bicep",
14+
"ms-azuretools.azure-dev",
1815
"ms-azuretools.vscode-azureappservice",
16+
"ms-azuretools.vscode-azureresourcegroups",
17+
"ms-azuretools.vscode-azurestorage",
18+
"ms-azuretools.vscode-bicep",
1919
"ms-azuretools.vscode-docker",
20-
"ms-azuretools.azure-dev",
20+
"ms-dotnettools.csharp",
2121
"ms-mssql.mssql",
22-
"github.copilot"
22+
"ms-vscode.azure-account",
23+
"ms-vscode.PowerShell"
2324
]
2425
}
2526
},
26-
27-
"remoteUser": "vscode",
2827
"features": {
28+
"ghcr.io/azure/azure-dev/azd:latest": {
29+
"version": "1.5.1"
30+
},
31+
"ghcr.io/devcontainers/features/azure-cli:1": {},
2932
"ghcr.io/devcontainers/features/common-utils:2": {},
33+
"ghcr.io/devcontainers/features/github-cli:1": {},
3034
"ghcr.io/devcontainers/features/powershell:1": {},
31-
"ghcr.io/devcontainers/features/azure-cli:1": {},
32-
"ghcr.io/devcontainers/features/common-utils:1": {},
33-
"ghcr.io/devcontainers/features/sshd:1": {
34-
"version": "latest"
35-
}
35+
"ghcr.io/devcontainers/features/sshd:1": {}
3636
},
37-
38-
"waitFor": "postCreateCommand",
39-
"postCreateCommand": "curl -fsSL https://aka.ms/install-azd.sh | bash",
40-
"postStartCommand": "az bicep install; azd config set auth.useAzCliAuth true"
41-
}
37+
// resolves error: dubious ownership of the workspace folder
38+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}"
39+
}

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+
*.sh text eol=lf

.github/workflows/azure-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
container:
15-
image: mcr.microsoft.com/azure-dev-cli-apps:latest
15+
image: mcr.microsoft.com/azure-dev-cli-apps:1.5.0
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v2

.github/workflows/scheduled-azure-dev.yml

Lines changed: 43 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,33 @@ permissions:
1313
id-token: write
1414
contents: read
1515

16+
concurrency: integration_testing
17+
1618
jobs:
1719
build:
1820
runs-on: ubuntu-latest
1921
container:
20-
image: mcr.microsoft.com/azure-dev-cli-apps:1.3.0
22+
image: mcr.microsoft.com/azure-dev-cli-apps:1.5.1
2123
env:
2224
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
2325
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
24-
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
2526
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
26-
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}scheduled
27-
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION2 }}
2827
steps:
28+
- name: Install jq tool
29+
uses: dcarbone/install-jq-action@v2
2930
- name: Checkout
30-
uses: actions/checkout@v2
31+
uses: actions/checkout@v4
32+
- uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: '8.0.x'
35+
36+
- name: Install Az module
37+
run: Install-Module -Name Az -Force -AllowClobber -Scope CurrentUser -Repository PSGallery
38+
shell: pwsh
39+
40+
- name: Check configuration
41+
if: ${{ env.AZURE_CREDENTIALS == '' }}
42+
run: echo "AZURE_CREDENTIALS are not available."
3143

3244
# login to run ado commands such provision, deploy, and down
3345
- name: Log in with Azure (Client Credentials) for AZD
@@ -44,74 +56,39 @@ jobs:
4456
env:
4557
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
4658

47-
- name: Create AZD environment
48-
# Creating an azd environment so we can set the principal type
49-
# https://github.com/Azure/reliable-web-app-pattern-dotnet/issues/241
50-
run: azd env new ${{ secrets.AZURE_ENV_NAME }}scheduled --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} --location ${{ secrets.AZURE_LOCATION2 }}
59+
# login to run azd hooks and the QA validation script
60+
- name: Log in with Azure CLI
61+
if: ${{ env.AZURE_CREDENTIALS != '' }}
62+
uses: Azure/[email protected]
63+
with:
64+
creds: ${{ secrets.AZURE_CREDENTIALS }}
65+
enable-AzPSSession: true
5166

52-
- name: Set AZD PRINCIPAL_TYPE
53-
# Adding RBAC permissions via the script enables the sample to work around a permission propagation issue outlined in the issue
54-
# https://github.com/Azure/reliable-web-app-pattern-dotnet/issues/138
55-
run: azd env set PRINCIPAL_TYPE servicePrincipal
67+
- name: Set the environment
68+
if: ${{ env.AZURE_CREDENTIALS != '' }}
69+
run : azd env new ${{ secrets.AZURE_ENV_NAME }}
5670

57-
- name: Azure Dev Provision
58-
run: azd provision --no-prompt
71+
- name: Set the subscription
72+
if: ${{ env.AZURE_CREDENTIALS != '' }}
73+
run : azd env set AZURE_SUBSCRIPTION_ID ${{ secrets.AZURE_SUBSCRIPTION_ID }}
5974

60-
- name: Set AZD AZURE_RESOURCE_GROUP
61-
# temporary work around for known issue with multiple resource groups
62-
# https://github.com/Azure/azure-dev/issues/690
63-
run: azd env set AZURE_RESOURCE_GROUP ${{ secrets.AZURE_ENV_NAME }}scheduled-rg
75+
- name: Set the location
76+
if: ${{ env.AZURE_CREDENTIALS != '' }}
77+
run : azd env set AZURE_LOCATION ${{ secrets.AZURE_LOCATION }}
6478

65-
- name: Azure Dev Deploy
66-
run: azd deploy --no-prompt
79+
- name: Set the principal type
80+
if: ${{ env.AZURE_CREDENTIALS != '' }}
81+
run : azd env set AZURE_PRINCIPAL_TYPE ServicePrincipal
6782

68-
# login to run az cli commands such as validateDeployment.sh
69-
- name: Log in with Azure CLI
70-
uses: azure/login@v1
71-
with:
72-
creds: ${{ secrets.AZURE_CREDENTIALS }}
83+
- name: Azure Deploy
84+
if: ${{ env.AZURE_CREDENTIALS != '' }}
85+
run : azd up
7386

7487
- name: QA - Validate Deployment
75-
run: |
76-
chmod +x ./infra/devOpsScripts/validateDeployment.sh
77-
./infra/devOpsScripts/validateDeployment.sh -g ${{ secrets.AZURE_ENV_NAME }}scheduled-rg
78-
79-
teardown:
80-
needs: [build]
81-
runs-on: ubuntu-latest
82-
container:
83-
image: mcr.microsoft.com/azure-dev-cli-apps:1.3.0
84-
env:
85-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
86-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
87-
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
88-
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
89-
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}scheduled
90-
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION2 }}
91-
steps:
92-
- name: Checkout
93-
uses: actions/checkout@v2
94-
95-
# login to run ado commands such provision, deploy, and down
96-
- name: Log in with Azure (Client Credentials) for AZD
9788
if: ${{ env.AZURE_CREDENTIALS != '' }}
98-
run: |
99-
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;
100-
Write-Host "::add-mask::$($info.clientSecret)"
89+
run : ./testscripts/call-validate-deployment.sh
10190

102-
azd login `
103-
--client-id "$($info.clientId)" `
104-
--client-secret "$($info.clientSecret)" `
105-
--tenant-id "$($info.tenantId)"
106-
shell: pwsh
107-
env:
108-
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
109-
110-
- name: Create AZD environment
111-
# Creating an azd environment so we can set the principal type
112-
# https://github.com/Azure/reliable-web-app-pattern-dotnet/issues/241
113-
run: azd env new ${{ secrets.AZURE_ENV_NAME }}scheduled --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} --location ${{ secrets.AZURE_LOCATION2 }}
114-
115-
- name: Azure Dev Down
116-
run: azd down --force --purge --no-prompt
91+
- name: Teardown Azure resources
92+
if: ${{ env.AZURE_CREDENTIALS != '' }}
93+
run : azd down --force --purge --no-prompt
11794

0 commit comments

Comments
 (0)