Notes on working setting up environment variables and launch settings in your project.
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.
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.
Name | Required | Description | Default |
---|---|---|---|
ProfileName | No | The name of the profile that is added into your launchsettings.json to run this environment. | Development |
AuthSettings | No | The settings for your auth server, if using one. | None |
BrokerSettings | No | The settings for the message broker, if you are adding one. | None |
Name | Required | Description | Default |
---|---|---|---|
Authority | Yes | The authority url for the auth server. | None |
Audience | Yes | The 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 |
AuthorizationUrl | Yes | The url to the authentication server to authenticate yourself and get an authorization code or access token. | None |
TokenUrl | Yes | The url to the authentication server to refresh your access token. | None |
ClientId | Yes | The client id of the client as configured on your authorization server. | None |
ClientSecret | Yes | The client secret known only to your application and authorization server. | None |
Name | Required | Description | Default |
---|---|---|---|
Host | Yes | The host for the broker connection | localhost |
VirtualHost | Yes | The virtual host of the broker. This provides a way to segregate applications using the same RabbitMQ instance. | / |
Username | Yes | The username for the broker connection | guest |
Password | Yes | The password for the broker connection | guest |
BrokerPort | Yes | The port used for the RMQ message broker | Random Free Port |
UiPort | Yes | The port used for the RMQ management ui | Random Free Port |
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