Environment Settings

Notes on working setting up environment variables and launch settings in your project.

Background

Wrapt projects use environment variables to configure their behavior. These are set in the launch settings profile that is used when running your project and makes it easy to deploy your project and pass it values for that new environment.

Environment Properties

These are the properties for working locally on your machine and will be adding to your launch settings file. When working in other environments, you will need to set these properties in that new environment as well.

NameRequiredDescriptionDefault
ProfileNameNoThe name of the profile that is added into your launchsettings.json to run this environment.Development
AuthSettingsNoThe settings for your auth server, if using one.None
BrokerSettingsNoThe settings for the message broker, if you are adding one.None

Auth Settings

NameRequiredDescriptionDefault
AuthorityYesThe authority url for the auth server.None
AudienceYesThe unique id of the audience for an issued token (Identified in a JWT aud claim). In this case, this is usually going to be the identifier given to your API on your Authorization Server.None
AuthorizationUrlYesThe url to the authentication server to authenticate yourself and get an authorization code or access token.None
TokenUrlYesThe url to the authentication server to refresh your access token.None
ClientIdYesThe client id of the client as configured on your authorization server.None
ClientSecretYesThe client secret known only to your application and authorization server.None

Broker Settings

NameRequiredDescriptionDefault
HostYesThe host for the broker connectionlocalhost
VirtualHostYesThe virtual host of the broker. This provides a way to segregate applications using the same RabbitMQ instance./
UsernameYesThe username for the broker connectionguest
PasswordYesThe password for the broker connectionguest
BrokerPortYesThe port used for the RMQ message brokerRandom Free Port
UiPortYesThe port used for the RMQ management uiRandom Free Port

Example with Auth and Broker Settings

In this example, we are not adding any new environments, but adding auth and broker info for Development (our local, in memory project).

Environment:
  AuthSettings:
    Authority: https://localhost:3385
    Audience: recipe_management
    AuthorizationUrl: https://localhost:3385/connect/authorize
    TokenUrl: https://localhost:3385/connect/token
    ClientId: recipe_management.swagger
    ClientSecret: 974d6f71-d41b-4601-9a7a-a33081f80687
  BrokerSettings:
    Host: localhost
    VirtualHost: /
    Username: guest
    Password: guest