Skip to content

Commit

Permalink
Rwa version 1.1 (#369)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
6 people authored Apr 10, 2024
1 parent 737ddf4 commit 4d3a08c
Show file tree
Hide file tree
Showing 383 changed files with 19,568 additions and 6,494 deletions.
30 changes: 10 additions & 20 deletions .azdo/pipelines/README.md → .azdo/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
# Azure DevOps Pipeline Configuration

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.
This document will help you create an Azure DevOps pipeline that uses the Azure Developer CLI to deploy this sample.

## Other considerations
Your devOps process should be customized to automate the build, test, and deployment steps specific to your business needs.
We recommend these following considerations to expand on the `azure-dev.yml` sample.
> 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.
- You may want to review `scheduled-azure-dev.yml` to see how to add more steps such as validation testing
- You may want multiple workflows defined in different files for different purposes
- Consider database lifecycle management
- Consider quality testing processes (e.g. integration testing)

## Setting up Azure DevOps Pipelines
The following content show you how to configure an Azure DevOps pipeline that uses the Azure Developer CLI.

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.
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.

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

> 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.
> 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.
## Getting Started
The following steps are required to get started.
Expand All @@ -43,34 +33,34 @@ The following steps walk-through creating the Azure Pipeline.

1. Start by navigating to the Azure DevOps Pipeline page

![#Azure DevOps Pipeline Page](../../assets/AzdoSetup/1CreateAPipeline.png)
![#Azure DevOps Pipeline Page](../assets/images/AzdoSetup/1CreateAPipeline.png)

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

2. Click the `New pipeline` button

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

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

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

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


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

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

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

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

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

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

![#Set Pipeline variables](../../assets/AzdoSetup/5CreateAPipeline.png)
![#Set Pipeline variables](../assets/images/AzdoSetup/5CreateAPipeline.png)

<sup>Set Pipeline variables</sup>

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

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

> 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.
> 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.
2 changes: 1 addition & 1 deletion .azdo/pipelines/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trigger:
pool:
vmImage: ubuntu-latest

container: mcr.microsoft.com/azure-dev-cli-apps:latest
container: mcr.microsoft.com/azure-dev-cli-apps:1.5.0
variables:
- name: env_name
value: $(AZD_AZURE_ENV_NAME)daily
Expand Down
6 changes: 5 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
ARG VARIANT
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:${VARIANT}

# Install Az module
RUN pwsh -Command "Install-Module -Name Az -Force -AllowClobber -Scope AllUsers"
RUN pwsh -Command "Install-Module -Name SqlServer -Force -AllowClobber -Scope AllUsers"
40 changes: 19 additions & 21 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/dotnet
{
"name": "reliable-web-app-pattern-dotnet",
"name": "web-app-pattern-dotnet",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "6.0-bullseye"
}
"VARIANT": "8.0-bookworm"
}
},
"runArgs": ["--init", "--privileged"],

"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csharp",
"ms-azuretools.vscode-bicep",
"ms-azuretools.azure-dev",
"ms-azuretools.vscode-azureappservice",
"ms-azuretools.vscode-azureresourcegroups",
"ms-azuretools.vscode-azurestorage",
"ms-azuretools.vscode-bicep",
"ms-azuretools.vscode-docker",
"ms-azuretools.azure-dev",
"ms-dotnettools.csharp",
"ms-mssql.mssql",
"github.copilot"
"ms-vscode.azure-account",
"ms-vscode.PowerShell"
]
}
},

"remoteUser": "vscode",
"features": {
"ghcr.io/azure/azure-dev/azd:latest": {
"version": "1.5.1"
},
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/powershell:1": {},
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/devcontainers/features/common-utils:1": {},
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
}
"ghcr.io/devcontainers/features/sshd:1": {}
},

"waitFor": "postCreateCommand",
"postCreateCommand": "curl -fsSL https://aka.ms/install-azd.sh | bash",
"postStartCommand": "az bicep install; azd config set auth.useAzCliAuth true"
}
// resolves error: dubious ownership of the workspace folder
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}"
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.sh text eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/azure-dev-cli-apps:latest
image: mcr.microsoft.com/azure-dev-cli-apps:1.5.0
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
109 changes: 43 additions & 66 deletions .github/workflows/scheduled-azure-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,33 @@ permissions:
id-token: write
contents: read

concurrency: integration_testing

jobs:
build:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/azure-dev-cli-apps:1.3.0
image: mcr.microsoft.com/azure-dev-cli-apps:1.5.1
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}scheduled
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION2 }}
steps:
- name: Install jq tool
uses: dcarbone/install-jq-action@v2
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Install Az module
run: Install-Module -Name Az -Force -AllowClobber -Scope CurrentUser -Repository PSGallery
shell: pwsh

- name: Check configuration
if: ${{ env.AZURE_CREDENTIALS == '' }}
run: echo "AZURE_CREDENTIALS are not available."

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

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

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

- name: Azure Dev Provision
run: azd provision --no-prompt
- name: Set the subscription
if: ${{ env.AZURE_CREDENTIALS != '' }}
run : azd env set AZURE_SUBSCRIPTION_ID ${{ secrets.AZURE_SUBSCRIPTION_ID }}

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

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

# login to run az cli commands such as validateDeployment.sh
- name: Log in with Azure CLI
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Azure Deploy
if: ${{ env.AZURE_CREDENTIALS != '' }}
run : azd up

- name: QA - Validate Deployment
run: |
chmod +x ./infra/devOpsScripts/validateDeployment.sh
./infra/devOpsScripts/validateDeployment.sh -g ${{ secrets.AZURE_ENV_NAME }}scheduled-rg
teardown:
needs: [build]
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/azure-dev-cli-apps:1.3.0
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}scheduled
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION2 }}
steps:
- name: Checkout
uses: actions/checkout@v2

# login to run ado commands such provision, deploy, and down
- name: Log in with Azure (Client Credentials) for AZD
if: ${{ env.AZURE_CREDENTIALS != '' }}
run: |
$info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable;
Write-Host "::add-mask::$($info.clientSecret)"
run : ./testscripts/call-validate-deployment.sh

azd login `
--client-id "$($info.clientId)" `
--client-secret "$($info.clientSecret)" `
--tenant-id "$($info.tenantId)"
shell: pwsh
env:
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}

- name: Create AZD environment
# Creating an azd environment so we can set the principal type
# https://github.com/Azure/reliable-web-app-pattern-dotnet/issues/241
run: azd env new ${{ secrets.AZURE_ENV_NAME }}scheduled --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} --location ${{ secrets.AZURE_LOCATION2 }}

- name: Azure Dev Down
run: azd down --force --purge --no-prompt
- name: Teardown Azure resources
if: ${{ env.AZURE_CREDENTIALS != '' }}
run : azd down --force --purge --no-prompt

Loading

0 comments on commit 4d3a08c

Please sign in to comment.