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 Cocona; | |
using Microsoft.Playwright; | |
using PlaywightAzureAdBasicAuth; | |
var builder = CoconaApp.CreateBuilder(); | |
var app = builder.Build(); | |
app.AddCommand(async ([Argument(Description = "Username to login with")] string userName, | |
[Argument(Description = "Password to login with")] string password, | |
[Argument(Description = "The url of your application as a starting point where your login button is located")] string applicationUrl, |
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
public static IWebDriver AzureAdRedirectWithAuthDetails(this IWebDriver driver, string userName, string password, string domainToReplace) | |
{ | |
Thread.Sleep(TimeSpan.FromSeconds(5)); | |
var newUrlWithUserCredentials = driver.Url.Replace(domainToReplace, $"{WebUtility.HtmlEncode(userName)}:{password}@{domainToReplace}"); | |
driver.Navigate().GoToUrl(newUrlWithUserCredentials); | |
return driver; | |
} |
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
<policies> | |
<inbound> | |
<base /> | |
<set-backend-service base-url="https://yourapihere.com" /> | |
</inbound> | |
<backend> | |
<base /> | |
</backend> | |
<outbound> | |
<choose> |
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
<!-- | |
IMPORTANT: | |
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements. | |
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element. | |
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element. | |
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar. | |
- To remove a policy, delete the corresponding policy statement from the policy document. | |
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope. | |
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope. | |
- Policies are applied in the order of their appearance, from the top down. |
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 DbUp; | |
using Microsoft.Extensions.Configuration; | |
using System; | |
using System.Linq; | |
using System.Reflection; | |
namespace DatabaseReleaseAutomation.DbUpDemo | |
{ | |
class Program | |
{ |
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
{ | |
"ConnectionStrings": { | |
"DbUpSqlConnectionString": "Server=127.0.0.1,1589;Database=sqldb-databasereleaseautomation;User Id=sa;Password=YourPassword123;" | |
} | |
} |
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 EFCoreSeparateProject.Infrastructure; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.Design; | |
using Microsoft.Extensions.Configuration; | |
using System.IO; | |
namespace EFCoreSeparateProject.Migrations | |
{ | |
public class ExampleDbContextFactory : IDesignTimeDbContextFactory<ExampleDbContext> | |
{ |
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
{ | |
"SqlConnectionString": "Server=127.0.0.1,5433;Database=EFCoreSeparateProjectDb;User Id=sa;Password=yourStrong(!)Password;" | |
} |
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 EFCoreSeparateProject.Core.Domain; | |
using EFCoreSeparateProject.Infrastructure.EntityConfigurations; | |
using Microsoft.EntityFrameworkCore; | |
namespace EFCoreSeparateProject.Infrastructure | |
{ | |
public class ExampleDbContext : DbContext | |
{ | |
public ExampleDbContext(DbContextOptions options) : base(options) | |
{ |
NewerOlder