Skip to content

Latest commit

 

History

History
108 lines (78 loc) · 3.95 KB

developer-experience.md

File metadata and controls

108 lines (78 loc) · 3.95 KB

Developer Experience

The dev team uses Visual Studio and they integrate directly with Azure resources when building the code. The team chooses this workflow to so they can integration test with Azure before their code reaches the QA team.

NOTE

This developer experience is only supported for development deployments. Production deployments use network isolation and do not allow devs to connect from their workstation.

Most configurations in the project are stored in Azure App Configuration with secrets saved into Azure Key Vault. To connect to these resources from a developer workstation you need to complete the following steps.

  1. Set up front-end web app configuration
  2. Set up back-end web app configuration

To support this workflow the following steps will store data in User Secrets because the code is configured so that these values override configurations and secrets saved in Azure.

Note that secrets.json file is stored relative to the tooling that supports them. Use the Windows Terminal to execute the following commands instead of the Dev Container if you want to use Visual Studio to launch the project. Read How the Secret Manager tool works to learn more.

Authenticate with Azure

  1. If you are not using PowerShell 7+, run the following command (you can use $PSVersionTable.PSVersion to check your version):

    pwsh
  2. Connect to Azure

    Import-Module Az.Resources
    Connect-AzAccount
  3. Set the subscription to the one you want to use (you can use Get-AzSubscription to list available subscriptions):

    $AZURE_SUBSCRIPTION_ID="<your-subscription-id>"
    Set-AzContext -SubscriptionId $AZURE_SUBSCRIPTION_ID

1. Set up front-end web app configuration

  1. Get the Azure App Configuration URI

    $appConfigurationUri = ((azd env get-values --output json | ConvertFrom-Json).APP_CONFIG_SERVICE_URI)
  2. Switch to the front-end web app directory

    cd src/Relecloud.Web.CallCenter
  3. Clear any existing user secrets

    dotnet user-secrets clear
  4. Set the Relecloud API base URI

    dotnet user-secrets set "App:RelecloudApi:BaseUri" "https://localhost:7242"
  5. Set the Azure App Configuration URI

    dotnet user-secrets set "App:AppConfig:Uri" $appConfigurationUri
  6. Switch back to the root of the repository

    cd ../..

2. Set up back-end web app configuration

```pwsh
cd src/Relecloud.Web.CallCenter.Api
```

```pwsh
dotnet user-secrets clear
```

```pwsh
dotnet user-secrets set "App:AppConfig:Uri" $appConfigurationUri
```

3. Launch the project with Visual Studio

  1. Open the project in Visual Studio

  2. Configure the solution to start both the front-end and back-end web apps

    1. Right-click the Relecloud solution and pick Set Startup Projects...

    2. Choose Multiple startup projects

    3. Change the dropdowns for Relecloud.Web.CallCenter and Relecloud.Web.CallCenter.Api to the action of Start.

    4. Click Ok to close the popup

      screenshot of Visual Studio solution startup configuration

  3. Run the project (F5)

  4. Open the browser and navigate to https://localhost:7227/

    screenshot of web app home page

Next steps

You can learn more about the web app by reading the Pattern Simulations documentation.