Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add azure environments detection methods to Microsoft.Extensions.Azure #11471

Closed
pakrym opened this issue Apr 21, 2020 · 0 comments
Closed

Add azure environments detection methods to Microsoft.Extensions.Azure #11471

pakrym opened this issue Apr 21, 2020 · 0 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Extensions ASP.NET Core extensions

Comments

@pakrym
Copy link
Contributor

pakrym commented Apr 21, 2020

Something like:

public static class HostEnvironmentEnvExtensions
    {
        public static bool IsAzureWebApp(this IHostEnvironment hostEnvironment)
        {
            return !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME"));
        }
    }

To be used in the following way:

            if (WebHostEnvironment.IsAzureWebApp())
            {
                services
                    .AddDataProtection()
                    .PersistKeysToAzureBlobStorage(new Uri("https://msidataprotection.blob.core.windows.net/dataprotection/keys"), new DefaultAzureCredential());
            }
@pakrym pakrym added Client This issue points to a problem in the data-plane of the library. Extensions ASP.NET Core extensions labels Apr 21, 2020
@pakrym pakrym self-assigned this Apr 21, 2020
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-net that referenced this issue Nov 20, 2020
Managed Services Swagger Consistency Fixes (Azure#11471)

* Updated 2018-06-01-preview specs

* Updated 2019-04-01-preview specs

* Updated 2018-06-01-preview specs

* Updated 2020-02-01-preview specs

* Updated 2019-06-01 specs

* Updated 2019-09-01 specs

* Updated 2018-06-01-preview examples

* Updated ErrorResponse model

* Model validation fix

* Removed readOnly=true for ErrorResponse

* Updated type specification for error

* Removed old type reference for ErrorResponse
@pakrym pakrym closed this as completed Oct 1, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Extensions ASP.NET Core extensions
Projects
None yet
Development

No branches or pull requests

1 participant