Skip to content

Commit c19b200

Browse files
committed
Merge branch 'main' into release-ignite-functions-flex-consumption-ga
2 parents f593716 + 0e096b1 commit c19b200

File tree

126 files changed

+1163
-770
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+1163
-770
lines changed

articles/api-center/build-register-apis-vscode-extension.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: API developers can use the Azure API Center extension for Visual St
44
author: dlepow
55
ms.service: azure-api-center
66
ms.topic: how-to
7-
ms.date: 10/16/2024
7+
ms.date: 11/08/2024
88
ms.author: danlep
99
ms.collection: ce-skilling-ai-copilot
1010
ms.custom:
@@ -16,7 +16,8 @@ ms.custom:
1616
API developers in your organization can build and register APIs in your [API center](overview.md) inventory by using the Azure API Center extension for Visual Studio Code. API developers can:
1717

1818
* Add an existing API to an API center as a one-time operation, or integrate a development pipeline to register APIs as part of a CI/CD workflow.
19-
* Generate OpenAPI specification files from API code using GitHub Copilot, and register the API to an API center.
19+
* Use GitHub Copilot to generate new OpenAPI specs from API code.
20+
* Use natural language prompts with the API Center plugin for GitHub Copilot for Azure to create new OpenAPI specs.
2021

2122
API developers can also take advantage of features in the extension to [discover and consume APIs](discover-apis-vscode-extension.md) in the API center and ensure [API governance](govern-apis-vscode-extension.md).
2223

@@ -27,6 +28,7 @@ The following Visual Studio Code extensions are needed for the specified scenari
2728
* [GitHub Actions](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions) - to register APIs using a CI/CD pipeline with GitHub Actions
2829
* [Azure Pipelines](https://marketplace.visualstudio.com/items?itemName=ms-azure-devops.azure-pipelines) - to register APIs using a CI/CD pipeline with Azure Pipelines
2930
* [GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) - to generate OpenAPI specification files from API code
31+
* [GitHub Copilot for Azure](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azure-github-copilot) - to generate OpenAPI specification files using the Azure API Center Plugin for GitHub Copilot for Azure
3032

3133
[!INCLUDE [vscode-extension-setup](includes/vscode-extension-setup.md)]
3234

@@ -51,9 +53,9 @@ The following steps register an API in your API center with a CI/CD pipeline. Wi
5153

5254
Learn more about setting up a [GitHub Actions workflow](register-apis-github-actions.md) to register APIs with your API center.
5355

54-
## Generate OpenAPI specification file from API code
56+
## Generate OpenAPI spec from API code
5557

56-
Use the power of GitHub Copilot with the Azure API Center extension for Visual Studio Code to create an OpenAPI specification file from your API code. Right-click on the API code, select **Copilot** from the options, and select **Generate API documentation**. GitHub Copilot creates an OpenAPI specification file.
58+
Use the power of [GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) with the Azure API Center extension for Visual Studio Code to create an OpenAPI specification file from your API code. Right-click on the API code, select **Copilot** from the options, and select **Generate API documentation**. GitHub Copilot creates an OpenAPI specification file.
5759

5860
> [!NOTE]
5961
> This feature is available in the pre-release version of the API Center extension.
@@ -62,6 +64,33 @@ Use the power of GitHub Copilot with the Azure API Center extension for Visual S
6264

6365
After generating the OpenAPI specification file and checking for accuracy, you can register the API with your API center using the **Azure API Center: Register API** command.
6466

67+
## Generate OpenAPI spec using natural language prompts
68+
69+
The API Center plugin for [GitHub Copilot for Azure](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azure-github-copilot) helps you design new APIs starting from natural language prompts. With AI assistance, quickly generate an OpenAPI spec for API development that complies with your organization's standards.
70+
71+
> [!NOTE]
72+
> This feature is available in the pre-release version of the API Center extension.
73+
74+
1. If desired, set an active API style guide. Use the **Ctrl+Shift+P** keyboard shortcut to open the Command Palette. Type **Azure API Center: Set API Style Guide**, make a selection, and hit **Enter**.
75+
76+
If no style guide is set, the default `spectral:oas` ruleset is used.
77+
1. In the chat panel, make a request in natural language to the `@azure` agent to describe what the API does. Example:
78+
79+
```vscode
80+
@azure Generate OpenAPI spec: An API that allows customers to pay for an order using various payment methods such as cash, checks, credit cards, and debit cards.
81+
```
82+
83+
The agent responds with an OpenAPI specification document.
84+
85+
:::image type="content" source="media/build-register-apis-vscode-extension/generate-api-specification.png" alt-text="Screenshot showing how to use @azure extension to generate an OpenAPI spec from a prompt.":::
86+
87+
88+
1. Review the generated output for accuracy and compliance with your API style guide. Refine the prompt if needed to regenerate.
89+
90+
> [!TIP]
91+
> Effective prompts focus on an API's business requirements rather than implementation details. Shorter prompts sometimes work better than longer ones.
92+
1. When it meets your requirements, save the generated OpenAPI specification to a file.
93+
1. Register the API with your API center. Select **Register your API in API Center** button in the chat panel, or select **Azure API Center: Register API** from the Command Palette, and follow the prompts.
6594
6695
## Related content
6796
129 KB
Loading

articles/api-management/api-management-howto-disaster-recovery-backup-restore.md

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: dlepow
77

88
ms.service: azure-api-management
99
ms.topic: how-to
10-
ms.date: 01/31/2023
10+
ms.date: 09/06/2024
1111
ms.author: danlep
1212
ms.custom: devx-track-azurepowershell
1313
---
@@ -129,6 +129,38 @@ Backup-AzApiManagement -ResourceGroupName $apiManagementResourceGroup -Name $api
129129

130130
Backup is a long-running operation that may take several minutes to complete. During this time the API gateway continues to handle requests, but the state of the service is Updating.
131131

132+
### [CLI](#tab/cli)
133+
134+
[Sign in](/cli/azure/authenticate-azure-cli) with Azure CLI.
135+
136+
In the following examples:
137+
138+
* An API Management instance named *myapim* is in resource group *apimresourcegroup*.
139+
* A storage account named *backupstorageaccount* is in resource group *storageresourcegroup*. The storage account has a container named *backups*.
140+
* A backup blob will be created with name *ContosoBackup.apimbackup*.
141+
142+
Set variables in Bash:
143+
144+
```azurecli-interactive
145+
apiManagementName="myapim";
146+
apiManagementResourceGroup="apimresourcegroup";
147+
storageAccountName="backupstorageaccount";
148+
storageResourceGroup="storageresourcegroup";
149+
containerName="backups";
150+
backupName="ContosoBackup.apimbackup";
151+
```
152+
153+
### Access using storage access key
154+
155+
```azurecli-interactive
156+
storageKey=$(az storage account keys list --resource-group $storageResourceGroup --account-name $storageAccountName --query [0].value --output tsv)
157+
158+
az apim backup --resource-group $apiManagementResourceGroup --name $apiManagementName \
159+
--storage-account-name $storageAccountName --storage-account-key $storageKey --storage-account-container $containerName --backup-name $backupName
160+
```
161+
162+
Backup is a long-running operation that may take several minutes to complete. During this time the API gateway continues to handle requests, but the state of the service is Updating.
163+
132164
### [REST](#tab/rest)
133165

134166
See [Azure REST API reference](/rest/api/azure/) for information about authenticating and calling Azure REST APIs.
@@ -261,6 +293,35 @@ Restore-AzApiManagement -ResourceGroupName $apiManagementResourceGroup -Name $ap
261293

262294
Restore is a long-running operation that may take up to 45 minutes or more to complete.
263295

296+
### [CLI](#tab/cli)
297+
298+
In the following examples,
299+
300+
* An API Management instance named *myapim* is restored from the backup blob named *ContosoBackup.apimbackup* in storage account *backupstorageaccount*.
301+
* The backup blob is in a container named *backups*.
302+
303+
Set variables in Bash:
304+
305+
```azurecli-interactive
306+
apiManagementName="myapim";
307+
apiManagementResourceGroup="apimresourcegroup";
308+
storageAccountName="backupstorageaccount";
309+
storageResourceGroup="storageresourcegroup";
310+
containerName="backups";
311+
backupName="ContosoBackup.apimbackup"
312+
```
313+
314+
### Access using storage access key
315+
316+
```azurecli-interactive
317+
storageKey=$(az storage account keys list --resource-group $storageResourceGroup --account-name $storageAccountName --query [0].value --output tsv)
318+
319+
az apim restore --resource-group $apiManagementResourceGroup --name $apiManagementName \
320+
--storage-account-name $storageAccountName --storage-account-key $storageKey --storage-account-container $containerName --backup-name $backupName
321+
```
322+
323+
Restore is a long-running operation that may take up to 45 minutes or more to complete.
324+
264325
### [REST](#tab/rest)
265326

266327
To restore an API Management service from a previously created backup, make the following HTTP request:

articles/app-service/network-secure-outbound-traffic-azure-firewall.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Outbound traffic from your app is now routed through the integrated virtual netw
9999
1. Navigate to the firewall's overview page and select its firewall policy.
100100

101101
1. In the firewall policy page, from the left navigation, select **Application Rules** > **Add a rule collection**.
102-
1. In **Rules**, add a network rule with the App Service subnet as the source address, and specify an FQDN destination. In the screenshot below, the destination FQDN is set to `api.my-ip.io`.
102+
1. In **Rules**, add a network rule with the App Service subnet as the source address, and specify an FQDN destination. In the screenshot below, the destination FQDN is set to `contoso.com`.
103103

104104
:::image type="content" source="./media/network-secure-outbound-traffic-azure-firewall/config-azfw-policy-app-rule.png" alt-text="Screenshot of configure Azure Firewall policy rule.":::
105105

@@ -113,7 +113,7 @@ Outbound traffic from your app is now routed through the integrated virtual netw
113113
An easy way to verify your configuration is to use the `curl` command from your app's SCM debug console to verify the outbound connection.
114114

115115
1. In a browser, navigate to `https://<app-name>.scm.azurewebsites.net/DebugConsole`.
116-
1. In the console, run `curl -s <protocol>://<fqdn-address>` with a URL that matches the application rule you configured, To continue example in the previous screenshot, you can use **curl -s https://api.my-ip.io/ip**. The following screenshot shows a successful response from the API, showing the public IP address of your App Service app.
116+
1. In the console, run `curl -s <protocol>://<fqdn-address>` with a URL that matches an application rule you configured. The following screenshot is an example to a website that shows a successful response from a API, showing an IP address.
117117

118118
:::image type="content" source="./media/network-secure-outbound-traffic-azure-firewall/verify-outbound-traffic-fw-allow-rule.png" alt-text="Screenshot of verifying the success outbound traffic by using curl command in SCM debug console.":::
119119

Loading
Loading
83.3 KB
Loading

articles/azure-app-configuration/TOC.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
href: quickstart-java-spring-app.md
2525
- name: Python
2626
href: quickstart-python-provider.md
27-
- name: JavaScript/Node.js
27+
- name: Node.js
2828
href: quickstart-javascript-provider.md
2929
- name: Azure Functions
3030
href: quickstart-azure-functions-csharp.md
@@ -42,8 +42,10 @@
4242
href: quickstart-feature-flag-spring-boot.md
4343
- name: Azure Functions
4444
href: quickstart-feature-flag-azure-functions-csharp.md
45-
- name: Python app
45+
- name: Python
4646
href: quickstart-feature-flag-python.md
47+
- name: Node.js
48+
href: quickstart-feature-flag-javascript.md
4749
- name: Azure Kubernetes Service
4850
href: quickstart-feature-flag-azure-kubernetes-service.md
4951
- name: Service integration
@@ -88,7 +90,7 @@
8890
href: enable-dynamic-configuration-java-spring-app.md
8991
- name: Python
9092
href: enable-dynamic-configuration-python.md
91-
- name: JavaScript
93+
- name: Node.js
9294
href: enable-dynamic-configuration-javascript.md
9395
- name: Azure Kubernetes Service
9496
href: enable-dynamic-configuration-azure-kubernetes-service.md
@@ -138,6 +140,8 @@
138140
href: howto-feature-filters.md
139141
- name: ASP.NET Core
140142
href: howto-feature-filters-aspnet-core.md
143+
- name: JavaScript
144+
href: howto-feature-filters-javascript.md
141145
- name: Python
142146
href: howto-feature-filters-python.md
143147
- name: Enable features on a schedule
@@ -146,6 +150,8 @@
146150
href: howto-timewindow-filter.md
147151
- name: ASP.NET Core
148152
href: howto-timewindow-filter-aspnet-core.md
153+
- name: JavaScipt
154+
href: howto-timewindow-filter-javascript.md
149155
- name: Roll out features to targeted audience
150156
items:
151157
- name: Overview
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: Enable conditional features with a custom filter in a Node.js application
3+
titleSuffix: Azure App Configuration
4+
description: Learn how to implement a custom feature filter to enable conditional feature flags for your Node.js application.
5+
ms.service: azure-app-configuration
6+
ms.devlang: javascript
7+
author: zhiyuanliang-ms
8+
ms.author: zhiyuanliang
9+
ms.topic: how-to
10+
ms.custom: mode-other, devx-track-js
11+
ms.date: 09/26/2024
12+
---
13+
14+
# Tutorial: Enable conditional features with a custom filter in a JavaScript application
15+
16+
Feature flags can use feature filters to enable features conditionally. To learn more about feature filters, see [Tutorial: Enable conditional features with feature filters](./howto-feature-filters.md).
17+
18+
The example used in this tutorial is based on the Node.js application introduced in the feature management [quickstart](./quickstart-feature-flag-javascript.md). Before proceeding further, complete the quickstart to create a Node.js application with a *Beta* feature flag. Once completed, you must [add a custom feature filter](./howto-feature-filters.md) to the *Beta* feature flag in your App Configuration store.
19+
20+
In this tutorial, you'll learn how to implement a custom feature filter and use the feature filter to enable features conditionally. We are using the Node.js console app as an example, but you can also use the custom feature filter in other JavaScript applications.
21+
22+
## Prerequisites
23+
24+
- Create a [console app with a feature flag](./quickstart-feature-flag-javascript.md).
25+
- [Add a custom feature filter to the feature flag](./howto-feature-filters.md)
26+
27+
## Implement a custom feature filter
28+
29+
You've added a custom feature filter named **Random** with a **Percentage** parameter for your *Beta* feature flag in the prerequisites. Next, you implement the feature filter to enable the *Beta* feature flag based on the chance defined by the **Percentage** parameter.
30+
31+
1. Open the file *app.js* and add the `RandomFilter` with the following code.
32+
33+
``` javascript
34+
class RandomFilter {
35+
name = "Random";
36+
evaluate(context) {
37+
const percentage = context.parameters.Percentage;
38+
const randomNumber = Math.random() * 100;
39+
return randomNumber <= percentage;
40+
}
41+
}
42+
```
43+
44+
You added a `RandomFilter` class that has a single method named `evaluate`, which is called whenever a feature flag is evaluated. In `evaluate`, a feature filter enables a feature flag by returning `true`.
45+
46+
You set the name to of `RandomFilter` to **Random**, which matches the filter name you set in the *Beta* feature flag in Azure App Configuration.
47+
48+
1. Register the `RandomFilter` when creating the `FeatureManager`.
49+
50+
``` javascript
51+
const fm = new FeatureManager(ffProvider, {customFilters: [new RandomFilter()]});
52+
```
53+
54+
## Feature filter in action
55+
56+
When you run the application the configuration provider will load the *Beta* feature flag from Azure App Configuration. The result of the `isEnabled("Beta")` method will be printed to the console. As the `RandomFilter` is implemented and used by the *Beta* feature flag, the result will be `True` 50 percent of the time and `False` the other 50 percent of the time.
57+
58+
Running the application will show that the *Beta* feature flag is sometimes enabled and sometimes not.
59+
60+
``` bash
61+
Beta is enabled: true
62+
Beta is enabled: false
63+
Beta is enabled: false
64+
Beta is enabled: true
65+
Beta is enabled: true
66+
Beta is enabled: false
67+
Beta is enabled: false
68+
Beta is enabled: false
69+
Beta is enabled: true
70+
Beta is enabled: true
71+
```
72+
73+
## Next steps
74+
75+
To learn more about the built-in feature filters, continue to the following tutorials.
76+
77+
> [!div class="nextstepaction"]
78+
> [Enable features on a schedule](./howto-timewindow-filter.md)
79+
80+
> [!div class="nextstepaction"]
81+
> [Roll out features to targeted audience](./howto-targetingfilter.md)

articles/azure-app-configuration/howto-feature-filters.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,15 @@ You can create custom feature filters that enable features based on your specifi
5555
> [!div class="mx-imgBorder"]
5656
> ![Screenshot of the Azure portal, applying new custom filter.](./media/feature-filters/feature-flag-edit-apply-filter.png)
5757
58-
You have successfully added a custom filter to a feature flag. Follow the instructions in the [Next Steps](#next-steps) section to implement the feature filter into your application for the language or platform you are using.
58+
You have successfully added a custom filter to a feature flag.
5959

60-
## Next steps
61-
62-
In this tutorial, you learned the concept of feature filter and added a custom feature filter to a feature flag.
63-
64-
To learn how to implement a custom feature filter, continue to the following tutorial:
60+
1. Continue to the following instructions to implement the feature filter into your application for the language or platform you are using.
6561

66-
> [!div class="nextstepaction"]
67-
> [ASP.NET Core](./howto-feature-filters-aspnet-core.md)
62+
- [ASP.NET Core](./howto-feature-filters-aspnet-core.md)
63+
- [Node.js](./howto-feature-filters-javascript.md)
64+
- [Python](./howto-feature-filters-python.md)
6865

69-
> [!div class="nextstepaction"]
70-
> [Python](./howto-feature-filters-python.md)
66+
## Next steps
7167

7268
To learn more about the built-in feature filters, continue to the following tutorials:
7369

0 commit comments

Comments
 (0)