Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
3 Ways Mapping APEX Domains to Azure Functions
$resourceGroupName = "<RESOURCE_GROUP_NAME>"
$functionAppName = "<FUNCTION_APP_NAME>"
$domainName = "contoso.com"
Set-AzWebApp `
-ResourceGroupName $resourceGroupName `
-Name $functionAppName `
-HostNames @( $domainName, "$functionAppName.azurewebsites.net" )
az functionapp config hostname add \
-g <RESOURCE_GROUP_NAME> \
-n <FUNCTIONAPP_NAME> \
--hostname "contoso.com"
resource fncapp 'Microsoft.Web/sites@2020-06-01' = {
name: functionApp.name
...
}
resource fncappHostname 'Microsoft.Web/sites/hostNameBindings@2020-06-01' = {
name: '${fncapp.name}/contoso.com'
location: fncapp.location
}
{
...
"resources": [
...
{
"type": "Microsoft.Web/sites/hostNameBindings",
"apiVersion": "2020-06-01",
"name": "[format('{0}/{1}', variables('functionApp').name, 'contoso.com')]",
"location": "[variables('functionApp').location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('functionApp').name)]"
]
},
...
]
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment