Skip to content

Commit 1a7e6d1

Browse files
committed
Rename import to extension
1 parent b8ff74c commit 1a7e6d1

File tree

4 files changed

+63
-44
lines changed

4 files changed

+63
-44
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Use extensions in Bicep
3+
description: This article describes how to use Bicep extensions.
4+
ms.topic: conceptual
5+
ms.custom: devx-track-bicep
6+
ms.date: 12/06/2024
7+
---
8+
9+
# Use Bicep extensions
10+
11+
This article describes how to use Bicep extensions.
12+
13+
> [!NOTE]
14+
> The experimental feature `extensibility` must be enabled from the [Bicep config file](./bicep-config.md#enable-experimental-features) to use this feature.
15+
16+
The syntax for importing Bicep extensions is:
17+
18+
```bicep
19+
extionsion '<extension-name>'
20+
```
21+
22+
The syntax for importing Bicep extensions, which require configuration is:
23+
24+
```bicep
25+
extension '<extension-name>' with {
26+
<extension-properties>
27+
}
28+
```
29+
30+
For examples, see [Bicep Kubernetes extension](./bicep-kubernetes-extension.md) and [Microsoft Graph extension](https://aka.ms/graphbicep).
31+
32+
## Related content
33+
34+
- To learn about Bicep data types, see [Data types](./data-types.md).
35+
- To learn about Bicep functions, see [Bicep functions](./bicep-functions.md).
36+
- To learn how to use the Bicep Kubernetes extension, see [Bicep Kubernetes extension](./bicep-kubernetes-extension.md).
37+
- To go through a Kubernetes extension tutorial, see [Quickstart: Deploy Azure applications to Azure Kubernetes Services by using the Bicep Kubernetes extension](/azure/aks/learn/quick-kubernetes-deploy-bicep-kubernetes-extension).
38+
- To learn Microsoft Graph extension, see [Microsoft Graph extension](https://aka.ms/graphbicep).

articles/azure-resource-manager/bicep/bicep-import.md

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ title: Imports in Bicep
33
description: This article describes how to import shared functionality and namespaces in Bicep.
44
ms.topic: conceptual
55
ms.custom: devx-track-bicep
6-
ms.date: 10/23/2024
6+
ms.date: 12/06/2024
77
---
88

99
# Imports in Bicep
1010

11-
This article describes the syntax you use to export and import shared functionality and namespaces for Bicep extensions. Using compile-time imports automatically enables [language version 2.0](../templates/syntax.md#languageversion-20) code generation.
11+
This article describes the syntax you use to export and import shared functionality and namespaces. Using compile-time imports automatically enables [language version 2.0](../templates/syntax.md#languageversion-20) code generation.
1212

1313
## Export variables, types, and functions
1414

@@ -80,10 +80,7 @@ output greeting string = sayHello('Bicep user')
8080
output exampleObject myImports.myObjectType = exampleObject
8181
```
8282

83-
## Import namespaces and extensions (preview)
84-
85-
> [!NOTE]
86-
> The experimental feature `extensibility` must be enabled from the [Bicep config file](./bicep-config.md#enable-experimental-features) to use this feature.
83+
## Import namespaces
8784

8885
The syntax for importing namespaces is:
8986

@@ -94,25 +91,7 @@ import '[email protected]'
9491

9592
Both `az` and `sys` are Bicep built-in namespaces. They're imported by default. For more information about the data types and the functions defined in `az` and `sys`, see [Data types](./data-types.md) and [Bicep functions](./bicep-functions.md).
9693

97-
The syntax for importing Bicep extensions is:
98-
99-
```bicep
100-
import '<extension-name>@<extension-version>'
101-
```
102-
103-
The syntax for importing Bicep extensions, which require configuration is:
104-
105-
```bicep
106-
import '<extension-name>@<extension-version>' with {
107-
<extension-properties>
108-
}
109-
```
110-
111-
For an example, see [Bicep Kubernetes extension](./bicep-kubernetes-extension.md).
112-
11394
## Related content
11495

11596
- To learn about Bicep data types, see [Data types](./data-types.md).
11697
- To learn about Bicep functions, see [Bicep functions](./bicep-functions.md).
117-
- To learn how to use the Bicep Kubernetes extension, see [Bicep Kubernetes extension](./bicep-kubernetes-extension.md).
118-
- To go through a Kubernetes extension tutorial, see [Quickstart: Deploy Azure applications to Azure Kubernetes Services by using the Bicep Kubernetes extension](/azure/aks/learn/quick-kubernetes-deploy-bicep-kubernetes-extension).

articles/azure-resource-manager/bicep/bicep-kubernetes-extension.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ This preview feature can be enabled by configuring the [bicepconfig.json](./bice
4141
## Import Kubernetes extension
4242

4343
To safely pass secrets for the Kubernetes deployment, you must invoke the Kubernetes code with a Bicep module and pass the parameter as a secret.
44-
To import the Kubernetes extension, use the [import statement](./bicep-import.md). After importing the extension, you can refactor the Bicep module file as usual, such as by using variables, parameters, and output. By contract, the Kubernetes manifest in YML doesn't include any programmability support.
44+
To import the Kubernetes extension, use the [extension statement](./bicep-extension.md). After importing the extension, you can refactor the Bicep module file as usual, such as by using variables, parameters, and output. By contract, the Kubernetes manifest in YML doesn't include any programmability support.
4545

4646
The following sample imports the Kubernetes extension:
4747

4848
```bicep
4949
@secure()
5050
param kubeConfig string
5151
52-
import 'kubernetes@1.0.0' with {
52+
extension 'kubernetes' with {
5353
namespace: 'default'
5454
kubeConfig: kubeConfig
5555
} as k8s
@@ -61,7 +61,7 @@ import '[email protected]' with {
6161
The following sample shows how to pass `kubeConfig` value from a parent Bicep file:
6262

6363
```bicep
64-
resource aks 'Microsoft.ContainerService/managedClusters@2024-02-01' existing = {
64+
resource aks 'Microsoft.ContainerService/managedClusters@2024-08-01' existing = {
6565
name: 'demoAKSCluster'
6666
}
6767

articles/azure-resource-manager/bicep/toc.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -262,22 +262,31 @@
262262
- name: Data types
263263
href: data-types.md
264264
displayName: supported types,arrays,booleans,integers,objects,strings,secure,interpolation
265-
- name: User-defined data types (type)
266-
displayName: custom
267-
href: user-defined-data-types.md
268-
- name: User-defined functions (func)
269-
displayName: custom
270-
href: user-defined-functions.md
271265
- name: Parameters (param)
272266
href: parameters.md
273267
displayName: decorators,secure,objects,constraints
274268
- name: Variables (var)
275269
href: variables.md
276270
displayName: configuration
277-
- name: Import (import)
278-
href: bicep-import.md
279271
- name: Resources (resource)
280272
href: resource-declaration.md
273+
- name: Outputs (output)
274+
href: outputs.md
275+
displayName: dynamic number of outputs,modules
276+
- name: Modules (module)
277+
href: modules.md
278+
displayName: scopes,consume,registry,module registry,private module registry,public module registry,avm,azure verified modules
279+
- name: Using (using)
280+
displayName: avm,azure verified modules
281+
href: bicep-using.md
282+
- name: Import (import)
283+
href: bicep-import.md
284+
- name: User-defined data types (type)
285+
displayName: custom
286+
href: user-defined-data-types.md
287+
- name: User-defined functions (func)
288+
displayName: custom
289+
href: user-defined-functions.md
281290
- name: Existing resources (existing)
282291
href: existing-resource.md
283292
- name: Child resources (parent)
@@ -287,20 +296,13 @@
287296
href: scope-extension-resources.md
288297
- name: Dependencies (dependsOn)
289298
href: resource-dependencies.md
290-
- name: Modules (module)
291-
href: modules.md
292-
displayName: scopes,consume,registry,module registry,private module registry,public module registry,avm,azure verified modules
293-
- name: Outputs (output)
294-
href: outputs.md
295-
displayName: dynamic number of outputs,modules
296299
- name: Loops (for)
297300
href: loops.md
298301
displayName: multiple
299302
- name: Conditions (if)
300303
href: conditional-resource-deployment.md
301-
- name: Using (using)
302-
displayName: avm,azure verified modules
303-
href: bicep-using.md
304+
- name: Extension (extension)
305+
href: bicep-extension.md
304306
- name: Scopes (targetScope)
305307
items:
306308
- name: Resource group

0 commit comments

Comments
 (0)