I am attempting to consume the Azure REST API to Create a new Web App as documented here.
I am using an Authorization
= Bearer xxxx
token created with the Scope and Resource of https://management.azure.com/
.
The Registered App has the Microsoft Graph Api permission Sites.Manage.All
and Application.ReadWrite.All
.
I am doing a PUT to https://management.azure.com/subscriptions/{subID}/resourceGroups/{resGrp}/providers/Microsoft.Web/sites/{newName}?api-version=2016-08-01
I am specifying a content type of application/json
with the following body:
{
"location":"Central US",
"properties":
{
"cloningInfo":
{
"sourceWebAppId":"subscriptions/{subID}/resourceGroups/{resGrp}/providers/Microsoft.Web/sites/{cloneFromName}",
"overwrite":true,
"ignoreQuotas":true,
"correlationId":"some random text??"
}
}
}
I have also tried this similar body
{
"location":"Central US",
"properties.cloningInfo":
{
"sourceWebAppId":"subscriptions/{subID}/resourceGroups/{resGrp}/providers/Microsoft.Web/sites/{cloneFromName}",
"overwrite":true,
"ignoreQuotas":true,
"correlationId":"some random text??"
}
}
I am able to successfully call List Sites specified at this documentation.
I assume I either have the wrong Api Permissions, or I am missing some required information in the body.