-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95cc49a
commit 648b8a2
Showing
10 changed files
with
381 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
*.tfvars | ||
.terraform | ||
.terraform* | ||
*.tfstate | ||
*.tfstate* |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,224 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"location": { | ||
"type": "String" | ||
}, | ||
"workspaceName": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Name of the log analytics workspace to create." | ||
} | ||
}, | ||
"azp_url": { | ||
"type": "String" | ||
}, | ||
"azp_token": { | ||
"type": "securestring" | ||
}, | ||
"azp_pool": { | ||
"type": "String" | ||
}, | ||
"azp_poolID": { | ||
"type": "String" | ||
}, | ||
"registry_server": { | ||
"type": "String" | ||
}, | ||
"registry_username": { | ||
"type": "String" | ||
}, | ||
"registry_password": { | ||
"type": "securestring" | ||
}, | ||
"image": { | ||
"type": "String" | ||
}, | ||
"min_replicas": { | ||
"type": "Int" | ||
}, | ||
"max_replicas": { | ||
"type": "Int" | ||
} | ||
}, | ||
"functions": [], | ||
"variables": {}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Network/virtualNetworks", | ||
"apiVersion": "2020-11-01", | ||
"name": "devops-agents", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"addressSpace": { | ||
"addressPrefixes": [ | ||
"10.0.0.0/16" | ||
] | ||
}, | ||
"dhcpOptions": { | ||
"dnsServers": [] | ||
}, | ||
"subnets": [ | ||
{ | ||
"name": "infrastructure", | ||
"properties": { | ||
"addressPrefix": "10.0.0.0/21", | ||
"serviceEndpoints": [], | ||
"delegations": [], | ||
"privateEndpointNetworkPolicies": "Enabled", | ||
"privateLinkServiceNetworkPolicies": "Enabled" | ||
} | ||
}, | ||
{ | ||
"name": "runtime", | ||
"properties": { | ||
"addressPrefix": "10.0.8.0/21", | ||
"serviceEndpoints": [], | ||
"delegations": [], | ||
"privateEndpointNetworkPolicies": "Enabled", | ||
"privateLinkServiceNetworkPolicies": "Enabled" | ||
} | ||
} | ||
], | ||
"virtualNetworkPeerings": [], | ||
"enableDdosProtection": false | ||
} | ||
}, | ||
{ | ||
"type": "microsoft.operationalinsights/workspaces", | ||
"apiVersion": "2021-12-01-preview", | ||
"name": "[parameters('workspaceName')]", | ||
"location": "westeurope", | ||
"properties": { | ||
"sku": { | ||
"name": "pergb2018" | ||
}, | ||
"retentionInDays": 30, | ||
"features": { | ||
"enableLogAccessUsingOnlyResourcePermissions": true | ||
}, | ||
"workspaceCapping": { | ||
"dailyQuotaGb": -1 | ||
}, | ||
"publicNetworkAccessForIngestion": "Enabled", | ||
"publicNetworkAccessForQuery": "Enabled" | ||
} | ||
}, | ||
{ | ||
"type": "Microsoft.App/managedEnvironments", | ||
"apiVersion": "2022-03-01", | ||
"name": "devops-agent", | ||
"location": "[parameters('location')]", | ||
"dependsOn": [ | ||
"[resourceId('microsoft.operationalinsights/workspaces', parameters('workspaceName'))]", | ||
"[resourceId('Microsoft.Network/virtualNetworks', 'devops-agents')]" | ||
], | ||
"properties": { | ||
"appLogsConfiguration": { | ||
"destination": "log-analytics", | ||
"logAnalyticsConfiguration": { | ||
"customerId": "[reference(resourceId('microsoft.operationalinsights/workspaces', parameters('workspaceName')), '2021-12-01-preview').customerId]", | ||
"sharedKey": "[listKeys(resourceId('microsoft.operationalinsights/workspaces', parameters('workspaceName')), '2021-12-01-preview').primarySharedKey]" | ||
} | ||
}, | ||
"vnetConfiguration": { | ||
"infrastructureSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', 'devops-agents', 'infrastructure')]", | ||
"internal": true, | ||
"runtimeSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets', 'devops-agents', 'runtime')]" | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "Microsoft.App/containerApps", | ||
"apiVersion": "2022-03-01", | ||
"name": "devops-agent", | ||
"location": "[parameters('location')]", | ||
"dependsOn": [ | ||
"[resourceId('Microsoft.App/managedEnvironments', 'devops-agent')]" | ||
], | ||
"identity": { | ||
"type": "SystemAssigned" | ||
}, | ||
"properties": { | ||
"managedEnvironmentId": "[resourceId('Microsoft.App/managedEnvironments', 'devops-agent')]", | ||
"configuration": { | ||
"secrets": [ | ||
{ | ||
"name": "registry-secret", | ||
"value": "[parameters('registry_password')]" | ||
}, | ||
{ | ||
"name": "azp-token", | ||
"value": "[parameters('azp_token')]" | ||
}, | ||
{ | ||
"name": "azp-url", | ||
"value": "[parameters('azp_url')]" | ||
} | ||
], | ||
"registries": [ | ||
{ | ||
"server": "[parameters('registry_server')]", | ||
"username": "[parameters('registry_username')]", | ||
"passwordSecretRef": "registry-secret" | ||
} | ||
] | ||
}, | ||
"template": { | ||
"containers": [ | ||
{ | ||
"image": "[parameters('image')]", | ||
"name": "devops-agent", | ||
"resources": { | ||
"cpu": 1.75, | ||
"memory": "3.5Gi" | ||
}, | ||
"env": [ | ||
{ | ||
"name": "AZP_TOKEN", | ||
"secretRef": "azp-token" | ||
}, | ||
{ | ||
"name": "AZP_URL", | ||
"secretRef": "azp-url" | ||
}, | ||
{ | ||
"name": "AZP_POOL", | ||
"value": "[parameters('azp_pool')]" | ||
} | ||
] | ||
} | ||
], | ||
"scale": { | ||
"minReplicas": "[parameters('min_replicas')]", | ||
"maxReplicas": "[parameters('max_replicas')]", | ||
"rules": [ | ||
{ | ||
"name": "azure-pipelines", | ||
"custom": { | ||
"type": "azure-pipelines", | ||
"metadata": { | ||
"poolID": "[parameters('azp_poolID')]", | ||
"targetPipelinesQueueLength": "1" | ||
}, | ||
"auth": [ | ||
{ | ||
"secretRef": "azp-token", | ||
"triggerParameter": "personalAccessToken" | ||
}, | ||
{ | ||
"secretRef": "azp-url", | ||
"triggerParameter": "organizationURL" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"outputs": {} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"name": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "Name of the container registry to create." | ||
} | ||
}, | ||
"location": { | ||
"type": "string", | ||
"metadata": { | ||
"description": "The location of the resource." | ||
} | ||
} | ||
}, | ||
"functions": [], | ||
"variables": {}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.ContainerRegistry/registries", | ||
"apiVersion": "2022-02-01-preview", | ||
"name": "[parameters('name')]", | ||
"location": "[parameters('location')]", | ||
"sku": { | ||
"name": "Standard", | ||
"tier": "Standard" | ||
}, | ||
"properties": { | ||
"adminUserEnabled": true, | ||
"policies": { | ||
"quarantinePolicy": { | ||
"status": "disabled" | ||
}, | ||
"trustPolicy": { | ||
"type": "Notary", | ||
"status": "disabled" | ||
}, | ||
"retentionPolicy": { | ||
"days": 7, | ||
"status": "disabled" | ||
}, | ||
"exportPolicy": { | ||
"status": "enabled" | ||
}, | ||
"azureADAuthenticationAsArmPolicy": { | ||
"status": "enabled" | ||
}, | ||
"softDeletePolicy": { | ||
"retentionDays": 7, | ||
"status": "disabled" | ||
} | ||
}, | ||
"encryption": { | ||
"status": "disabled" | ||
}, | ||
"dataEndpointEnabled": false, | ||
"publicNetworkAccess": "Enabled", | ||
"networkRuleBypassOptions": "AzureServices", | ||
"zoneRedundancy": "Disabled", | ||
"anonymousPullEnabled": false | ||
} | ||
} | ||
], | ||
"outputs": { | ||
"name": { | ||
"type": "string", | ||
"value": "[parameters('name')]" | ||
}, | ||
"loginServer": { | ||
"type": "string", | ||
"value": "[reference(resourceId('Microsoft.ContainerRegistry/registries', parameters('name'))).loginServer]" | ||
}, | ||
"username": { | ||
"type": "string", | ||
"value": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '2022-02-01-preview').username]" | ||
}, | ||
"password": { | ||
"type": "string", | ||
"value": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries', parameters('name')), '2022-02-01-preview').passwords[0].value]" | ||
} | ||
} | ||
} |
Oops, something went wrong.