Skip to content

Instantly share code, notes, and snippets.

@astaykov
Last active August 26, 2022 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astaykov/17667554524de59f5f8eaca90cb4a2a5 to your computer and use it in GitHub Desktop.
Save astaykov/17667554524de59f5f8eaca90cb4a2a5 to your computer and use it in GitHub Desktop.
Update all web apps to TLS 1.2
#!/usr/bin/env bash
# first disable HTTP and force HTTPS only
az webapp list --query "[].id" --output tsv | az webapp update --https-only true --ids @-
# then force min-tls version
az webapp list --query "[].id" --output tsv | az webapp config set --min-tls-version '1.2' --ids @-
# then force FTPS in general.
# depending on your process, you might want to enforce FTPS (FtpsOnly) insted of completely disable it (Disabled).
az webapp list --query "[].id" --output tsv | az webapp config set --ftps-state FtpsOnly --ids @-
# configure app setting.
# for all apps in a RG.
az webapp list -g rg-name --query "[].id" --output tsv | az webapp config appsettings set --settings AzureAdB2C__Domain="tenant_id" --ids @-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment