Skip to content

Commit 0309d5a

Browse files
authored
A few more fixes
1 parent fe4172f commit 0309d5a

File tree

1 file changed

+51
-51
lines changed

1 file changed

+51
-51
lines changed

articles/azure-functions/functions-infrastructure-as-code.md

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,47 +1670,7 @@ resource functionApp 'Microsoft.Web/sites@2022-03-01' = {
16701670

16711671
---
16721672

1673-
::: zone-end
1674-
## Function access keys
1675-
1676-
Host-level [function access keys](function-keys-how-to.md) are defined as Azure resources. This means that you can create and manage host keys in your ARM templates and Bicep files. A host key is defined as a resource of type `Microsoft.Web/sites/host/functionKeys`. This example creates a host-level access key named `my_custom_key` when the function app is created:
1677-
1678-
### [Bicep](#tab/bicep)
1679-
1680-
```bicep
1681-
resource functionKey 'Microsoft.Web/sites/host/functionKeys@2022-09-01' = {
1682-
name: '${parameters('name')}/default/my_custom_key'
1683-
properties: {
1684-
name: 'my_custom_key'
1685-
}
1686-
dependsOn: [
1687-
resourceId('Microsoft.Web/Sites', parameters('name'))
1688-
]
1689-
}
1690-
```
1691-
1692-
### [ARM template](#tab/json)
1693-
1694-
```json
1695-
{
1696-
"type": "Microsoft.Web/sites/host/functionKeys",
1697-
"apiVersion": "2022-09-01",
1698-
"name": "[concat(parameters('name'), '/default/my_custom_key')]",
1699-
"properties": {
1700-
"name": "my_custom_key"
1701-
},
1702-
"dependsOn": [
1703-
"[resourceId('Microsoft.Web/Sites', parameters('name'))]"
1704-
]
1705-
}
1706-
```
1707-
1708-
---
1709-
1710-
In this example, the `name` parameter is the name of the new function app. You must include a `dependsOn` setting to guarantee that the key is created with the new function app. Finally, the `properties` object of the host key can also include a `value` property that can be used to set a specific key.
1711-
1712-
When you don't set the `value` property, Functions automatically generates a new key for you when the resource is created, which is recommended. To learn more about access keys, including security best practices for working with access keys, see [Work with access keys in Azure Functions](function-keys-how-to.md).
1713-
1673+
::: zone-end
17141674
:::zone pivot="flex-consumption-plan"
17151675
## Application configuration
17161676

@@ -1735,7 +1695,7 @@ The Flex Consumption plan also supports these application settings:
17351695

17361696
+ Connection string-based settings:
17371697
+ [`APPLICATIONINSIGHTS_CONNECTION_STRING`](functions-app-settings.md#applicationinsights_connection_string)
1738-
+ [`AzureWebJobsStorage`](functions-app-settings.md#azurewebjobsstorage) (connection string)
1698+
+ [`AzureWebJobsStorage`](functions-app-settings.md#azurewebjobsstorage)
17391699
+ Managed identity-based settings:
17401700
+ [`APPLICATIONINSIGHTS_AUTHENTICATION_STRING`](functions-app-settings.md#applicationinsights_authentication_string)
17411701
+ [`AzureWebJobsStorage__accountName`](functions-app-settings.md#azurewebjobsstorage__accountname)
@@ -1938,6 +1898,46 @@ You might also need to use these settings when your function app has network res
19381898

19391899
When you're restricting access to the storage account through the private endpoints, you aren't able to access the storage account through the portal or any device outside the virtual network. You can give access to your secured IP address or virtual network in the storage account by [Managing the default network access rule](../storage/common/storage-network-security.md#change-the-default-network-access-rule).
19401900
::: zone-end
1901+
## Function access keys
1902+
1903+
Host-level [function access keys](function-keys-how-to.md) are defined as Azure resources. This means that you can create and manage host keys in your ARM templates and Bicep files. A host key is defined as a resource of type `Microsoft.Web/sites/host/functionKeys`. This example creates a host-level access key named `my_custom_key` when the function app is created:
1904+
1905+
### [Bicep](#tab/bicep)
1906+
1907+
```bicep
1908+
resource functionKey 'Microsoft.Web/sites/host/functionKeys@2022-09-01' = {
1909+
name: '${parameters('name')}/default/my_custom_key'
1910+
properties: {
1911+
name: 'my_custom_key'
1912+
}
1913+
dependsOn: [
1914+
resourceId('Microsoft.Web/Sites', parameters('name'))
1915+
]
1916+
}
1917+
```
1918+
1919+
### [ARM template](#tab/json)
1920+
1921+
```json
1922+
{
1923+
"type": "Microsoft.Web/sites/host/functionKeys",
1924+
"apiVersion": "2022-09-01",
1925+
"name": "[concat(parameters('name'), '/default/my_custom_key')]",
1926+
"properties": {
1927+
"name": "my_custom_key"
1928+
},
1929+
"dependsOn": [
1930+
"[resourceId('Microsoft.Web/Sites', parameters('name'))]"
1931+
]
1932+
}
1933+
```
1934+
1935+
---
1936+
1937+
In this example, the `name` parameter is the name of the new function app. You must include a `dependsOn` setting to guarantee that the key is created with the new function app. Finally, the `properties` object of the host key can also include a `value` property that can be used to set a specific key.
1938+
1939+
When you don't set the `value` property, Functions automatically generates a new key for you when the resource is created, which is recommended. To learn more about access keys, including security best practices for working with access keys, see [Work with access keys in Azure Functions](function-keys-how-to.md).
1940+
19411941
## Create your template
19421942

19431943
Experts with Bicep or ARM templates can manually code their deployments using a simple text editor. For the rest of us, there are several ways to make the development process easier:
@@ -2000,17 +2000,17 @@ You can also create a test resource group to find [preflight](../azure-resource-
20002000

20012001
You can use any of the following ways to deploy your Bicep file and template:
20022002

2003+
### [Bicep](#tab/bicep)
2004+
2005+
- [Azure CLI](../azure-resource-manager/bicep/deploy-cli.md)
2006+
- [PowerShell](../azure-resource-manager/bicep/deploy-powershell.md)
2007+
20032008
### [ARM template](#tab/json)
20042009

20052010
- [Azure portal](../azure-resource-manager/templates/deploy-portal.md)
20062011
- [Azure CLI](../azure-resource-manager/templates/deploy-cli.md)
20072012
- [PowerShell](../azure-resource-manager/templates/deploy-powershell.md)
20082013

2009-
### [Bicep](#tab/bicep)
2010-
2011-
- [Azure CLI](../azure-resource-manager/bicep/deploy-cli.md)
2012-
- [PowerShell](../azure-resource-manager/bicep/deploy-powershell.md)
2013-
20142014
---
20152015

20162016
### Deploy to Azure button
@@ -2036,7 +2036,7 @@ Here's an example that uses HTML:
20362036

20372037
The following PowerShell commands create a resource group and deploy a Bicep file or ARM template that creates a function app with its required resources. To run locally, you must have [Azure PowerShell](/powershell/azure/install-azure-powershell) installed. Run [`Connect-AzAccount`](/powershell/module/az.accounts/connect-azaccount) to sign in.
20382038

2039-
#### [ARM template](#tab/json)
2039+
#### [Bicep](#tab/bicep)
20402040

20412041
```powershell
20422042
# Register Resource Providers if they're not already registered
@@ -2047,10 +2047,10 @@ Register-AzResourceProvider -ProviderNamespace "microsoft.storage"
20472047
New-AzResourceGroup -Name "MyResourceGroup" -Location 'West Europe'
20482048
20492049
# Deploy the template
2050-
New-AzResourceGroupDeployment -ResourceGroupName "MyResourceGroup" -TemplateFile azuredeploy.json -Verbose
2050+
New-AzResourceGroupDeployment -ResourceGroupName "MyResourceGroup" -TemplateFile main.bicep -Verbose
20512051
```
20522052

2053-
#### [Bicep](#tab/bicep)
2053+
#### [ARM template](#tab/json)
20542054

20552055
```powershell
20562056
# Register Resource Providers if they're not already registered
@@ -2061,7 +2061,7 @@ Register-AzResourceProvider -ProviderNamespace "microsoft.storage"
20612061
New-AzResourceGroup -Name "MyResourceGroup" -Location 'West Europe'
20622062
20632063
# Deploy the template
2064-
New-AzResourceGroupDeployment -ResourceGroupName "MyResourceGroup" -TemplateFile main.bicep -Verbose
2064+
New-AzResourceGroupDeployment -ResourceGroupName "MyResourceGroup" -TemplateFile azuredeploy.json -Verbose
20652065
```
20662066

20672067
---

0 commit comments

Comments
 (0)