Skip to content

Instantly share code, notes, and snippets.

@bogdanbujdea
Created September 28, 2018 10:24
Show Gist options
  • Select an option

  • Save bogdanbujdea/f8f2f379d5a0f27de09eea6f351ea559 to your computer and use it in GitHub Desktop.

Select an option

Save bogdanbujdea/f8f2f379d5a0f27de09eea6f351ea559 to your computer and use it in GitHub Desktop.
Stop a container group
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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment