"extensionProfile": {
"extensions": [
{
"name": "RDPExtension",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Windows.Azure.Extensions",
"type": "RDP",
"typeHandlerVersion": "1.2.1",
"settings": "<PublicConfig>\r\n <UserName>[Insert Username]</UserName>\r\n <Expiration>1/21/2022 12:00:00 AM</Expiration>\r\n</PublicConfig>",
"protectedSettings": "<PrivateConfig>\r\n <Password>[Insert Password]</Password>\r\n</PrivateConfig>"
}
},
{
"name": "Microsoft.Insights.VMDiagnosticsSettings_WebRole1",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Azure.Diagnostics",
"type": "PaaSDiagnostics",
"typeHandlerVersion": "1.5",
"settings": "[parameters('wadPublicConfig_WebRole1')]",
"protectedSettings": "[parameters('wadPrivateConfig_WebRole1')]",
"rolesAppliedTo": [
"WebRole1"
]
}
}
]
}
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"cloudServiceName": {
"type": "string",
"metadata": {
"description": "Name of the cloud service"
}
},
"location": {
"type": "string",
"metadata": {
"description": "Location of the cloud service"
}
},
"deploymentLabel": {
"type": "string",
"metadata": {
"description": "Label of the deployment"
}
},
"packageSasUri": {
"type": "securestring",
"metadata": {
"description": "SAS URI of the package (.cspkg) file to deploy"
}
},
"configurationSasUri": {
"type": "securestring",
"metadata": {
"description": "SAS URI of the configuration (.cscfg) file"
}
},
"roles": {
"type": "array",
"metadata": {
"description": "Roles created in the cloud service application"
}
},
"wadPublicConfig_WebRole1": {
"type": "string",
"metadata": {
"description": "Public configuration of the Azure Diagnostics extension"
}
},
"wadPrivateConfig_WebRole1": {
"type": "securestring",
"metadata": {
"description": "Private configuration of the Azure Diagnostics extension"
}
},
"vnetName": {
"type": "string",
"defaultValue": "[concat(parameters('cloudServiceName'), 'VNet')]",
"metadata": {
"description": "Name of virtual network"
}
},
"publicIPName": {
"type": "string",
"defaultValue": "contosocsIP",
"metadata": {
"description": "Name of public IP address"
}
},
"upgradeMode": {
"type": "string",
"defaultValue": "Auto",
"metadata": {
"UpgradeMode": "UpgradeMode of the CloudService"
}
}
},
"variables": {
"cloudServiceName": "[parameters('cloudServiceName')]",
"subscriptionID": "[subscription().subscriptionId]",
"dnsName": "[variables('cloudServiceName')]",
"lbName": "[concat(variables('cloudServiceName'), 'LB')]",
"lbFEName": "[concat(variables('cloudServiceName'), 'LBFE')]",
"resourcePrefix": "[concat('/subscriptions/', variables('subscriptionID'), '/resourceGroups/', resourceGroup().name, '/providers/')]"
},
"resources": [
{
"apiVersion": "2019-08-01",
"type": "Microsoft.Network/virtualNetworks",
"name": "[parameters('vnetName')]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/16"
]
},
"subnets": [
{
"name": "WebTier",
"properties": {
"addressPrefix": "10.0.0.0/24"
}
}
]
}
},
{
"apiVersion": "2019-08-01",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[parameters('publicIPName')]",
"location": "[parameters('location')]",
"properties": {
"publicIPAllocationMethod": "Dynamic",
"idleTimeoutInMinutes": 10,
"publicIPAddressVersion": "IPv4",
"dnsSettings": {
"domainNameLabel": "[variables('dnsName')]"
}
},
"sku": {
"name": "Basic"
}
},
{
"apiVersion": "2021-03-01",
"type": "Microsoft.Compute/cloudServices",
"name": "[variables('cloudServiceName')]",
"location": "[parameters('location')]",
"tags": {
"DeploymentLabel": "[parameters('deploymentLabel')]",
"DeployFromVisualStudio": "true"
},
"dependsOn": [
"[concat('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]",
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPName'))]"
],
"properties": {
"packageUrl": "[parameters('packageSasUri')]",
"configurationUrl": "[parameters('configurationSasUri')]",
"upgradeMode": "[parameters('upgradeMode')]",
"roleProfile": {
"roles": [
{
"name": "WebRole1",
"sku": {
"name": "Standard_D1_v2",
"capacity": "1"
}
},
{
"name": "WorkerRole1",
"sku": {
"name": "Standard_D1_v2",
"capacity": "1"
}
}
]
},
"networkProfile": {
"loadBalancerConfigurations": [
{
"id": "[concat(variables('resourcePrefix'), 'Microsoft.Network/loadBalancers/', variables('lbName'))]",
"name": "[variables('lbName')]",
"properties": {
"frontendIPConfigurations": [
{
"name": "[variables('lbFEName')]",
"properties": {
"publicIPAddress": {
"id": "[concat(variables('resourcePrefix'), 'Microsoft.Network/publicIPAddresses/', parameters('publicIPName'))]"
}
}
}
]
}
}
]
},
"osProfile": {
"secrets": [
{
"sourceVault": {
"id": "/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.KeyVault/vaults/{keyvault-name}"
},
"vaultCertificates": [
{
"certificateUrl": "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"
}
]
}
]
},
"extensionProfile": {
"extensions": [
{
"name": "RDPExtension",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Windows.Azure.Extensions",
"type": "RDP",
"typeHandlerVersion": "1.2.1",
"settings": "<PublicConfig>\r\n <UserName>[Insert Username]</UserName>\r\n <Expiration>1/21/2022 12:00:00 AM</Expiration>\r\n</PublicConfig>",
"protectedSettings": "<PrivateConfig>\r\n <Password>[Insert Password]</Password>\r\n</PrivateConfig>"
}
},
{
"name": "Microsoft.Insights.VMDiagnosticsSettings_WebRole1",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Azure.Diagnostics",
"type": "PaaSDiagnostics",
"typeHandlerVersion": "1.5",
"settings": "[parameters('wadPublicConfig_WebRole1')]",
"protectedSettings": "[parameters('wadPrivateConfig_WebRole1')]",
"rolesAppliedTo": [
"WebRole1"
]
}
}
]
}
}
}
]
}