sample changes

This commit is contained in:
jaszymas
2021-04-27 11:43:47 -07:00
parent 310c1dc892
commit cf4deeb519
8 changed files with 25 additions and 48 deletions
@@ -210,7 +210,6 @@ resource KeyVault_Resource 'Microsoft.KeyVault/vaults@2019-09-01' = {
family: 'A'
name: 'standard'
}
enableSoftDelete: false
accessPolicies: [
{
tenantId: subscription().tenantId
@@ -0,0 +1,23 @@
Import-Module "Az.Resources"
######################################################################
# Prompt the user to enter the values of deployment parameters
######################################################################
$resourceGroupName = Read-Host -Prompt "Enter the resource group name"
$subscriptionId = Read-Host -Prompt "Enter your subscription id"
######################################################################
# Sign in to Azure
######################################################################
Connect-AzAccount
$context = Set-AzContext -Subscription $subscriptionId
######################################################################
# Delete the resource group and the key vault with purge proteciton on
######################################################################
$location = (Get-AzResourceGroup -Name $resourceGroupName).Location
Remove-AzResourceGroup -Name $resourceGroupName
Remove-AzKeyVault -VaultName "${resourceGroupName}vault" -InRemovedState -Location $location
@@ -6,7 +6,6 @@ Import-Module "SqlServer" -MinimumVersion "21.1.18235"
# Prompt the user to enter the values of deployment parameters
######################################################################
uniqueString
$projectName = Read-Host -Prompt "Enter a project name that is used to generate resource names"
$subscriptionId = Read-Host -Prompt "Enter your subscription id"
$location = Read-Host -Prompt "Enter a region where you want to deploy the demo environment"
@@ -71,12 +71,7 @@ namespace ContosoHR
SqlColumnEncryptionAzureKeyVaultProvider sqlColumnEncryptionAzureKeyVaultProvider =
new SqlColumnEncryptionAzureKeyVaultProvider(KeyVaultAuthenticationCallback);
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(Configuration.GetConnectionString("ContosoHRDatabase"));
if(builder.Authentication != SqlAuthenticationMethod.ActiveDirectoryManagedIdentity)
{
var clientId = "f0f029e7-a654-4f34-8f66-db76c1b29752";
var secret = "U7O-B811m91~gN8nV-5fGzgpIlV_CLt6Mi";
_clientCredential = new ClientCredential(clientId, secret);
}
// Register the Azure Key Vault provider
SqlConnection.RegisterColumnEncryptionKeyStoreProviders(
customProviders: new Dictionary<string, SqlColumnEncryptionKeyStoreProvider>(
@@ -8,6 +8,6 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"ContosoHRDatabase": "Data Source = .; Initial Catalog = ContosoHR; Column Encryption Setting = Enabled;Attestation Protocol = HGS; Enclave Attestation Url = http://192.168.0.2/Attestation; Integrated Security = true"
"ContosoHRDatabase": "Server=tcp:<yourservername>.database.windows.net;Database=ContosoHR;Column Encryption Setting=Enabled; Attestation Protocol = AAS; Enclave Attestation Url=<yourattestationurl>; Authentication=Active Directory Managed Identity"
}
}
@@ -1,13 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"ContosoHRDatabase": "Data Source = aeenclavedemowus.database.windows.net; Initial Catalog = ContosoHR; Column Encryption Setting = Enabled; Attestation Protocol = AAS; Enclave Attestation Url = https://aeenclavedemowus.wus.attest.azure.net/attest/SgxEnclave; Authentication=Active Directory Managed Identity"
}
}
@@ -1,13 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"ContosoHRDatabase": "Data Source = aeenclavedemowus.database.windows.net; Initial Catalog = ContosoHR; Column Encryption Setting = Enabled;Attestation Protocol = AAS; Enclave Attestation Url = https://aeenclavedemowus.wus.attest.azure.net/attest/SgxEnclave; User Id = aeadmin; Password = Always3ncrypt3d"
}
}
@@ -1,13 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"ContosoHRDatabase": "Data Source = .; Initial Catalog = ContosoHR; Column Encryption Setting = Enabled;Attestation Protocol = HGS; Enclave Attestation Url = http://192.168.0.2/Attestation; Integrated Security = true"
}
}