This file contains 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
#This is a Build Deploy Pipeline for .NET 6 Web App to Azure App Service using Azure DevOps Pipeline | |
trigger: | |
- master | |
pool: | |
vmImage: ubuntu-latest | |
variables: | |
buildConfiguration: 'Release' |
This file contains 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
trigger: | |
- main | |
pool: | |
vmImage: ubuntu-latest | |
steps: | |
- checkout: self | |
submodules: true | |
- task: AzureStaticWebApp@0 |
This file contains 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
using System; | |
using System.Collections.Specialized; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Web; | |
namespace StorageRestApiAuth |
This file contains 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
builder.ConfigureAppConfiguration((hostingContext, config) => | |
{ | |
var environmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); | |
Console.WriteLine("Environment Variable: " + environmentName); | |
var env = hostingContext.HostingEnvironment; | |
Console.WriteLine("hostingContext.HostingEnvironment: " + env.EnvironmentName); | |
config.SetBasePath(Directory.GetCurrentDirectory()) | |
.AddJsonFile($"appsettings.json", optional: true, reloadOnChange: true) | |
.AddJsonFile($"appsettings.{environmentName}.json", optional: true, reloadOnChange: true) |
This file contains 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
#Zipped artifact path - get the path from Azure DevOps Pipeline variables | |
$path = "$(System.DefaultWorkingDirectory)\$($env:zippedArtifactPath)" | |
#Test the path if exists | |
if (-not (Test-Path $path)) | |
{ | |
throw [System.IO.FileNotFoundException] "$($path) not found." | |
} | |
#Resource type and details |
This file contains 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
#Zipped artifact path - get the path from Azure DevOps Pipeline variables | |
$path = "$(System.DefaultWorkingDirectory)\$($env:zippedArtifactPath)" | |
#Test the path if exists | |
if (-not (Test-Path $path)) | |
{ | |
throw [System.IO.FileNotFoundException] "$($path) not found." | |
} | |
#Resource type and details | |
$resourceType = "Microsoft.Web/sites/config" |
This file contains 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 mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env | |
WORKDIR /app | |
# Copy csproj and restore as distinct layers | |
COPY *.csproj ./ | |
RUN dotnet restore | |
# Copy everything else and build | |
COPY . ./ | |
RUN dotnet publish -c Release -o out |
This file contains 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
using System; | |
namespace EventGridEventTrigger.Library | |
{ | |
public static class CustomEvent<T> | |
{ | |
public static EventGridEvent CreateCustomEvent(T obj) | |
{ | |
return new EventGridEvent() | |
{ |