Ensure EntraID is identical to StaticWebApp
The goal is to ensure AppService is identical to StaticWebApp because we want to stop using StaticWebApp and start using AppService.
|
public enum EasyAuthType |
|
{ |
|
StaticWebApps, |
|
AppService |
|
} |
⚠️ None of this should be done if they are not identical.
Modify the Engine default references to StaticWebApps
These references are scattered throughout the codebase. We're shifting to AppService as the default, so wherever StaticWebApps appears in code or comments, it should be updated. We're not removing support for StaticWebApps, just removing it as the default.
Comment example:
|
/// <param name="Provider">Identity Provider. Default is StaticWebApps. |
Code example:
|
public record AuthenticationOptions(string Provider = nameof(EasyAuthType.StaticWebApps), JwtOptions? Jwt = null) |
Modify the CLI default references to StaticWebApps
This primarily applies to dab init. The goal is to ensure the CLI no longer defaults to StaticWebApps as the auth provider but to AppService. Users can still configure StaticWebApps, but they must do so manually.
Modify the JSON Schema
Update the schema to change the default value to AppService.
|
"authentication": { |
|
"type": ["object", "null"], |
|
"additionalProperties": false, |
|
"properties": { |
|
"provider": { |
|
"type": "string", |
|
"description": "The name of authentication provider", |
|
"default": "StaticWebApps" |
|
}, |
Also update the schema to restrict the provider property to only supported values (including StaticWebApps).
Modify DAB Validate
Update ValidateAuthenticationOptions to log a warning if the runtime host is set to StaticWebApps.
if (Enum.TryParse<EasyAuthType>(runtimeConfig.Runtime.Host.Authentication.Provider, ignoreCase: true, out var provider) &&
provider == EasyAuthType.StaticWebApps)
{
_logger.LogWarning("The 'StaticWebApps' authentication provider is deprecated.");
}
|
private void ValidateAuthenticationOptions(RuntimeConfig runtimeConfig) |
Modify DAB Init
Ensure dab init generates a config functionally identical to before. However, the default provider should now be AppService instead of StaticWebApps.
|
[Option("auth.provider", Default = "StaticWebApps", Required = false, HelpText = "Specify the Identity Provider.")] |
|
public string AuthenticationProvider { get; } |
Ensure
EntraIDis identical toStaticWebAppThe goal is to ensure
AppServiceis identical toStaticWebAppbecause we want to stop usingStaticWebAppand start usingAppService.data-api-builder/src/Config/ObjectModel/EasyAuthType.cs
Lines 6 to 10 in ebbe989
Modify the Engine default references to
StaticWebAppsThese references are scattered throughout the codebase. We're shifting to
AppServiceas the default, so whereverStaticWebAppsappears in code or comments, it should be updated. We're not removing support forStaticWebApps, just removing it as the default.Comment example:
data-api-builder/src/Config/ObjectModel/AuthenticationOptions.cs
Line 9 in ebbe989
Code example:
data-api-builder/src/Config/ObjectModel/AuthenticationOptions.cs
Line 14 in ebbe989
Modify the CLI default references to
StaticWebAppsThis primarily applies to
dab init. The goal is to ensure the CLI no longer defaults toStaticWebAppsas the auth provider but toAppService. Users can still configureStaticWebApps, but they must do so manually.Modify the JSON Schema
Update the schema to change the default value to
AppService.data-api-builder/schemas/dab.draft.schema.json
Lines 275 to 283 in ebbe989
Also update the schema to restrict the provider property to only supported values (including
StaticWebApps).Modify
DAB ValidateUpdate
ValidateAuthenticationOptionsto log a warning if the runtime host is set toStaticWebApps.data-api-builder/src/Core/Configurations/RuntimeConfigValidator.cs
Line 713 in ebbe989
Modify
DAB InitEnsure
dab initgenerates a config functionally identical to before. However, the default provider should now beAppServiceinstead ofStaticWebApps.data-api-builder/src/Cli/Commands/InitOptions.cs
Lines 91 to 92 in ebbe989