-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
app_service
- add authv2 to functionapps and functionapp slots
#20722
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spotted a few error texts, but otherwise LGTM 🪕
@@ -316,6 +319,11 @@ func (d WindowsFunctionAppDataSource) Read() sdk.ResourceFunc { | |||
return fmt.Errorf("reading Auth Settings for Windows %s: %+v", id, err) | |||
} | |||
|
|||
authV2, err := client.GetAuthSettingsV2(ctx, id.ResourceGroup, id.SiteName) | |||
if err != nil { | |||
return fmt.Errorf("reading authV2 settings for Linux %s: %+v", id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("reading authV2 settings for Linux %s: %+v", id, err) | |
return fmt.Errorf("reading authV2 settings for Windows %s: %+v", id, err) |
authv2 := helpers.ExpandAuthV2Settings(functionApp.AuthV2Settings) | ||
if authv2.SiteAuthSettingsV2Properties != nil { | ||
if _, err = client.UpdateAuthSettingsV2(ctx, id.ResourceGroup, id.SiteName, *authv2); err != nil { | ||
return fmt.Errorf("updating AuthV2 settings for Linux %s: %+v", id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("updating AuthV2 settings for Linux %s: %+v", id, err) | |
return fmt.Errorf("updating AuthV2 settings for Windows %s: %+v", id, err) |
if strings.EqualFold(pointer.From(auth.ConfigVersion), "v2") { | ||
authV2, err = client.GetAuthSettingsV2(ctx, id.ResourceGroup, id.SiteName) | ||
if err != nil { | ||
return fmt.Errorf("reading authV2 settings for Linux %s: %+v", *id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("reading authV2 settings for Linux %s: %+v", *id, err) | |
return fmt.Errorf("reading authV2 settings for Windows %s: %+v", *id, err) |
if _, err := client.UpdateAuthSettings(ctx, id.ResourceGroup, id.SiteName, *authUpdate); err != nil { | ||
return fmt.Errorf("updating Auth Settings for Windows %s: %+v", id, err) | ||
return fmt.Errorf("updating Auth Settings for Linux %s: %+v", id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("updating Auth Settings for Linux %s: %+v", id, err) | |
return fmt.Errorf("updating Auth Settings for Windows %s: %+v", id, err) |
if metadata.ResourceData.HasChange("auth_settings_v2") { | ||
authV2Update := helpers.ExpandAuthV2Settings(state.AuthV2Settings) | ||
if _, err := client.UpdateAuthSettingsV2(ctx, id.ResourceGroup, id.SiteName, *authV2Update); err != nil { | ||
return fmt.Errorf("updating AuthV2 Settings for Linux %s: %+v", id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("updating AuthV2 Settings for Linux %s: %+v", id, err) | |
return fmt.Errorf("updating AuthV2 Settings for Windows %s: %+v", id, err) |
authv2 := helpers.ExpandAuthV2Settings(functionAppSlot.AuthV2Settings) | ||
if authv2.SiteAuthSettingsV2Properties != nil { | ||
if _, err = client.UpdateAuthSettingsV2Slot(ctx, id.ResourceGroup, id.SiteName, *authv2, id.SlotName); err != nil { | ||
return fmt.Errorf("updating AuthV2 settings for Linux %s: %+v", id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("updating AuthV2 settings for Linux %s: %+v", id, err) | |
return fmt.Errorf("updating AuthV2 settings for Windows %s: %+v", id, err) |
if strings.EqualFold(pointer.From(auth.ConfigVersion), "v2") { | ||
authV2, err = client.GetAuthSettingsV2Slot(ctx, id.ResourceGroup, id.SiteName, id.SlotName) | ||
if err != nil { | ||
return fmt.Errorf("reading authV2 settings for Linux %s: %+v", *id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("reading authV2 settings for Linux %s: %+v", *id, err) | |
return fmt.Errorf("reading authV2 settings for Windows %s: %+v", *id, err) |
if _, err := client.UpdateAuthSettingsSlot(ctx, id.ResourceGroup, id.SiteName, *authUpdate, id.SlotName); err != nil { | ||
return fmt.Errorf("updating Auth Settings for Windows %s: %+v", id, err) | ||
return fmt.Errorf("updating Auth Settings for Linux %s: %+v", id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("updating Auth Settings for Linux %s: %+v", id, err) | |
return fmt.Errorf("updating Auth Settings for Windows %s: %+v", id, err) |
if metadata.ResourceData.HasChange("auth_settings_v2") { | ||
authV2Update := helpers.ExpandAuthV2Settings(state.AuthV2Settings) | ||
if _, err := client.UpdateAuthSettingsV2Slot(ctx, id.ResourceGroup, id.SiteName, *authV2Update, id.SlotName); err != nil { | ||
return fmt.Errorf("updating AuthV2 Settings for Linux %s: %+v", id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("updating AuthV2 Settings for Linux %s: %+v", id, err) | |
return fmt.Errorf("updating AuthV2 Settings for Windows %s: %+v", id, err) |
This functionality has been released in v3.46.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
azurerm_linux_function_app
- add support for AuthV2 (EasyAuthV2)auth_settings_v2
azurerm_linux_function_app_slot
- add support for AuthV2 (EasyAuthV2)auth_settings_v2
azurerm_windows_function_app
- add support for AuthV2 (EasyAuthV2)auth_settings_v2
azurerm_windows_function_app_slot
- add support for AuthV2 (EasyAuthV2)auth_settings_v2
azurerm_linux_function_app
- add support for AuthV2 (EasyAuthV2)auth_settings_v2
azurerm_windows_function_app
- add support for AuthV2 (EasyAuthV2)auth_settings_v2