Skip to content

Commit ef9cd5f

Browse files
author
Mikkel Mork Hegnhoj
committed
Refactoring and adding .gitignore
1 parent 24bcff6 commit ef9cd5f

File tree

308 files changed

+19
-53077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+19
-53077
lines changed

install-AzurePowershell.ps1 renamed to Install-DotnetRuntimeVMSS.ps1

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
1-
$resourceGroup = "wincluster"
2-
$vmssName = "default"
1+
Param(
2+
[string]$resourceGroup,
3+
[string]$vmssName
4+
)
35

46
# Set the config
5-
$fileUris = @("https://mikhegn.blob.core.windows.net/temp/install-dotnetcore.ps1")
7+
$fileUris = @("https://raw.githubusercontent.com/MikkelHegn/vmss-dotnet-custom-script-extension/master/install-dotnetvmss.ps1")
68
$commandToExecute = 'powershell -NoProfile -ExecutionPolicy unrestricted -Command ./install-dotnetcore.ps1'
79
$settings = @{"fileUris" = $fileUris; "commandToExecute" = $commandToExecute}
810

911
# Get information about the scale set
1012
$vmss = Get-AzureRmVmss -ResourceGroupName $resourceGroup -VMScaleSetName $vmssName
1113

14+
$csExtension = $vmss.VirtualMachineProfile.ExtensionProfile.Extensions | where Type -eq CustomScriptExtension
15+
16+
if ($csExtension) {
17+
Write-Host "Error: CustomScriptExtension already in use on VMSS, remove before applying a new one." -ForegroundColor Red -BackgroundColor Black;
18+
$csExtension;
19+
break;
20+
}
21+
1222
# Add the Custom Script Extension to install IIS and configure basic website
1323
$vmss = Add-AzureRmVmssExtension `
1424
-VirtualMachineScaleSet $vmss `
1525
-Name "dotnetCoreInstallation" `
1626
-Publisher "Microsoft.Compute" `
1727
-Type "CustomScriptExtension" `
1828
-TypeHandlerVersion 1.9 `
19-
-AutoUpgradeMinorVersion $true
29+
-AutoUpgradeMinorVersion $true `
30+
-ForceUpdateTag 1.0 `
2031
-Setting $settings
2132

2233
# Update the scale set and apply the Custom Script Extension to the VM instances
File renamed without changes.

README.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@ This repo contains scripts to update your Azure Virtual Machine Scale Set model
44

55
## How this works
66

7-
The custom script extension for VMSS can download a script and execute it on a VMSS node. The install-AzurePowershell.ps1 script is the script you run to update the VMSS model with this extension. The install-dotnetcore.ps1 script is the script that's downloaded to the VMSS node and executed to do the install. The install-dotnetcore.ps1 also adds the install directory to the system path.
7+
The custom script extension for VMSS can download a script and execute it on a VMSS. The Install-DotnetRuntimeVMSS.ps1 script is the script you run to update the VMSS model with this extension. The Install-DotnetVMSS.ps1 script is the script that's downloaded to the VMSS node and executed to do the install. The Install-DotnetVMSS.ps1 also adds the install directory to the system path.
88

99
## How to use the extension
1010

11-
1. Upload the install-dotnetcore.ps1 file to a storage account (or use the version I'm hosting - but don't rely on it being stable :-)). You can secure the script location and provide the key via the custom script extension: https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-windows
11+
1. In the Install-DotnetRuntimeVMSS.ps1 file, you can add parameters to the `$commandToExecute` variable, which will control the version, release channel and install directory for dotnet. Use this for reference: https://github.com/dotnet/docs/blob/master/docs/core/tools/dotnet-install-script.md.
1212

13-
1. In the install-AzurePowershell.ps1 file, you can add parameters to the `$commandToExecute` variable, which will control the version, release channel and install directory for dotnet. Use this for reference: https://github.com/dotnet/docs/blob/master/docs/core/tools/dotnet-install-script.md.
14-
15-
1. Update the VMSS model by running the install-AzurePowershell.ps1 script.
16-
17-
You can validate the script by deploying the application SF-dotnetcoreFrameworkDependantApp from this repo.
13+
2. Update the VMSS model by running the Install-DotnetRuntimeVMSS.ps1 script.
1814

1915
## Troubleshooting
2016

2117
- dotnet core requirements: https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore2x
22-
- VMSS extension FAQ: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-faq#extensions
18+
- VMSS extension FAQ: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-faq#extensions
Binary file not shown.

SF-dotnetcoreFrameworkDepedantApp/Application4/.vs/Application4/v15/Server/sqlite3/db.lock

Whitespace-only changes.

SF-dotnetcoreFrameworkDepedantApp/Application4/Application4/PublishProfiles/Cloud.xml

-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@
2020
AzureActiveDirectory="true"
2121
ServerCertThumbprint="0123456789012345678901234567890123456789" />
2222
-->
23-
<ClusterConnectionParameters ConnectionEndpoint="mikhegn-vmsstest.northeurope.cloudapp.azure.com:19000"
24-
X509Credential="true"
25-
ServerCertThumbprint="04998CAEDCCD9C8FB9E05A56A81DA25C9A1C61EC"
26-
FindType="FindByThumbprint"
27-
FindValue="04998CAEDCCD9C8FB9E05A56A81DA25C9A1C61EC"
28-
StoreLocation="CurrentUser"
29-
StoreName="My" />
3023
<ApplicationParameterFile Path="..\ApplicationParameters\Cloud.xml" />
3124
<CopyPackageParameters CompressPackage="true" />
3225
</PublishProfile>

SF-dotnetcoreFrameworkDepedantApp/Application4/Application4/obj/x64/Debug/Application4.sfproj.FileListAbsolute.txt

-1
This file was deleted.

SF-dotnetcoreFrameworkDepedantApp/Application4/Application4/obj/x64/Release/Application4.sfproj.FileListAbsolute.txt

-1
This file was deleted.

SF-dotnetcoreFrameworkDepedantApp/Application4/Application4/pkg/Debug/ApplicationManifest.xml

-25
This file was deleted.

0 commit comments

Comments
 (0)