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
services.AddDbContextPool<IdentityDBContext>(options => | |
{ | |
options.UseSqlServer(secrets.DbConnectionString, | |
x => x.MigrationsAssembly("DataAccess") | |
.EnableRetryOnFailure(maxRetryCount: 3)) | |
.UseLazyLoadingProxies() | |
.EnableSensitiveDataLogging(CurrentEnvironment.IsDevelopment()) | |
.EnableServiceProviderCaching() | |
.UseLoggerFactory(IdentityDBContext.PropertyAppLoggerFactory); | |
}); |
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 abstract class MyBackgroundService : IHostedService, IDisposable | |
{ | |
private Task executingTask; | |
private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); | |
protected abstract Task ExecuteAsync(CancellationToken stoppingToken); | |
public virtual Task StartAsync(CancellationToken cancellationToken) | |
{ | |
executingTask = ExecuteAsync(cancellationTokenSource.Token); |
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 class KafkaHostedService : MyBackgroundService | |
{ | |
private readonly ILogger<KafkaHostedService> logger; | |
private readonly AppSettings appSettings; | |
private readonly IConfiguration configuration; | |
private readonly IServiceScopeFactory scopeFactory; | |
public KafkaHostedService( | |
ILogger<KafkaHostedService> logger, | |
AppSettings appSettings, |
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
services.AddTransient<IKafkaService>(x => | |
new KafkaService( | |
appSettings.KafkaSettings.Server, | |
appSecrets.KafkaSaslKey, | |
appSecrets.KafkaSaslSecret)); |
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 class KafkaService : IKafkaService | |
{ | |
private readonly string saslUsername; | |
private readonly string saslPassword; | |
public readonly string serverAddress; | |
public KafkaService(string serverAddress, string saslUsername, string saslPassword) | |
{ | |
this.serverAddress = serverAddress; | |
this.saslUsername = saslUsername; |
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
{ | |
"user": { | |
"accessToken": "eyJhbGciOiJodH.....PXKnzQbFZ9xkNx0", | |
"refreshToken": "CfDJ8HmkbyESYkdH......ajwoA==" | |
} | |
} |
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
{ | |
"AccessToken": "eyJhbGciOiJs.....Brev24Z1n80", | |
"RefreshToken": "CfDJ8H...TTwyjZEPpw==" | |
} |
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
{ | |
"user": { | |
"userId": "a3686...8b37", | |
"tenantId": "37fd7...940", | |
"tenantDomain": "https://app.contoso-finance.com", | |
"accessToken": "eyJhbIzNyIsIlRlbmF....pMqI4KUZ1w", | |
"refreshToken": "kcGqqnGLOfJpG....h1M06Vo=", | |
"email": "[email protected]", | |
"isSociallyAuthenticated": false, | |
"embeddedModeAuthentication": 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
az account set --subscription subscription-id | |
az aks get-credentials --resource-group TechnologyLeads-Common --name technologyleads-aks | |
kubectl apply -f SecretProviderClass.yaml | |
helm uninstall ecosystem-identity-api-release | |
helm upgrade --install ecosystem-identity-api-release ./Helm --values ./Helm/values.production.yaml --set image.tag="v1.0.0" --set global.env.ASPNETCORE_ENVIRONMENT="Production" |
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
- task: CopyFiles@2 | |
inputs: | |
SourceFolder: 'Infrastructure' | |
Contents: '**' | |
TargetFolder: '$(Build.ArtifactStagingDirectory)' | |
- task: PublishBuildArtifacts@1 | |
inputs: | |
pathtoPublish: '$(Build.ArtifactStagingDirectory)' | |
artifactName: '$(projectName)' |