This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ======================================================================= | |
// MSTest Test Example To Ignore A Test | |
// ======================================================================= | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using Prime.Services; | |
namespace Prime.UnitTests.Services | |
{ | |
[TestClass] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Run all tests where the fully qualified test name contains the word "Repository" | |
dotnet test --filter FullyQualifiedName~Repository | |
## Run all tests where the fully qualified test name does not contain the word "Business" | |
dotnet test --filter FullyQualifiedName!~Business | |
## Run all tests where | |
## the fully qualified test name does not contain the word "Business" | |
## OR DisplayName is equal to "SomeTest" | |
dotnet test --filter FullyQualifiedName!~Business|DisplayName=SomeTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## NPM Install - App Configuration Client Library | |
npm install @azure/app-configuration | |
## PowerShell Script to Set Environment Variable | |
$Env:AZURE_APP_CONFIG_CONNECTION_STRING = "{app-config-store-connection-string}" | |
## Command Line (Windows) to set Environment Variable | |
setx AZURE_APP_CONFIG_CONNECTION_STRING "{app-config-store-connection-string}" | |
## MacOS - Set Environment Variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------------------------------------------------ | |
// To Make a new directory | |
// md javascript-demo | |
// ------------------------------------------------------------------ | |
// Create a new file: javascript-demo.js | |
// contents of that file are: | |
async function run() { | |
let retrievedSetting = await client.getConfigurationSetting({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Route("api/[controller]")] | |
[ApiController] | |
public class SettingsController : ControllerBase | |
{ | |
private readonly IConfiguration _configuration; | |
public SettingsController(IConfiguration configuration) | |
{ | |
this._configuration = configuration; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Configuration.AzureAppConfiguration; | |
using TestApi.Configurations; | |
public static void Main(string[] args) | |
{ | |
var builder = WebApplication.CreateBuilder(args); | |
Console.WriteLine($"Environment: {builder.Environment.EnvironmentName}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Export the key-value pairs from App Configuration to JSON file using Connection String | |
az appconfig kv export --destination file | |
--format json | |
--path "./exported-settings.json" | |
--separator : | |
--connection-string "{app-config-connection-string}" | |
## Export the key-value pairs from App Configuration to JSON file using app config store name | |
az appconfig kv export --destination file | |
--format json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Import JSON content as key value pairs using connection string of app config store | |
az appconfig kv import -s file --format json --path "./settings.json" | |
--content-type "application/json" | |
--separator : | |
--depth 2 | |
--connection-string "{app-config-connection-string}" | |
## Import JSON content as key value pairs using app confit store name | |
az appconfig kv import -s file --format json --path "./settings.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Settings": { | |
"BackgroundColor": "Green", | |
"BlockedUsers": null, | |
"FontSize": 24, | |
"Logging": {"Test":{"Level":"Debug"},"Prod":{"Level":"Warning"}}, | |
"ReleaseDate": "2020-08-04T12:34:56.789Z", | |
"RolloutPercentage": [25,50,75,100], | |
"UseDefaultRouting": false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.FeatureManagement; | |
using Microsoft.FeatureManagement.FeatureFilters; | |
static async Task Main(string[] args) | |
{ | |
var connectionString = Environment.GetEnvironmentVariable("ConnectionString"); | |
IConfigurationRoot configuration = | |
new ConfigurationBuilder() |