Skip to content

Instantly share code, notes, and snippets.

@kevinhillinger
Last active June 2, 2021 15:09
Show Gist options
  • Save kevinhillinger/ce5560ceb86910a83e2fe3bbf2eee8fb to your computer and use it in GitHub Desktop.
Save kevinhillinger/ce5560ceb86910a83e2fe3bbf2eee8fb to your computer and use it in GitHub Desktop.
Azure App Services v2 - How to update authsettings

Update authsettings - App Services v2

Justification: Can't use Azure resource editor to update additionalLoginParams on an app service that was migrated to auth version 2.

The azure resource explorer doesn't let you update v2 settings even though it's available.

How

Launch an instance of Azure Cloud Shell and execute the commands in the commands.sh file.

equivalent additionalLoginParams:

  "azureActiveDirectory": {
    "enabled": true,
    "isAutoProvisioned": true,
    "login": {
      "disableWWWAuthenticate": false,
      "loginParameters": [
        "resource=<clientId from the velow registration block>"
      ]
    }, ...

References

AuthSettings v2 Schema

(https://docs.microsoft.com/en-us/azure/app-service/scenario-secure-app-access-microsoft-graph-as-user?tabs=command-line)

authsettingsv2_list_url="https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<group_name>/providers/Microsoft.Web/sites/<site_name>/config/authsettingsv2/list?api-version=2020-09-01"
authsettingsv2_url="https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<group_name>/providers/Microsoft.Web/sites/<site_name>/config/authsettingsv2?api-version=2020-09-01"
az rest --method GET --url $authsettings_list_url > authsettingsv2_list_url.json
// modify json
az rest --method PUT --url authsettingsv2_url --body @./authsettingsv2.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment