Hello @Shunlei Tang
Yes, you are on the right track. The Microsoft.Web/sites/config
resource type is the correct one to use for configuring Easy Auth for your Azure Function App. Here is an example of how to declare the Easy Auth configuration in Bicep:
resource appServiceConfig 'Microsoft.Web/sites/config@2021-02-01' = {
name: '${functionAppName}/authsettings'
properties: {
enabled: true
unauthenticatedClientAction: 'RedirectToLoginPage'
tokenStoreEnabled: true
defaultProvider: 'AzureActiveDirectory'
clientId: ''
issuer: 'https://sts.windows.net//'
allowedAudiences: [ '' ]
isAadAutoProvisioned: false
googleClientId: ''
googleClientSecret: ''
googleOAuthScopes: ''
facebookAppId: ''
facebookAppSecret: ''
facebookOAuthScopes: ''
twitterConsumerKey: ''
twitterConsumerSecret: ''
microsoftAccountClientId: ''
microsoftAccountClientSecret: ''
microsoftAccountOAuthScopes: ''
customOpenIdConnectProviderId: ''
openIdIssuer: ''
openIdClientId: ''
openIdClientSecret: ''
openIdWellKnownConfiguration: ''
tokenRefreshExtensionHours: 72
tokenExpirationMinutes: 1440
cookieExpirationMinutes: 1440
allowedExternalRedirectUrls: []
additionalLoginParams: ''
isAuthFixed: false
httpApiPrefixPath: ''
useAppServiceStorage: false
tokenRefreshExtensionPercentage: 0
tokenStore: 'Web'
googleOAuth2Issuer: ''
googleOAuth2ClientId: ''
googleOAuth2ClientSecret: ''
googleOAuth2Scopes: ''
googleOAuth2AuthorizationEndpoint: ''
googleOAuth2TokenEndpoint: ''
googleOAuth2UserInfoEndpoint: ''
googleOAuth2ClaimsMapping: ''
googleOAuth2AllowedAudiences: []
googleOAuth2IsUserIdCaseSensitive: false
googleOAuth2IsIdTokenNonceRequired: false
googleOAuth2IsAccessTokenNonceRequired: false
googleOAuth2IsTokenEndpointAuthenticationRequired: false
googleOAuth2TokenEndpointAuthenticationMethod: ''
googleOAuth2IsRefreshTokenSupported: false
}
}
This should help you get started
I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.