Skip to content

Instantly share code, notes, and snippets.

View HowardvanRooijen's full-sized avatar

Howard van Rooijen HowardvanRooijen

View GitHub Profile
@HowardvanRooijen
HowardvanRooijen / netlify-to-azure-static-web-apps-redirects-converter.dib
Created October 4, 2022 10:48
A .NET Interactive Notebook that converts Netlify URL Redirects to Azure Static Web Apps staticwebapp.config.json format
#!csharp
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
#!csharp
var lines = await File.ReadAllLinesAsync("./_redirects");
var rules = new List<(string, string, string)>();
<?xml version="1.0" encoding="utf-8"?>
<bom xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://cyclonedx.org/schema/bom/1.4">
<metadata>
<tools>
<tool>
<vendor>Spectre Systems AB</vendor>
<name>Hades CLI</name>
<version>0.0.0.0</version>
</tool>
</tools>
public Task GenerateRssFeedAsync(SiteContext siteContext, IEnumerable<StructuredDataItem> items, string outputFilePath)
{
var feed = new RssFeed
{
Channel =
{
Link = new Uri(Flurl.Url.Combine(siteContext.SiteTemplateMetaData.Url, "feed", "rss.xml")),
Title = siteContext.SiteTemplateMetaData.Title,
Description = siteContext.SiteTemplateMetaData.Description,
LastBuildDate = DateTime.Now,
Azure.RequestFailedException: Service request failed.
Status: 403 (Forbidden)
Content:
{
"error": {
"code": "Forbidden",
"message": "The user, group or application 'appid=...;oid=...;numgroups=...;iss=https://sts.windows.net/.../' does not have keys create permission on key vault '...;location=...'. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125287",
"innererror": {
"code": "AccessDenied"
}
fSdEOFhBcNImnhnPWSrRBnmFPuWdbEW16dRzMnkNEOW2L/Y3XVzS4EqxLKEE4UhG3rGukZZ0pq0ea/1TVs9dXUtmpuhbNaqraj1oZyU5usN6/FtDGyhmBl609ciAZOpCEPulb3qFyGRicZ8lcMn3sNVWd0YmxtC0FfoWosFW0xCx+5hGLDP3MVVe7BOe2028Wp68B+Zfppj8v8GWQgLB50j3KVeaMOtCGhPSodHWojDJOoHSn53ys/iTxg6SItJPLrM9A6siJjIhvL4idUPZ440vuG0chLzYHGYy0DwCJa2n3K70DsaByN7QRKnLMJtZSvcBbndRLKujZQGQAvm3gA==
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User)
Invoke-WebRequest "https://cdn.deislabs.io/porter/latest/install-windows.ps1" -UseBasicParsing | Invoke-Expression
[Then(@"an ""(.*)"" should be thrown")][Then(@"a ""(.*)"" should be thrown")]
[Then(@"the result count should be (.*)")]
[Then(@"the result should equal the datetime (.*)")]
[Then(@"the result should equal the datetimeoffset (.*)")]
[Then(@"the result should equal the integer (.*)")]
[Then(@"the result should equal the string ""(.*)""")]
[Then(@"the result should be false")]
[Then(@"the result should be greater than the datetime (.*)")]
[Then(@"the result should be greater than the datetimeoffset (.*)")]
[Then(@"the result should be greater than the integer (.*)")]
[Then(@"the result should be greater than or equal to the datetime (.*)")]
[Binding]
public class NUnit3Hooks
{
[BeforeFeature("workingdirectory_feature")]
public static void ChangeWorkingDirectory()
{
FeatureContext.Current.Add("NUnit3Hooks.OldWorkingDirectory", Directory.GetCurrentDirectory());
Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
}
[AfterFeature("workingdirectory_feature")]