GithubHelp home page GithubHelp logo

scottaddie / ondotnetconfiguration Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 8.0 276 KB

A sample ASP.NET Core 5.0 Blazor Server app to accompany the On .NET episodes

License: MIT License

HTML 38.84% C# 46.69% CSS 14.47%
aspnetcore dotnet azure-app-service azure-key-vault azure-signalr-service azure-app-configuration azure-identity

ondotnetconfiguration's Introduction

OnDotNetConfiguration

A sample ASP.NET Core 5.0 Blazor Server app to accompany Secretless apps with .NET and Azure Key Vault.

Prerequisites

Setup

Local development machine

Before running the project on your machine, store the API key using one of the following approaches:

  • If using Visual Studio, right-click the BlazorServerConfiguration project in Solution Explorer and select Manage User Secrets. Add the following snippet to the secrets.json file, replacing <API_KEY> with your API key. Save the file.

     {
     	"StockOptions": {
     	"ApiKey": "<API_KEY>"
     	}
     }
  • If not using Visual Studio, replace <API_KEY> in the following command with your API key. Run the command from the directory containing the BlazorServerConfiguration.csproj file.

     dotnet user-secrets set "StockOptions:ApiKey" "<API_KEY>"

Azure resources

To run the project in Azure, complete the following steps:

  1. Deploy the app to Azure App Service.

  2. Provision an Azure SignalR Service instance with a Service Mode of Default.

  3. Provision an Azure Key Vault instance.

  4. In the Key Vault instance, navigate to Settings > Secrets. Create the following secrets by selecting Generate/Import.

    Name Value
    Azure--SignalR--ConnectionString The primary or secondary SignalR Service connection string found at Settings > Keys. For example, Endpoint=https://blazorserverconfigsignalr.service.signalr.net;AccessKey=<ACCESS_KEY>;Version=1.0;.
    StockOptions--ApiKey The API key obtained from RapidAPI.
  5. Apply the following changes in App Service:

    1. In Settings > Identity, enable a System-assigned managed identity via the Status toggle button.
    2. In Settings > Configuration > General settings:
      1. In the Stack settings section:
        1. Select .NET from the Stack drop-down list.
        2. Select .NET 5 from the .NET version drop-down list.
      2. In the Platform settings section, select On for the Web sockets and ARR affinity radio buttons.
    3. In Settings > Configuration > Application settings, select New application setting. Create a new environment variable named KEYVAULT_ENDPOINT whose value is the Key Vault resource's URI (e.g., https://blazorserverconfigvault.vault.azure.net/).

Related resources

ondotnetconfiguration's People

Contributors

scottaddie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ondotnetconfiguration's Issues

Azure.Extensions.AspNetCore.Configuration.Secrets

Running the sample in Azure found that when requesting stock quote that I was getting an error. From debugging I was thinking it might be related to the referenced meta: Azure.Extensions.AspNetCore.Configuration.Secrets not containing the change of the "--" to ":" referenced in the On.NET Ch 9 Secretless Apps YouTube video.

So in public static class ConfigurationBuilderExtensions class line 20 :config.AddAzureKeyVault(secretClient, new KeyVaultSecretManager()); method the needed conversion is not occurring? Maybe I am off base with my issue but I don't see the same meta code that you referenced in the video.

Any help or advise you can provide is appreciated. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.