Skip to content

Commit 03bee0f

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/azure-docs-pr into ultBUp
2 parents d353e6f + c2d3e3a commit 03bee0f

File tree

3 files changed

+46
-26
lines changed

3 files changed

+46
-26
lines changed

articles/azure-app-configuration/howto-labels-aspnet-core.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
---
22
title: Use per-environment configuration
33
titleSuffix: Azure App Configuration
4-
description: Use labels to provide per-environment configuration values
4+
description: Use labels to provide per-environment configuration values.
55
ms.service: azure-app-configuration
66
author: lisaguthrie
77
ms.topic: conceptual
88
ms.date: 3/12/2020
99
ms.author: lcozzens
1010

1111
---
12-
# Use labels to enable different configurations for different environments
12+
# Use labels to enable configurations for different environments
1313

14-
Many applications need to use different configurations for different environments. Suppose that an application has a configuration value that defines the connection string to use for its back-end database. The application's developers use a different database from the one used in production. The database connection string used by the application must change as the application moves from development to production.
14+
Many applications need to use different configurations for different environments. Suppose that an application has a configuration value that defines the connection string to use for its back-end database. The application developers use a different database from the one used in production. The database connection string that the application uses must change as the application moves from development to production.
1515

16-
In Azure App Configuration, you can use *labels* to define different values for the same key. For example, you can define a single key with different values for *Development* and *Production*. You can specify which label(s) to load when connecting to App Configuration.
16+
In Azure App Configuration, you can use *labels* to define different values for the same key. For example, you can define a single key with different values for development and production. You can specify which label to load when connecting to App Configuration.
1717

18-
To demonstrate this functionality, we'll modify the web app created in [Quickstart: Create an ASP.NET Core app with Azure App Configuration](./quickstart-aspnet-core-app.md) to use different configuration settings for development vs. production. Please complete the quickstart before proceeding.
18+
To demonstrate this functionality, you'll modify the web app created in [Quickstart: Create an ASP.NET Core app with Azure App Configuration](./quickstart-aspnet-core-app.md) to use different configuration settings for development versus production. Complete the quickstart before proceeding.
1919

2020
## Specify a label when adding a configuration value
2121

22-
In the Azure portal, go into **Configuration Explorer** and locate the *TestApp:Settings:FontColor* key that you created in the quickstart. Select its context menu and then click **Add Value**.
22+
In the Azure portal, go to **Configuration Explorer** and find the *TestApp:Settings:FontColor* key that you created in the quickstart. Select its context menu and then select **Add Value**.
2323

2424
> [!div class="mx-imgBorder"]
2525
> ![Add Value menu item](media/labels-add-value.png)
2626
2727
On the **Add Value** screen, enter a **Value** of **red** and a **Label** of **Development**. Leave **Content type** empty. Select **Apply**.
2828

29-
## Loading configuration values with a specified label
29+
## Load configuration values with a specified label
3030

31-
By default, Azure App Configuration only loads configuration values with no label. If you've defined labels for your configuration values, you'll want to specify the label(s) to use when connecting to App Configuration.
31+
By default, Azure App Configuration only loads configuration values with no label. If you've defined labels for your configuration values, you'll want to specify the labels to use when connecting to App Configuration.
3232

33-
In the last section, you created a different configuration value for the *Development* environment. You use the `HostingEnvironment.EnvironmentName` variable to dynamically determine which environment the app is currently running in. To learn more, see [Use multiple environments in ASP.NET Core](/aspnet/core/fundamentals/environments).
33+
In the previous section, you created a different configuration value for the development environment. You use the `HostingEnvironment.EnvironmentName` variable to dynamically determine which environment the app currently runs in. To learn more, see [Use multiple environments in ASP.NET Core](/aspnet/core/fundamentals/environments).
3434

3535
Load configuration values with the label corresponding to the current environment by passing the environment name into the `Select` method:
3636

@@ -54,13 +54,13 @@ Load configuration values with the label corresponding to the current environmen
5454
```
5555

5656
> [!IMPORTANT]
57-
> The above code snippet loads the App Configuration connection string from an environment variable called `AppConfigConnectionString`. Be sure that this environment variable is set properly.
57+
> The preceding code snippet loads the App Configuration connection string from an environment variable named `AppConfigConnectionString`. Be sure that this environment variable is set properly.
5858
59-
The `Select` method is called twice. The first time, it loads configuration values with no label. Then, it loads configuration values with the label corresponding to the current environment. These environment-specific values override any corresponding values with no label. You do not need to define environment-specific values for every key. If a key does not have a value with a label corresponding to the current environment, then the value with no label is used.
59+
The `Select` method is called twice. The first time, it loads configuration values with no label. Then, it loads configuration values with the label corresponding to the current environment. These environment-specific values override any corresponding values with no label. You don't need to define environment-specific values for every key. If a key doesn't have a value with a label corresponding to the current environment, it uses the value with no label.
6060

61-
## Testing in different environments
61+
## Test in different environments
6262

63-
To test the different configuration values, open the `launchSettings.json` file under the `Properties` directory. Locate the `config` entry under `profiles`. In the `environmentVariables` section, set the `ASPNETCORE_ENVIRONMENT` variable to `Production`.
63+
Open the `launchSettings.json` file under the `Properties` directory. Find the `config` entry under `profiles`. In the `environmentVariables` section, set the `ASPNETCORE_ENVIRONMENT` variable to `Production`.
6464

6565
With the new values set, build and run your application.
6666

@@ -69,11 +69,13 @@ dotnet build
6969
dotnet run
7070
```
7171

72-
Use a web browser to navigate to `http://localhost:5000`. You'll notice that the font color is black.
72+
Use a web browser to go to `http://localhost:5000`. You'll notice that the font color is black.
7373

7474
![Web application running with production configuration](media/labels-website-prod.png)
7575

76-
Now update `launchSettings.json` to set the `ASPNETCORE_ENVIRONMENT` variable to `Development`. Run `dotnet run` again. You'll notice that the font color is now red. This is because the application now uses the value of `TestApp:Settings:FontColor` that has the `Development` label. All other configuration values remain the same as their production values.
76+
Update `launchSettings.json` to set the `ASPNETCORE_ENVIRONMENT` variable to `Development`. Run `dotnet run` again.
77+
78+
You'll notice that the font color is now red. This is because the application now uses the value of `TestApp:Settings:FontColor` that has the `Development` label. All other configuration values remain the same as their production values.
7779

7880
![Web application running with development configuration](media/labels-website-dev.png)
7981

articles/lab-services/classroom-labs/how-to-attach-detach-shared-image-gallery.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,23 @@ ms.workload: na
1212
ms.tgt_pltfrm: na
1313
ms.devlang: na
1414
ms.topic: article
15-
ms.date: 02/24/2020
15+
ms.date: 05/08/2020
1616
ms.author: spelluru
1717

1818
---
1919
# Attach or detach a shared image gallery in Azure Lab Services
20-
Teachers/lab admin can save a template VM image in an Azure [shared image gallery](../../virtual-machines/windows/shared-image-galleries.md) for it to be reused by others. As a first step, the lab admin attaches an existing shared image gallery to the lab account. Once the shared image gallery is attached, labs created in the lab account can save images to the shared image gallery. Other teachers can select this image from the shared image gallery to create a template for their classes.
20+
This article shows you how to attach or detach a shared image gallery to a lab account.
2121

22-
When an image is saved to a shared image gallery, Azure Lab Services replicates the saved image to other regions available in the same [geography](https://azure.microsoft.com/global-infrastructure/geographies/). It ensures that the image is available for labs created in other regions in the same geography. Saving images to a shared image gallery incurs an additional cost, which includes cost for all replicated images. This cost is separate from the Azure Lab Services usage cost. For more information about Shared Image Gallery pricing, see [Shared Image Gallery – Billing]( https://docs.microsoft.com/azure/virtual-machines/windows/shared-image-galleries#billing).
22+
## Scenarios
23+
Here are the couple of scenarios supported by this feature:
2324

24-
This article shows you how to attach or detach a shared image gallery to a lab account.
25+
- A lab account admin attaches a shared image gallery to the lab account, and uploads an image to the shared image gallery outside the context of a lab. Then, lab creators can use that image from the shared image gallery to create labs.
26+
- A lab account admin attaches a shared image gallery to the lab account. A lab creator (instructor) saves the customized image of his/her lab to the shared image gallery. Then, other lab creators can select this image from the shared image gallery to create a template for their labs.
27+
28+
When an image is saved to a shared image gallery, Azure Lab Services replicates the saved image to other regions available in the same [geography](https://azure.microsoft.com/global-infrastructure/geographies/). It ensures that the image is available for labs created in other regions in the same geography. Saving images to a shared image gallery incurs an additional cost, which includes cost for all replicated images. This cost is separate from the Azure Lab Services usage cost. For more information about Shared Image Gallery pricing, see [Shared Image Gallery – Billing]( https://docs.microsoft.com/azure/virtual-machines/windows/shared-image-galleries#billing).
2529

26-
> [!NOTE]
27-
> Currently, Azure Lab Services supports creation of template VMs based on only **generalized** VM images (not specialized images) in a shared image gallery.
30+
> [!NOTE]
31+
> Azure Lab Services supports creation of template VMs based on both **generalized** and **specialized** images in a shared image gallery.
2832
2933

3034
## Configure at the time of lab account creation

articles/lab-services/classroom-labs/how-to-use-shared-image-gallery.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@ ms.workload: na
1212
ms.tgt_pltfrm: na
1313
ms.devlang: na
1414
ms.topic: article
15-
ms.date: 02/24/2020
15+
ms.date: 05/08/2020
1616
ms.author: spelluru
1717

1818
---
1919
# Use a shared image gallery in Azure Lab Services
20-
This article shows how teachers/lab admin can save a template virtual machine image for it to be reused by others. These images are saved in an Azure [shared image gallery](../../virtual-machines/windows/shared-image-galleries.md). As a first step, the lab admin attaches an existing shared image gallery to the lab account. Once the shared image gallery is attached, labs created in the lab account can save images to the shared image gallery. Other teachers can select this image from the shared image gallery to create a template for their classes.
20+
This article shows how teachers/lab admin can save a template virtual machine image to a [shared image gallery](../../virtual-machines/windows/shared-image-galleries.md) so that it can be used by others to create labs.
21+
22+
## Scenarios
23+
Here are the couple of scenarios supported by this feature:
24+
25+
- A lab account admin attaches a shared image gallery to the lab account, and uploads an image to the shared image gallery outside the context of a lab. Then, lab creators can use that image from the shared image gallery to create labs.
26+
- A lab account admin attaches a shared image gallery to the lab account. A lab creator (instructor) saves the customized image of his/her lab to the shared image gallery. Then, other lab creators can select this image from the shared image gallery to create a template for their labs.
27+
28+
When an image is saved to a shared image gallery, Azure Lab Services replicates the saved image to other regions available in the same [geography](https://azure.microsoft.com/global-infrastructure/geographies/). It ensures that the image is available for labs created in other regions in the same geography. Saving images to a shared image gallery incurs an additional cost, which includes cost for all replicated images. This cost is separate from the Azure Lab Services usage cost. For more information about Shared Image Gallery pricing, see [Shared Image Gallery – Billing]( https://docs.microsoft.com/azure/virtual-machines/windows/shared-image-galleries#billing).
29+
30+
> [!NOTE]
31+
> Azure Lab Services supports creation of template VMs based on both **generalized** and **specialized** images in a shared image gallery.
2132
22-
> [!NOTE]
23-
> Currently, Azure Lab Services supports creation of template VMs based on only **generalized** VM images (not specialized images) in a shared image gallery.
2433

2534
## Prerequisites
2635
- Create a shared image gallery by using either [Azure PowerShell](../../virtual-machines/windows/shared-images.md) or [Azure CLI](../../virtual-machines/linux/shared-images.md).
@@ -43,7 +52,12 @@ After a shared image gallery is attached, a lab account admin or a teacher can s
4352

4453
![Export completed](../media/how-to-use-shared-image-gallery/exporting-image-completed.png)
4554

46-
You can also upload an image to the shared image gallery outside the context of a lab. For more information, see [Shared image gallery overview](../../virtual-machines/windows/shared-images.md).
55+
> [!NOTE]
56+
> After you save the image to the shared image gallery, you can use that image from the gallery when creating another lab.
57+
>
58+
> You can also upload an image to the shared image gallery outside the context of a lab. For more information, see [Shared image gallery overview](../../virtual-machines/windows/shared-images.md).
59+
60+
4761

4862
## Use an image from the shared image gallery
4963
A teacher/professor can pick a custom image available in the shared image gallery for the template during new lab creation.

0 commit comments

Comments
 (0)