This file contains hidden or 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
| private void RunTaskBasedContainer(IAzure azure, | |
| string resourceGroupName, | |
| string containerGroupName, | |
| string containerImage) | |
| { | |
| IResourceGroup resGroup = azure.ResourceGroups.GetByName(resourceGroupName); | |
| Region azureRegion = resGroup.Region; | |
| var chartsJson = JsonConvert.SerializeObject(MarketCharts, Formatting.None, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); | |
| azure.ContainerGroups.Define(containerGroupName) |
This file contains hidden or 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
| private void CreateResourceGroup(IAzure azure, string resourceGroupName, Region azureRegion) | |
| { | |
| azure.ResourceGroups.Define(resourceGroupName) | |
| .WithRegion(azureRegion) | |
| .Create(); | |
| } |
This file contains hidden or 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
| private void DeleteResourceGroup(IAzure azure, string resourceGroupName) | |
| { | |
| azure.ResourceGroups.DeleteByNameAsync(resourceGroupName); | |
| } |
This file contains hidden or 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
| private void StopContainerGroup() | |
| { | |
| IAzure azure = GetAzureContext(Environment.GetEnvironmentVariable(AzureLoginPath)); | |
| var containerGroup = azure.ContainerGroups.GetByResourceGroup(ResourceGroupName, ContainerGroupName); | |
| //this will stop all the containers in that group, and billing will stop | |
| containerGroup?.Stop(); | |
| } |
This file contains hidden or 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
| { | |
| "solution": "${workspaceRoot}/SOLUTION_NAME.sln", | |
| "variables": { | |
| "MSBUILD": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/MSBuild/15.0/Bin/MSBuild.exe", | |
| "DEVENV": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/devenv.com" | |
| }, | |
| "buildConfigurations": [ | |
| "Debug", | |
| "Release" | |
| ], |
This file contains hidden or 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
| FROM microsoft/dotnet AS build-env | |
| COPY . /app | |
| RUN ["dotnet", "--info"] | |
| WORKDIR /app/MyApp | |
| RUN ["dotnet", "publish", "--configuration", "Release"] |
This file contains hidden or 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
| curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
| sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg | |
| sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list' | |
| sudo apt-get install apt-transport-https | |
| sudo apt-get update | |
| sudo apt-get install dotnet-sdk-2.2 |
This file contains hidden or 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
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <OutputType>Exe</OutputType> | |
| <IsPackable>true</IsPackable> | |
| <PackAsTool>true</PackAsTool> | |
| <ToolCommandName>file-sort</ToolCommandName> | |
| <Version>1.0.1</Version> | |
| <PackageOutputPath>./nupkg</PackageOutputPath> | |
| <TargetFramework>netcoreapp2.1</TargetFramework> |
This file contains hidden or 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
| [CustomAction] | |
| public static ActionResult UpdateBindingRedirects(Session session) | |
| { | |
| var doc = new XDocument(); | |
| doc.Load("...configPath"); | |
| var bindings = @"<assemblyBinding xmlns=""urn:schemas-microsoft-com:asm.v1""> | |
| <dependentAssembly> | |
| <assemblyIdentity name=""Newtonsoft.Json"" publicKeyToken=""30ad4fe6b2a6aeed"" culture=""neutral"" /> | |
| <bindingRedirect oldVersion=""0.0.0.0-12.0.1.0"" newVersion=""12.0.1.0"" /> | |
| </dependentAssembly> |
This file contains hidden or 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
| class Program | |
| { | |
| public static async Task Main(string[] args) | |
| => await CommandLineApplication.ExecuteAsync<Program>(args); | |
| private async Task OnExecute() | |
| { | |
| await Something(); | |
| } | |
| } |