Run Azure Policy in On-premises environment
https://docs.microsoft.com/en-us/azure/governance/policy/
- Using PolicyService
services.UsingPolicyService();
- Add On-premises support
services.AddSingleton<IInfrastructure,MockInfrastructure>();
- Add ARMOrchestrationService
More information reference: https://github.com/maskx/ARMOrchestration
var sqlConfig = new ARMOrchestrationSqlServerConfig()
{
Database = new DatabaseConfig()
{
ConnectionString = TestHelper.ConnectionString,
AutoCreate = true
}
};
services.UsingARMOrchestration(sqlConfig);
services.AddSingleton<maskx.ARMOrchestration.IInfrastructure>((sp) =>
{
return new MockARMInfrastructure(sp);
});
Before start ARMOrchestration, run
var result=PolicyService.Validate(new DeploymentOrchestrationInput());
In a background servcie, run:
PolicyService.Audit("Audit scope");
Not support yet