Skip to content

Commit 55c8f2a

Browse files
authored
Merge pull request #106111 from lisaguthrie/functions-ga
Removing preview config provider version and other cleanup
2 parents ec63e1b + df890f4 commit 55c8f2a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

articles/azure-app-configuration/quickstart-azure-functions-csharp.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,15 @@ In this quickstart, you incorporate the Azure App Configuration service into an
4040

4141
## Connect to an App Configuration store
4242

43-
1. Right-click your project, and select **Manage NuGet Packages**. On the **Browse** tab, search for and add the following NuGet packages to your project. If you can't find them, select the **Include prerelease** check box.
44-
45-
```
46-
Microsoft.Extensions.Configuration.AzureAppConfiguration 3.0.0-preview-010550001-251 or later
47-
```
43+
1. Right-click your project, and select **Manage NuGet Packages**. On the **Browse** tab, search for and add the `Microsoft.Extensions.Configuration.AzureAppConfiguration` NuGet package to your project. If you can't find it, select the **Include prerelease** check box.
4844

4945
2. Open *Function1.cs*, and add the namespaces of the .NET Core configuration and the App Configuration configuration provider.
5046

5147
```csharp
5248
using Microsoft.Extensions.Configuration;
5349
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
5450
```
51+
5552
3. Add a `static` property named `Configuration` to create a singleton instance of `IConfiguration`. Then add a `static` constructor to connect to App Configuration by calling `AddAzureAppConfiguration()`. This will load configuration once at the application startup. The same configuration instance will be used for all Functions calls later.
5653

5754
```csharp
@@ -64,6 +61,7 @@ In this quickstart, you incorporate the Azure App Configuration service into an
6461
Configuration = builder.Build();
6562
}
6663
```
64+
6765
4. Update the `Run` method to read values from the configuration.
6866

6967
```csharp
@@ -74,7 +72,7 @@ In this quickstart, you incorporate the Azure App Configuration service into an
7472

7573
string keyName = "TestApp:Settings:Message";
7674
string message = Configuration[keyName];
77-
75+
7876
return message != null
7977
? (ActionResult)new OkObjectResult(message)
8078
: new BadRequestObjectResult($"Please create a key-value with the key '{keyName}' in App Configuration.");
@@ -88,14 +86,18 @@ In this quickstart, you incorporate the Azure App Configuration service into an
8886
```CLI
8987
setx ConnectionString "connection-string-of-your-app-configuration-store"
9088
```
89+
9190
If you use Windows PowerShell, run the following command:
9291

9392
```azurepowershell
9493
$Env:ConnectionString = "connection-string-of-your-app-configuration-store"
9594
```
95+
9696
If you use macOS or Linux, run the following command:
9797

98+
```bash
9899
export ConnectionString='connection-string-of-your-app-configuration-store'
100+
```
99101

100102
2. Press F5 to test your function. If prompted, accept the request from Visual Studio to download and install **Azure Functions Core (CLI)** tools. You might also need to enable a firewall exception so that the tools can handle HTTP requests.
101103

0 commit comments

Comments
 (0)