Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

Allow unsecure transport in Aspire

Feedback

In this article

The AppHost will crash if anapplicationUrl is configured with an unsecure transport (non-TLShttp) protocol.

Warning

This is a security feature to prevent accidental exposure of sensitive data. However, there are scenarios where you might need to allow unsecure transport.

This article explains how to allow unsecure transport in Aspire projects.

Symptoms

When you run an Aspire project with anapplicationUrl configured with an unsecure transport protocol, you might see the following error message:

The 'applicationUrl' setting must be an https address unless the'ASPIRE_ALLOW_UNSECURED_TRANSPORT' environment variable is set to true.This configuration is commonly set in the launch profile.

How to allow unsecure transport

To allow an unsecure transport in Aspire, set theASPIRE_ALLOW_UNSECURED_TRANSPORT environment variable totrue. This environment variable is used to control the behavior of the AppHost when anapplicationUrl is configured with an insecure transport protocol:

export ASPIRE_ALLOW_UNSECURED_TRANSPORT=true

Alternatively, you can control this via the launch profile as it exposes the ability to configure environment variables per profile. To do this, consider the following example settings in thelaunchSettings.json file:

{  "$schema": "http://json.schemastore.org/launchsettings.json",  "profiles": {    "https": {      "commandName": "Project",      "dotnetRunMessages": true,      "launchBrowser": true,      "applicationUrl": "https://localhost:15015;http://localhost:15016",      "environmentVariables": {        "ASPNETCORE_ENVIRONMENT": "Development",        "DOTNET_ENVIRONMENT": "Development",        "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:16099",        "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:17037"      }    },    "http": {      "commandName": "Project",      "dotnetRunMessages": true,      "launchBrowser": true,      "applicationUrl": "http://localhost:15016",      "environmentVariables": {        "ASPNETCORE_ENVIRONMENT": "Development",        "DOTNET_ENVIRONMENT": "Development",        "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16099",        "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:17038",        "ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true"      }    }  }}

The preceding example shows two profiles,https andhttp. Thehttps profile is configured with a secure transport protocol, while thehttp profile is configured with an insecure transport protocol. TheASPIRE_ALLOW_UNSECURED_TRANSPORT environment variable is set totrue in thehttp profile to allow unsecure transport.

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?