Last active
September 30, 2020 09:13
Star
You must be signed in to star a gist
3 Ways Mapping APEX Domains to Azure Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$resourceGroupName = "<RESOURCE_GROUP_NAME>" | |
$functionAppName = "<FUNCTION_APP_NAME>" | |
$domainName = "contoso.com" | |
Set-AzWebApp ` | |
-ResourceGroupName $resourceGroupName ` | |
-Name $functionAppName ` | |
-HostNames @( $domainName, "$functionAppName.azurewebsites.net" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az functionapp config hostname add \ | |
-g <RESOURCE_GROUP_NAME> \ | |
-n <FUNCTIONAPP_NAME> \ | |
--hostname "contoso.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"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