I'm trying to bulk upload custom domains to Azure WebApps (specifically the deployment slots). I currently loop through with Azure CLI but it adds 15-20 minutes to CICD process.
I've also tried with ARM Templates but it reports a "conflict" during bulk upload. It requires a condition or dependency on the previous hostname which means it's still configuring the domains one by one.
Does anyone know of a way to bulk configure?
Powershell and Azure CLI
#Set Host Names and SSL
$WebApp_HostNames = Import-Csv "$(ConfigFiles_Path)\$WebApp-Hostnames.csv"
if ($null -ne $WebApp_HostNames) {
foreach ($HostName in $WebApp_HostNames) {
az webapp config hostname add --hostname $HostName.Name --resource-group "$(ResourceGroup)" --webapp-name "$WebApp" --slot "$WebApp$(WebApp_Slot_Suffix)"
az webapp config ssl bind --certificate-thumbprint $HostName.Thumbprint --ssl-type SNI --resource-group "$(ResourceGroup)" --name "$WebApp" --slot "$WebApp$(WebApp_Slot_Suffix)"
}
}
EDIT: Got it! Will write out the process and provide the answer here for future reference