Skip to content

Instantly share code, notes, and snippets.

View LaurentAerens's full-sized avatar

laurent aerens LaurentAerens

  • Codit
  • Belgium
View GitHub Profile
$rawOutput = $bicepExpression |
bicep console 2>&1 |
Out-String
``
$bicepExpression = @"
func isValidEnvironment(env string) bool => contains(['dev','test','prod'], env)
isValidEnvironment('dev')
"@
$bicepFunction = "func isValidEnvironment(env string) bool => contains(['dev','test','prod'], env)"
@LaurentAerens
LaurentAerens / isValidEnvironment.bicep-test.json
Last active February 6, 2026 13:24
isValidEnvironment test json
{
"description": "Tests for custom isValidEnvironment function",
"tests": [
{
"name": "Dev environment is valid env",
"bicepFile": "pathtoyourbicepfile.bicep",
"functionCall": "isValidEnvironment('dev')",
"expected": "true"
},
{
@LaurentAerens
LaurentAerens / gist:b9ed83121a47777df73c80efd5facacb
Created February 6, 2026 13:20
isValidEnvironment bicep function
func isValidEnvironment(env string) bool => contains(['dev', 'test', 'prod'], env)
- task: DotNetCoreCLI@2
displayName: 'Restore NuGet Packages'
inputs:
command: 'restore'
projects: 'DemoAppWithPrivateNugetFeed/DemoAppWithPrivateNugetFeed.csproj'
feedsToUse: 'config'
nugetConfigPath: 'DemoAppWithPrivateNugetFeed/nuget.config'
- task: DotNetCoreCLI@2
displayName: 'Basic Publish DemoAppsWithPrivateNugetFeed'
- task: DotNetCoreCLI@2
displayName: 'Advanced Publish TestAPI'
inputs:
projects: 'TestAPI/TestAPI.csproj'
command: 'publish'
publishWebProjects: false
arguments: >-
-p ContainerRepository="testapiAlpine"
-p ContainerImageTags="\"1.0.0;latest\""
-p Version="1.0.0.0"
- task: DotNetCoreCLI@2
displayName: 'Basic Publish TestAPI'
inputs:
projects: 'TestAPI/TestAPI.csproj'
command: 'publish'
publishWebProjects: false
arguments: '-p ContainerRegistry=myblogcontainerizedemo.azurecr.io'
zipAfterPublish: false
- task: Docker@2
inputs:
containerRegistry: 'MyDemoACR'
command: 'login'
@LaurentAerens
LaurentAerens / azurefunction.csrpoj
Created May 27, 2024 10:34
azure function containerized csproj
<PropertyGroup>
...
<ContainerRepository>{name}</ContainerRepository>
<ContainerBaseImage>mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0</ContainerBaseImage>
</PropertyGroup>