I use the REST API to create resources (WebApp + MySQL) using a template. It is working fine. Now I want to change the hostnames and add them, but I just get the Bad Request response (400).
The URL I'm linking to is:
"https://management.azure.com/subscriptions/<subscriptionId>/resourcegroups/<myResourceGroup>/providers/Microsoft.Web/sites/<instanceName>?api-version=2015-08-01"
I am doing PUT and sending the next JSON object.
{ "properties": { "HostNames":"instanceName.azurewebsites.net, newHostName.com" } }
My JSON may be wrong, but I have tried many formats and nobody is working. I also tried referring to another url:
"https://management.azure.com/subscriptions/<subscriptionId>/resourcegroups/<myResourceGroup>/providers/Microsoft.Web/sites/<instanceName>/config/web?api-version=2015-08-01"
And the answer is fine (200), but then I check the resource using powershell and the HostNames property has not changed.
I also tried to install HostNames with my template during deployment, but by default, Azure does not allow adding custom host names.
Has anyone come across this before?
json c # api azure azure-resource-manager
AAlferez
source share