[{"data":1,"prerenderedAt":6987},["Reactive",2],{"navigation":3,"aAII9Cz3yR":204,"tags-tips learned this week":397},[4,192,200],{"title":5,"_path":6,"children":7,"icon":191},"Blog","/posts",[8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,98,101,104,107,110,113,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188],{"title":9,"_path":10},"Testing your API with REST Client","/posts/testing-your-api-with-rest-client",{"title":12,"_path":13},"HTML templating in Xamarin","/posts/html-templating-in-xamarin",{"title":15,"_path":16},"Goodbye Azure Portal, Welcome Azure CLI","/posts/welcome-azure-cli",{"title":18,"_path":19},"Coming across Gitpod","/posts/gitpod",{"title":21,"_path":22},"Handle token retrieval while querying an API","/posts/delegating-handler",{"title":24,"_path":25},"Clean up your local git branches.","/posts/cleaning-git-branches",{"title":27,"_path":28},"Automate configuration of Teams Tab SSO with PowerShell.","/posts/teams-sso-powershell",{"title":30,"_path":31},"How to do a technology watch? - Part 1","/posts/technology-watch-part1",{"title":33,"_path":34},"How to do a technology watch? - Part 2","/posts/technology-watch-part2",{"title":36,"_path":37},"You almost no longer need Key Vault references for Azure Functions.","/posts/azure-functions-custom-configuration",{"title":39,"_path":40},"How to do a technology watch? - Part 3","/posts/technology-watch-part3",{"title":42,"_path":43},"Forget DevOps, the future is already here!","/posts/devops-future",{"title":45,"_path":46},"Week 9, 2021 - Tips I learned this week","/posts/w09-2021-tips-learned-this-week",{"title":48,"_path":49},"Week 12, 2021 - Tips I learned this week","/posts/w12-2021-tips-learned-this-week",{"title":51,"_path":52},"Week 14, 2021 - Tips I learned this week","/posts/w14-2021-tips-learned-this-week",{"title":54,"_path":55},"Once upon a time in .NET","/posts/once-upon-a-time-in-dotnet",{"title":57,"_path":58},"Install your applications with winget","/posts/winget-import",{"title":60,"_path":61},"Customize your applications when installing them with winget","/posts/winget-override",{"title":63,"_path":64},"Week 22, 2021 - Tips I learned this week","/posts/w22-2021-tips-learned-this-week",{"title":66,"_path":67},"How to connect to an Azure SQL Database from C# using Azure AD","/posts/sqlclient-active-directory-authent",{"title":69,"_path":70},"Producing packages for Windows Package Manager","/posts/wingetcreate",{"title":72,"_path":73},"4 tips about GitHub Actions environment variables and contexts","/posts/github-actions-var-and-context",{"title":75,"_path":76},"AzureWebJobsStorage, the secret you don't need in your Function App.","/posts/azure-functions-without-azurewebjobsstorage",{"title":78,"_path":79},"ASP.NET Core - Lost in configuration","/posts/lost-in-configuration",{"title":81,"_path":82},"Week 39, 2021 - Tips I learned this week","/posts/w39-2021-tips-learned-this-week",{"title":84,"_path":85},"Week 41, 2021 - Tips I learned this week","/posts/w41-2021-tips-learned-this-week",{"title":87,"_path":88},"Migrating and open-sourcing my blog","/posts/migrating-blog",{"title":90,"_path":91},"Week 45, 2021 - Tips I learned this week","/posts/w45-2021-tips-learned-this-week",{"title":93,"_path":94},"Organize your GitHub stars with Astral","/posts/astral",{"title":96,"_path":97},"Pulumi with an Azure Blob Storage backend","/posts/pulumi-azure-backend",{"title":99,"_path":100},"IaC Hot Reload with Pulumi Watch","/posts/pulumi-watch",{"title":102,"_path":103},"Week 2, 2022 - Tips I learned this week","/posts/w02-2022-tips-learned-this-week",{"title":105,"_path":106},"Week 3, 2022 - Tips I learned this week","/posts/w03-2022-tips-learned-this-week",{"title":108,"_path":109},"Week 5, 2022 - Tips I learned this week","/posts/w05-2022-tips-learned-this-week",{"title":111,"_path":112},"How to provision an Azure SQL Database with Active Directory authentication","/posts/sqldatabase-active-directory-authent",{"title":114,"_path":115},"Why will I choose Pulumi over Terraform for my next project?","/posts/pulumi-vs-terraform",{"title":117,"_path":118},"Week 19, 2022 - Tips I learned this week","/posts/w19-2022-tips-learned-this-week",{"title":120,"_path":121},"Week 20, 2022 - Tips I learned this week","/posts/w20-2022-tips-learned-this-week",{"title":123,"_path":124},"Keeping secrets secure when using API Clients","/posts/http-clients-secrets",{"title":126,"_path":127},"What made me want to be a developer?","/posts/be-a-developer",{"title":129,"_path":130},"What can we do when stuck with a programming problem?","/posts/get-unstuck",{"title":132,"_path":133},"How did I automate the setup of my developer Windows laptop?","/posts/automate-developer-machine",{"title":135,"_path":136},"Discussion about API clients","/posts/http-clients",{"title":138,"_path":139},"Week 46, 2022 - Tips I learned this week","/posts/w46-2022-tips-learned-this-week",{"title":141,"_path":142},"When Pulumi met Nuke: a .NET love story","/posts/when-pulumi-met-nuke",{"title":144,"_path":145},"A year of learning and sharing - Dev Retro 2022","/posts/2022-retro",{"title":147,"_path":148},"Perform Dynamic Execution of an npm Package","/posts/pnpm-dlx",{"title":150,"_path":151},"Manage multiple Node.js versions","/posts/pnpm-env",{"title":153,"_path":154},"Introducing the Vue.js CI/CD series","/posts/vuecicd-introduction",{"title":156,"_path":157},"Execute commands using your project dependencies","/posts/pnpm-exec",{"title":159,"_path":160},"Vue.js CI/CD: Continuous Integration","/posts/vuecicd-ci",{"title":162,"_path":163},"Who is using pnpm?","/posts/pnpm-who-is-using",{"title":165,"_path":166},"Create an Azure-Ready GitHub Repository using Pulumi","/posts/azure-ready-github-repository",{"title":168,"_path":169},"Deploying to Azure from Azure DevOps without secrets","/posts/ado-workload-identity-federation",{"title":171,"_path":172},"Effortlessly Configure GitHub Repositories for Azure Deployment via OIDC","/posts/scripting-azure-ready-github-repository",{"title":174,"_path":175},"Playing with the .NET 8 Web API template","/posts/playing-with-dotnet8",{"title":177,"_path":178},"Another year of sharing and learning - Dev Retro 2023","/posts/2023-retro",{"title":180,"_path":181},"Week 4, 2024 - Tips I learned this week","/posts/w04-2024-tips-learned-this-week",{"title":183,"_path":184},"Using dependency injection with Azure .NET SDK","/posts/azure-sdk-di",{"title":186,"_path":187},"Having Fun With IT Event Calendars","/posts/it-event-calendars",{"title":189,"_path":190},"Call your Azure AD B2C protected API with authenticated HTTP requests from your JetBrains IDE","/posts/http-clients-oauth2","i-heroicons-newspaper",{"title":193,"_path":194,"children":195,"icon":199},"Goodies","/goodies",[196],{"title":197,"_path":198},"My Git Cheat Sheet","/goodies/gitcheatsheet","i-heroicons-gift-solid",{"title":201,"_path":202,"icon":203},"About","/about","i-heroicons-user-circle-solid",[205,207,209,211,214,217,220,223,226,229,231,234,237,240,242,244,247,250,253,255,258,261,264,267,270,273,276,279,282,285,287,289,292,294,297,300,303,305,308,310,313,316,319,322,325,327,329,332,335,338,341,344,347,350,353,356,359,361,363,366,369,372,375,377,380,383,385,388,391,394],[206,206],"tooling",[208,208],"vscode",[210,210],"rest",[212,213],"http","HTTP",[215,216],"razor","Razor",[218,219],"xamarin","Xamarin",[221,222],"templating","Templating",[224,225],"azure-cli","Azure CLI",[227,228],"azure","Azure",[230,230],"shell",[232,233],"github","GitHub",[235,236],"asp-net-core","ASP.NET Core",[238,239],"net",".NET",[241,241],"git",[243,243],"nushell",[245,246],"microsoft-teams","Microsoft Teams",[248,249],"powershell","PowerShell",[251,252],"azure-active-directory","Azure Active Directory",[254,254],"learning",[256,257],"azure-functions","Azure Functions",[259,260],"azure-key-vault","Azure Key Vault",[262,263],"configuration","Configuration",[265,266],"devops","DevOps",[268,269],"it","IT",[271,272],"tips-learned-this-week","tips learned this week",[274,275],"windows-terminal","Windows Terminal",[277,278],"azure-pipelines","Azure Pipelines",[280,281],"application-insights","Application Insights",[283,284],"azure-iot","Azure IoT",[286,286],"records",[288,288],"refit",[290,291],"development-box-setup","development box setup",[293,293],"winget",[295,296],"package-manager","package manager",[298,299],"azure-sql-database","Azure SQL Database",[301,302],"azure-sdk","Azure SDK",[304,304],"wingetcreate",[306,307],"github-actions","GitHub Actions",[309,309],"jq",[311,312],"pulumi","Pulumi",[314,315],"iac","IaC",[317,318],"azure-storage","Azure Storage",[320,321],"azure-signalr","Azure SignalR",[323,324],"visio","Visio",[326,326],"csharp",[328,328],"jest",[330,331],"statiq","Statiq",[333,334],"open-source","open source",[336,337],"visual-studio","Visual Studio",[339,340],"vue-js","Vue.js",[342,343],"azure-devops","Azure DevOps",[345,346],"vite","Vite",[348,349],"code-analysis","Code analysis",[351,352],"diagram","Diagram",[354,355],"terraform","Terraform",[357,358],"typescript","TypeScript",[360,360],"thoughts",[362,362],"pnpm",[364,365],"nuke","Nuke",[367,368],"pipelines","Pipelines",[370,371],"cicd","CI/CD",[373,374],"openid-connect","OpenID Connect",[376,376],"security",[378,379],"github-cli","GitHub CLI",[381,382],"microsoft-entra-id","Microsoft Entra ID",[384,384],"advent",[386,387],"finops","FinOps",[389,390],"anglesharp","AngleSharp",[392,393],"oauth2","OAuth2",[395,396],"azure-ad-b2c","Azure AD B2C",[398,1280,1534,2716,2937,3243,3677,3920,4190,5450,5821,6183,6362,6776],{"_path":181,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":180,"description":402,"lead":402,"date":403,"image":404,"badge":406,"tags":408,"ImageAttribution":409,"body":410,"_type":1275,"_id":1276,"_source":1277,"_file":1278,"_extension":1279},"posts",false,"","Some tips about Azure and Azure DevOps.","2024-01-29T00:00:00.000Z",{"src":405},"/images/surface_1.jpg",{"label":407},"Tips",[272,257,387,343],"Picture of \u003Ca href=\"https://unsplash.com/fr/@surface?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash\">Surface\u003C/a> on \u003Ca href=\"https://unsplash.com/fr/photos/appareil-surface-sur-la-table-taHYzvApW1o?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash\">Unsplash\u003C/a>",{"type":411,"children":412,"toc":1270},"root",[413,422,428,433,883,899,911,916,921,941,950,955,1140,1151,1161,1167,1172,1201,1206,1215,1221,1226,1231,1245,1254,1259,1264],{"type":414,"tag":415,"props":416,"children":418},"element","h2",{"id":417},"easily-debug-a-non-http-triggered-azure-function",[419],{"type":420,"value":421},"text","Easily debug a non-HTTP-triggered Azure Function",{"type":414,"tag":423,"props":424,"children":425},"p",{},[426],{"type":420,"value":427},"The other day, I wanted to locally debug a Queue-triggered function without manually adding a queue message to my local storage.",{"type":414,"tag":423,"props":429,"children":430},{},[431],{"type":420,"value":432},"My Azure Function looked like that:",{"type":414,"tag":434,"props":435,"children":438},"pre",{"className":436,"code":437,"language":326,"meta":401,"style":401},"language-csharp shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","public record Order(string Product,int Count);\n\npublic class ProcessOrder\n{\n    private readonly ILogger\u003CProcessOrder> _logger;\n\n    public ProcessOrder(ILogger\u003CProcessOrder> logger)\n    {\n        _logger = logger;\n    }\n\n    [Function(nameof(ProcessOrder))]\n    public void Run([QueueTrigger(\"orders\")] Order sentOrder)\n    {\n        _logger.LogInformation($\"Order contains {sentOrder.Count} {sentOrder.Product}\");\n    }\n}\n",[439],{"type":414,"tag":440,"props":441,"children":442},"code",{"__ignoreMap":401},[443,497,507,525,534,578,586,632,641,664,673,681,709,774,782,866,874],{"type":414,"tag":444,"props":445,"children":448},"span",{"class":446,"line":447},"line",1,[449,455,461,466,472,477,482,487,492],{"type":414,"tag":444,"props":450,"children":452},{"style":451},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[453],{"type":420,"value":454},"public",{"type":414,"tag":444,"props":456,"children":458},{"style":457},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[459],{"type":420,"value":460}," record",{"type":414,"tag":444,"props":462,"children":463},{"style":457},[464],{"type":420,"value":465}," Order",{"type":414,"tag":444,"props":467,"children":469},{"style":468},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[470],{"type":420,"value":471},"(",{"type":414,"tag":444,"props":473,"children":474},{"style":468},[475],{"type":420,"value":476},"string",{"type":414,"tag":444,"props":478,"children":479},{"style":457},[480],{"type":420,"value":481}," Product",{"type":414,"tag":444,"props":483,"children":484},{"style":468},[485],{"type":420,"value":486},",int",{"type":414,"tag":444,"props":488,"children":489},{"style":457},[490],{"type":420,"value":491}," Count",{"type":414,"tag":444,"props":493,"children":494},{"style":468},[495],{"type":420,"value":496},");\n",{"type":414,"tag":444,"props":498,"children":500},{"class":446,"line":499},2,[501],{"type":414,"tag":444,"props":502,"children":504},{"emptyLinePlaceholder":503},true,[505],{"type":420,"value":506},"\n",{"type":414,"tag":444,"props":508,"children":510},{"class":446,"line":509},3,[511,515,520],{"type":414,"tag":444,"props":512,"children":513},{"style":451},[514],{"type":420,"value":454},{"type":414,"tag":444,"props":516,"children":517},{"style":457},[518],{"type":420,"value":519}," class",{"type":414,"tag":444,"props":521,"children":522},{"style":457},[523],{"type":420,"value":524}," ProcessOrder\n",{"type":414,"tag":444,"props":526,"children":528},{"class":446,"line":527},4,[529],{"type":414,"tag":444,"props":530,"children":531},{"style":468},[532],{"type":420,"value":533},"{\n",{"type":414,"tag":444,"props":535,"children":537},{"class":446,"line":536},5,[538,543,548,553,558,563,568,573],{"type":414,"tag":444,"props":539,"children":540},{"style":451},[541],{"type":420,"value":542},"    private",{"type":414,"tag":444,"props":544,"children":545},{"style":451},[546],{"type":420,"value":547}," readonly",{"type":414,"tag":444,"props":549,"children":550},{"style":457},[551],{"type":420,"value":552}," ILogger",{"type":414,"tag":444,"props":554,"children":555},{"style":468},[556],{"type":420,"value":557},"\u003C",{"type":414,"tag":444,"props":559,"children":560},{"style":457},[561],{"type":420,"value":562},"ProcessOrder",{"type":414,"tag":444,"props":564,"children":565},{"style":468},[566],{"type":420,"value":567},">",{"type":414,"tag":444,"props":569,"children":570},{"style":457},[571],{"type":420,"value":572}," _logger",{"type":414,"tag":444,"props":574,"children":575},{"style":468},[576],{"type":420,"value":577},";\n",{"type":414,"tag":444,"props":579,"children":581},{"class":446,"line":580},6,[582],{"type":414,"tag":444,"props":583,"children":584},{"emptyLinePlaceholder":503},[585],{"type":420,"value":506},{"type":414,"tag":444,"props":587,"children":589},{"class":446,"line":588},7,[590,595,601,605,610,614,618,622,627],{"type":414,"tag":444,"props":591,"children":592},{"style":451},[593],{"type":420,"value":594},"    public",{"type":414,"tag":444,"props":596,"children":598},{"style":597},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[599],{"type":420,"value":600}," ProcessOrder",{"type":414,"tag":444,"props":602,"children":603},{"style":468},[604],{"type":420,"value":471},{"type":414,"tag":444,"props":606,"children":607},{"style":457},[608],{"type":420,"value":609},"ILogger",{"type":414,"tag":444,"props":611,"children":612},{"style":468},[613],{"type":420,"value":557},{"type":414,"tag":444,"props":615,"children":616},{"style":457},[617],{"type":420,"value":562},{"type":414,"tag":444,"props":619,"children":620},{"style":468},[621],{"type":420,"value":567},{"type":414,"tag":444,"props":623,"children":624},{"style":457},[625],{"type":420,"value":626}," logger",{"type":414,"tag":444,"props":628,"children":629},{"style":468},[630],{"type":420,"value":631},")\n",{"type":414,"tag":444,"props":633,"children":635},{"class":446,"line":634},8,[636],{"type":414,"tag":444,"props":637,"children":638},{"style":468},[639],{"type":420,"value":640},"    {\n",{"type":414,"tag":444,"props":642,"children":644},{"class":446,"line":643},9,[645,651,656,660],{"type":414,"tag":444,"props":646,"children":648},{"style":647},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[649],{"type":420,"value":650},"        _logger ",{"type":414,"tag":444,"props":652,"children":653},{"style":468},[654],{"type":420,"value":655},"=",{"type":414,"tag":444,"props":657,"children":658},{"style":647},[659],{"type":420,"value":626},{"type":414,"tag":444,"props":661,"children":662},{"style":468},[663],{"type":420,"value":577},{"type":414,"tag":444,"props":665,"children":667},{"class":446,"line":666},10,[668],{"type":414,"tag":444,"props":669,"children":670},{"style":468},[671],{"type":420,"value":672},"    }\n",{"type":414,"tag":444,"props":674,"children":676},{"class":446,"line":675},11,[677],{"type":414,"tag":444,"props":678,"children":679},{"emptyLinePlaceholder":503},[680],{"type":420,"value":506},{"type":414,"tag":444,"props":682,"children":684},{"class":446,"line":683},12,[685,690,695,700,704],{"type":414,"tag":444,"props":686,"children":687},{"style":468},[688],{"type":420,"value":689},"    [",{"type":414,"tag":444,"props":691,"children":692},{"style":457},[693],{"type":420,"value":694},"Function",{"type":414,"tag":444,"props":696,"children":697},{"style":468},[698],{"type":420,"value":699},"(nameof(",{"type":414,"tag":444,"props":701,"children":702},{"style":647},[703],{"type":420,"value":562},{"type":414,"tag":444,"props":705,"children":706},{"style":468},[707],{"type":420,"value":708},"))]\n",{"type":414,"tag":444,"props":710,"children":712},{"class":446,"line":711},13,[713,717,722,727,732,737,741,746,752,756,761,765,770],{"type":414,"tag":444,"props":714,"children":715},{"style":451},[716],{"type":420,"value":594},{"type":414,"tag":444,"props":718,"children":719},{"style":468},[720],{"type":420,"value":721}," void",{"type":414,"tag":444,"props":723,"children":724},{"style":597},[725],{"type":420,"value":726}," Run",{"type":414,"tag":444,"props":728,"children":729},{"style":468},[730],{"type":420,"value":731},"([",{"type":414,"tag":444,"props":733,"children":734},{"style":457},[735],{"type":420,"value":736},"QueueTrigger",{"type":414,"tag":444,"props":738,"children":739},{"style":468},[740],{"type":420,"value":471},{"type":414,"tag":444,"props":742,"children":743},{"style":468},[744],{"type":420,"value":745},"\"",{"type":414,"tag":444,"props":747,"children":749},{"style":748},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[750],{"type":420,"value":751},"orders",{"type":414,"tag":444,"props":753,"children":754},{"style":468},[755],{"type":420,"value":745},{"type":414,"tag":444,"props":757,"children":758},{"style":468},[759],{"type":420,"value":760},")]",{"type":414,"tag":444,"props":762,"children":763},{"style":457},[764],{"type":420,"value":465},{"type":414,"tag":444,"props":766,"children":767},{"style":457},[768],{"type":420,"value":769}," sentOrder",{"type":414,"tag":444,"props":771,"children":772},{"style":468},[773],{"type":420,"value":631},{"type":414,"tag":444,"props":775,"children":777},{"class":446,"line":776},14,[778],{"type":414,"tag":444,"props":779,"children":780},{"style":468},[781],{"type":420,"value":640},{"type":414,"tag":444,"props":783,"children":785},{"class":446,"line":784},15,[786,791,796,801,805,810,815,820,825,829,834,839,844,848,852,857,862],{"type":414,"tag":444,"props":787,"children":788},{"style":647},[789],{"type":420,"value":790},"        _logger",{"type":414,"tag":444,"props":792,"children":793},{"style":468},[794],{"type":420,"value":795},".",{"type":414,"tag":444,"props":797,"children":798},{"style":597},[799],{"type":420,"value":800},"LogInformation",{"type":414,"tag":444,"props":802,"children":803},{"style":468},[804],{"type":420,"value":471},{"type":414,"tag":444,"props":806,"children":807},{"style":468},[808],{"type":420,"value":809},"$\"",{"type":414,"tag":444,"props":811,"children":812},{"style":748},[813],{"type":420,"value":814},"Order contains ",{"type":414,"tag":444,"props":816,"children":817},{"style":468},[818],{"type":420,"value":819},"{",{"type":414,"tag":444,"props":821,"children":822},{"style":647},[823],{"type":420,"value":824},"sentOrder",{"type":414,"tag":444,"props":826,"children":827},{"style":468},[828],{"type":420,"value":795},{"type":414,"tag":444,"props":830,"children":831},{"style":647},[832],{"type":420,"value":833},"Count",{"type":414,"tag":444,"props":835,"children":836},{"style":468},[837],{"type":420,"value":838},"}",{"type":414,"tag":444,"props":840,"children":841},{"style":468},[842],{"type":420,"value":843}," {",{"type":414,"tag":444,"props":845,"children":846},{"style":647},[847],{"type":420,"value":824},{"type":414,"tag":444,"props":849,"children":850},{"style":468},[851],{"type":420,"value":795},{"type":414,"tag":444,"props":853,"children":854},{"style":647},[855],{"type":420,"value":856},"Product",{"type":414,"tag":444,"props":858,"children":859},{"style":468},[860],{"type":420,"value":861},"}\"",{"type":414,"tag":444,"props":863,"children":864},{"style":468},[865],{"type":420,"value":496},{"type":414,"tag":444,"props":867,"children":869},{"class":446,"line":868},16,[870],{"type":414,"tag":444,"props":871,"children":872},{"style":468},[873],{"type":420,"value":672},{"type":414,"tag":444,"props":875,"children":877},{"class":446,"line":876},17,[878],{"type":414,"tag":444,"props":879,"children":880},{"style":468},[881],{"type":420,"value":882},"}\n",{"type":414,"tag":423,"props":884,"children":885},{},[886,888,897],{"type":420,"value":887},"To trigger it, I could simply add a message in the order queue of my ",{"type":414,"tag":889,"props":890,"children":894},"a",{"href":891,"rel":892},"https://github.com/Azure/Azurite",[893],"nofollow",[895],{"type":420,"value":896},"storage emulator",{"type":420,"value":898}," like this:",{"type":414,"tag":423,"props":900,"children":901},{},[902],{"type":414,"tag":903,"props":904,"children":910},"img",{"alt":905,"className":906,"src":909},"Queue message in Azure Storage Explorer.",[907,908],"rounded-lg","mx-auto","/posts/images/w042024tips_storage.webp",[],{"type":414,"tag":423,"props":912,"children":913},{},[914],{"type":420,"value":915},"You may notice that I don't even have to go to the Azure Storage Explorer to add the message, I can do it directly in the IDE. However, call me lazy but I wanted to execute the function just by making an HTTP call, like we do for HTTP-triggered functions.",{"type":414,"tag":423,"props":917,"children":918},{},[919],{"type":420,"value":920},"This way, I could write the HTTP request in an HTTP file, commit it, and push it to my repository to share it with my colleagues, so they don't have to guess what message they should put in the queue to trigger the function.",{"type":414,"tag":423,"props":922,"children":923},{},[924,926,939],{"type":420,"value":925},"Fortunately, the ",{"type":414,"tag":889,"props":927,"children":930},{"href":928,"rel":929},"https://learn.microsoft.com/en-us/azure/azure-functions/functions-manually-run-non-http?tabs=azure-portal#define-the-request-location",[893],[931,937],{"type":414,"tag":932,"props":933,"children":934},"strong",{},[935],{"type":420,"value":936},"documentation",{"type":420,"value":938}," explains",{"type":420,"value":940}," how to do this.",{"type":414,"tag":423,"props":942,"children":943},{},[944],{"type":414,"tag":903,"props":945,"children":949},{"alt":946,"className":947,"src":948},"Define the request location: host name + folder path + function name.",[907,908],"/posts/images/w042024tips_function.webp",[],{"type":414,"tag":423,"props":951,"children":952},{},[953],{"type":420,"value":954},"Thus, for my use case, the resulting request is as follows:",{"type":414,"tag":434,"props":956,"children":959},{"className":957,"code":958,"language":212,"meta":401,"style":401},"language-http shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","POST http://localhost:7071/admin/functions/ProcessOrder HTTP/1.1\nContent-Type: application/json\n\n{\n  \"input\": \"{\\n  \\\"product\\\": \\\"laptop\\\",\\n  \\\"count\\\": 3\\n}\"\n}\n",[960],{"type":414,"tag":440,"props":961,"children":962},{"__ignoreMap":401},[963,992,1011,1018,1025,1133],{"type":414,"tag":444,"props":964,"children":965},{"class":446,"line":447},[966,972,977,982,987],{"type":414,"tag":444,"props":967,"children":969},{"style":968},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF;--shiki-light-font-style:italic;--shiki-default-font-style:italic;--shiki-dark-font-style:italic",[970],{"type":420,"value":971},"POST",{"type":414,"tag":444,"props":973,"children":974},{"style":647},[975],{"type":420,"value":976}," http://localhost:7071/admin/functions/ProcessOrder ",{"type":414,"tag":444,"props":978,"children":980},{"style":979},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[981],{"type":420,"value":213},{"type":414,"tag":444,"props":983,"children":984},{"style":647},[985],{"type":420,"value":986},"/",{"type":414,"tag":444,"props":988,"children":989},{"style":979},[990],{"type":420,"value":991},"1.1\n",{"type":414,"tag":444,"props":993,"children":994},{"class":446,"line":499},[995,1001,1006],{"type":414,"tag":444,"props":996,"children":998},{"style":997},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[999],{"type":420,"value":1000},"Content-Type",{"type":414,"tag":444,"props":1002,"children":1003},{"style":979},[1004],{"type":420,"value":1005},":",{"type":414,"tag":444,"props":1007,"children":1008},{"style":748},[1009],{"type":420,"value":1010}," application/json\n",{"type":414,"tag":444,"props":1012,"children":1013},{"class":446,"line":509},[1014],{"type":414,"tag":444,"props":1015,"children":1016},{"emptyLinePlaceholder":503},[1017],{"type":420,"value":506},{"type":414,"tag":444,"props":1019,"children":1020},{"class":446,"line":527},[1021],{"type":414,"tag":444,"props":1022,"children":1023},{"style":468},[1024],{"type":420,"value":533},{"type":414,"tag":444,"props":1026,"children":1027},{"class":446,"line":536},[1028,1033,1038,1042,1046,1051,1055,1060,1065,1070,1075,1080,1084,1089,1093,1098,1102,1106,1111,1115,1120,1124,1128],{"type":414,"tag":444,"props":1029,"children":1030},{"style":468},[1031],{"type":420,"value":1032},"  \"",{"type":414,"tag":444,"props":1034,"children":1035},{"style":451},[1036],{"type":420,"value":1037},"input",{"type":414,"tag":444,"props":1039,"children":1040},{"style":468},[1041],{"type":420,"value":745},{"type":414,"tag":444,"props":1043,"children":1044},{"style":468},[1045],{"type":420,"value":1005},{"type":414,"tag":444,"props":1047,"children":1048},{"style":468},[1049],{"type":420,"value":1050}," \"",{"type":414,"tag":444,"props":1052,"children":1053},{"style":748},[1054],{"type":420,"value":819},{"type":414,"tag":444,"props":1056,"children":1057},{"style":647},[1058],{"type":420,"value":1059},"\\n",{"type":414,"tag":444,"props":1061,"children":1062},{"style":647},[1063],{"type":420,"value":1064},"  \\\"",{"type":414,"tag":444,"props":1066,"children":1067},{"style":748},[1068],{"type":420,"value":1069},"product",{"type":414,"tag":444,"props":1071,"children":1072},{"style":647},[1073],{"type":420,"value":1074},"\\\"",{"type":414,"tag":444,"props":1076,"children":1077},{"style":748},[1078],{"type":420,"value":1079},": ",{"type":414,"tag":444,"props":1081,"children":1082},{"style":647},[1083],{"type":420,"value":1074},{"type":414,"tag":444,"props":1085,"children":1086},{"style":748},[1087],{"type":420,"value":1088},"laptop",{"type":414,"tag":444,"props":1090,"children":1091},{"style":647},[1092],{"type":420,"value":1074},{"type":414,"tag":444,"props":1094,"children":1095},{"style":748},[1096],{"type":420,"value":1097},",",{"type":414,"tag":444,"props":1099,"children":1100},{"style":647},[1101],{"type":420,"value":1059},{"type":414,"tag":444,"props":1103,"children":1104},{"style":647},[1105],{"type":420,"value":1064},{"type":414,"tag":444,"props":1107,"children":1108},{"style":748},[1109],{"type":420,"value":1110},"count",{"type":414,"tag":444,"props":1112,"children":1113},{"style":647},[1114],{"type":420,"value":1074},{"type":414,"tag":444,"props":1116,"children":1117},{"style":748},[1118],{"type":420,"value":1119},": 3",{"type":414,"tag":444,"props":1121,"children":1122},{"style":647},[1123],{"type":420,"value":1059},{"type":414,"tag":444,"props":1125,"children":1126},{"style":748},[1127],{"type":420,"value":838},{"type":414,"tag":444,"props":1129,"children":1130},{"style":468},[1131],{"type":420,"value":1132},"\"\n",{"type":414,"tag":444,"props":1134,"children":1135},{"class":446,"line":580},[1136],{"type":414,"tag":444,"props":1137,"children":1138},{"style":468},[1139],{"type":420,"value":882},{"type":414,"tag":423,"props":1141,"children":1142},{},[1143,1145,1150],{"type":420,"value":1144},"The content of your queue message goes in the value of the key \"input\" and ",{"type":414,"tag":932,"props":1146,"children":1147},{},[1148],{"type":420,"value":1149},"must be escaped",{"type":420,"value":795},{"type":414,"tag":1152,"props":1153,"children":1155},"callout",{"icon":1154},"i-fluent-emoji-flat-construction",[1156],{"type":414,"tag":423,"props":1157,"children":1158},{},[1159],{"type":420,"value":1160},"If like me, you skim through the documentation, you might miss the \"escape\" requirement and your request will fail so be sure to properly escape your content.",{"type":414,"tag":415,"props":1162,"children":1164},{"id":1163},"the-azure-devops-tip-you-did-not-know-about-azure-pipelines-tasks-name-conflicts",[1165],{"type":420,"value":1166},"The Azure DevOps tip you did not know about: Azure Pipelines tasks name conflicts",{"type":414,"tag":423,"props":1168,"children":1169},{},[1170],{"type":420,"value":1171},"I recently discovered that when you install extensions from the Azure DevOps marketplace, several Azure Pipelines tasks can have the same name. And if you use that name in your pipelines, Azure Pipelines won't know which task you are referring to and will prevent your pipeline from running.",{"type":414,"tag":423,"props":1173,"children":1174},{},[1175,1177,1184,1186,1192,1194,1200],{"type":420,"value":1176},"This can easily occur if you install multiple extensions for Terraform in your Azure DevOps organization. For instance, the extensions ",{"type":414,"tag":889,"props":1178,"children":1181},{"href":1179,"rel":1180},"https://marketplace.visualstudio.com/items?itemName=JasonBJohnson.azure-pipelines-tasks-terraform",[893],[1182],{"type":420,"value":1183},"Azure Pipelines Terraform Tasks",{"type":420,"value":1185}," from Jason Johnson and ",{"type":414,"tag":889,"props":1187,"children":1190},{"href":1188,"rel":1189},"https://marketplace.visualstudio.com/items?itemName=ms-devlabs.custom-terraform-tasks",[893],[1191],{"type":420,"value":355},{"type":420,"value":1193}," from Microsoft Dev Labs both have a task named the same way: ",{"type":414,"tag":440,"props":1195,"children":1197},{"className":1196},[],[1198],{"type":420,"value":1199},"TerraformInstaller",{"type":420,"value":795},{"type":414,"tag":423,"props":1202,"children":1203},{},[1204],{"type":420,"value":1205},"To avoid these conflicts, you must use the full name of the tasks in your pipelines. You can find their full names in the GitHub repository of the extensions. Another way is to use these tasks in a test Release and click on the \"View YAML\" button to see the full name of the task you added.",{"type":414,"tag":423,"props":1207,"children":1208},{},[1209],{"type":414,"tag":903,"props":1210,"children":1214},{"alt":1211,"className":1212,"src":1213},"Screenshot of a release in Azure DevOps.",[907,908],"/posts/images/w042024tips_ado_release.webp",[],{"type":414,"tag":415,"props":1216,"children":1218},{"id":1217},"using-metrics-to-understand-your-usage-of-azure-resources",[1219],{"type":420,"value":1220},"Using metrics to understand your usage of Azure resources",{"type":414,"tag":423,"props":1222,"children":1223},{},[1224],{"type":420,"value":1225},"I don't often use all my monthly free credits of my Azure subscription, but this month my spending limit was quickly reached and my subscription was disabled!",{"type":414,"tag":423,"props":1227,"children":1228},{},[1229],{"type":420,"value":1230},"The cost analysis tab of my subscription showed me that an Azure Maps Account resource was responsible for consuming most of my credits but didn't provide more details.",{"type":414,"tag":423,"props":1232,"children":1233},{},[1234,1236,1243],{"type":420,"value":1235},"So, I went to the Metrics tab of my resource and discovered that I could split the Usage metric by API name to determine exactly which Azure Maps API was heavily used by my applications. Combined with the ",{"type":414,"tag":889,"props":1237,"children":1240},{"href":1238,"rel":1239},"https://azure.microsoft.com/en-us/pricing/details/azure-maps/",[893],[1241],{"type":420,"value":1242},"pricing page",{"type":420,"value":1244},", I can deduce which API requests I'm making too frequently and, therefore how to optimize costs.",{"type":414,"tag":423,"props":1246,"children":1247},{},[1248],{"type":414,"tag":903,"props":1249,"children":1253},{"alt":1250,"className":1251,"src":1252},"Azure Maps usage metrics by API name.",[907,908],"/posts/images/w042024tips_azuremaps_metrics.webp",[],{"type":414,"tag":423,"props":1255,"children":1256},{},[1257],{"type":420,"value":1258},"Depending on the type of resource, you will use different metrics and split on different properties. Regardless, metrics can help you comprehend your resource usage and its associated cost.",{"type":414,"tag":423,"props":1260,"children":1261},{},[1262],{"type":420,"value":1263},"And that's it for this week, happy learning!",{"type":414,"tag":1265,"props":1266,"children":1267},"style",{},[1268],{"type":420,"value":1269},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":401,"searchDepth":499,"depth":499,"links":1271},[1272,1273,1274],{"id":417,"depth":499,"text":421},{"id":1163,"depth":499,"text":1166},{"id":1217,"depth":499,"text":1220},"markdown","content:1.posts:58.w04-2024-tips-learned-this-week.md","content","1.posts/58.w04-2024-tips-learned-this-week.md","md",{"_path":139,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":138,"description":1281,"lead":1281,"date":1282,"image":1283,"badge":1284,"tags":1285,"body":1286,"_type":1275,"_id":1532,"_source":1277,"_file":1533,"_extension":1279},"Some tips about .NET, pnpm, and Azure DevOps.","2022-11-20T00:00:00.000Z",{"src":405},{"label":407},[272,239,293,362,296,208,343,206],{"type":411,"children":1287,"toc":1527},[1288,1294,1308,1329,1352,1358,1389,1394,1404,1418,1427,1435,1440,1450,1458,1471,1477,1482,1492,1510,1519,1523],{"type":414,"tag":415,"props":1289,"children":1291},{"id":1290},"net-tip-of-the-week-install-net-7-using-winget",[1292],{"type":420,"value":1293},".NET tip of the week: install .NET 7 using winget",{"type":414,"tag":423,"props":1295,"children":1296},{},[1297,1299,1306],{"type":420,"value":1298},"This week, I installed .NET 7 on my laptop and I used ",{"type":414,"tag":889,"props":1300,"children":1303},{"href":1301,"rel":1302},"https://learn.microsoft.com/en-us/windows/package-manager/",[893],[1304],{"type":420,"value":1305},"Windows Package Manager",{"type":420,"value":1307}," for that:",{"type":414,"tag":434,"props":1309,"children":1312},{"className":1310,"code":1311,"language":248,"meta":401,"style":401},"language-powershell shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","winget install Microsoft.DotNet.SDK.7\n",[1313],{"type":414,"tag":440,"props":1314,"children":1315},{"__ignoreMap":401},[1316],{"type":414,"tag":444,"props":1317,"children":1318},{"class":446,"line":447},[1319,1324],{"type":414,"tag":444,"props":1320,"children":1321},{"style":647},[1322],{"type":420,"value":1323},"winget install Microsoft.DotNet.SDK.",{"type":414,"tag":444,"props":1325,"children":1326},{"style":979},[1327],{"type":420,"value":1328},"7\n",{"type":414,"tag":423,"props":1330,"children":1331},{},[1332,1334,1341,1343,1350],{"type":420,"value":1333},"I like winget, I have already written a few articles about it (you can find them ",{"type":414,"tag":889,"props":1335,"children":1338},{"href":1336,"rel":1337},"https://www.techwatching.dev/tags/winget/",[893],[1339],{"type":420,"value":1340},"here",{"type":420,"value":1342},") so I am really glad to see that we can now use winget to install .NET (whether it be the SDKs or the runtimes). You can check ",{"type":414,"tag":889,"props":1344,"children":1347},{"href":1345,"rel":1346},"https://devblogs.microsoft.com/dotnet/dotnet-now-on-windows-package-manager/",[893],[1348],{"type":420,"value":1349},"Microsoft's article",{"type":420,"value":1351}," announcing it for more information.",{"type":414,"tag":415,"props":1353,"children":1355},{"id":1354},"tool-of-the-week-pnpm",[1356],{"type":420,"value":1357},"Tool of the week: pnpm",{"type":414,"tag":423,"props":1359,"children":1360},{},[1361,1363,1369,1371,1378,1380,1387],{"type":420,"value":1362},"I don't know which JavaScript package manager you are using but since I tried ",{"type":414,"tag":889,"props":1364,"children":1367},{"href":1365,"rel":1366},"https://pnpm.io/",[893],[1368],{"type":420,"value":362},{"type":420,"value":1370}," I don't want to use anything else because it's so fast! If you are interested to know why it's so fast and better than npm for instance, you can watch the talk ",{"type":414,"tag":889,"props":1372,"children":1375},{"href":1373,"rel":1374},"https://viteconf.org/2022/replay/pnpm",[893],[1376],{"type":420,"value":1377},"\"What makes pnpm performant\"",{"type":420,"value":1379}," that Zoltan Kochan gave at Vite Conf. Many ",{"type":414,"tag":889,"props":1381,"children":1384},{"href":1382,"rel":1383},"https://pnpm.io/workspaces#usage-examples",[893],[1385],{"type":420,"value":1386},"popular open-source projects",{"type":420,"value":1388}," like Vite and Vue are using pnpm.",{"type":414,"tag":423,"props":1390,"children":1391},{},[1392],{"type":420,"value":1393},"Here are some tips about pnpm:",{"type":414,"tag":1395,"props":1396,"children":1397},"ol",{},[1398],{"type":414,"tag":1399,"props":1400,"children":1401},"li",{},[1402],{"type":420,"value":1403},"You can use pnpm to manage Node.js versions on your machine",{"type":414,"tag":423,"props":1405,"children":1406},{},[1407,1409,1416],{"type":420,"value":1408},"Previously, I was using ",{"type":414,"tag":889,"props":1410,"children":1413},{"href":1411,"rel":1412},"https://github.com/coreybutler/nvm-windows",[893],[1414],{"type":420,"value":1415},"nvm-windows",{"type":420,"value":1417}," to manage multiple installation of Node.js on my laptop and it worked fine. Yet I can now do that directly using pnpm env command:",{"type":414,"tag":423,"props":1419,"children":1420},{},[1421],{"type":414,"tag":903,"props":1422,"children":1426},{"alt":1423,"className":1424,"src":1425},"Output of the pnpm env command in a terminal.",[907,908],"/posts/images/w462022tips_pnpm_env.png",[],{"type":414,"tag":1395,"props":1428,"children":1429},{"start":499},[1430],{"type":414,"tag":1399,"props":1431,"children":1432},{},[1433],{"type":420,"value":1434},"You can configure vscode to run npm scripts using pnpm",{"type":414,"tag":423,"props":1436,"children":1437},{},[1438],{"type":420,"value":1439},"A lot of the people I know don't use the scripts explorer of vscode to run the scripts contained in the package.json file of the project opened in vscode. It's a pity because it is an handy feature. And you can configure it in your settings to run scripts using a specific package manager, pnpm in my case.",{"type":414,"tag":423,"props":1441,"children":1442},{},[1443],{"type":414,"tag":903,"props":1444,"children":1449},{"alt":1445,"className":1446,"src":1447,"width":1448},"Npm scripts view in vscode editor.",[907,908],"/posts/images/w462022tips_pnpm_scripts.png",600,[],{"type":414,"tag":1395,"props":1451,"children":1452},{"start":509},[1453],{"type":414,"tag":1399,"props":1454,"children":1455},{},[1456],{"type":420,"value":1457},"With pnpm, you can use aliases for packages you install",{"type":414,"tag":423,"props":1459,"children":1460},{},[1461,1463,1469],{"type":420,"value":1462},"Check the ",{"type":414,"tag":889,"props":1464,"children":1467},{"href":1465,"rel":1466},"https://pnpm.io/aliases",[893],[1468],{"type":420,"value":936},{"type":420,"value":1470}," to see why and how to use this feature.",{"type":414,"tag":415,"props":1472,"children":1474},{"id":1473},"the-gitlensazure-devops-tip-you-did-not-know-about-autolinks",[1475],{"type":420,"value":1476},"The GitLens/Azure DevOps tip you did not know about: autolinks",{"type":414,"tag":423,"props":1478,"children":1479},{},[1480],{"type":420,"value":1481},"GitLens, the awesome extension for vscode has a nice feature called \"autolinks\" that can make external references in your commit messages clickable links.",{"type":414,"tag":423,"props":1483,"children":1484},{},[1485],{"type":414,"tag":903,"props":1486,"children":1491},{"alt":1487,"className":1488,"src":1489,"width":1490},"Autolinks GitLens settings view in vscode.",[907,908],"/posts/images/w462022tips_gitlens_autolink_1.png",1000,[],{"type":414,"tag":423,"props":1493,"children":1494},{},[1495,1497,1504],{"type":420,"value":1496},"If you are using Azure DevOps, this feature can become very handy for you commit messages that contain references to work items (usually an hasjtag followed by the work item number). You just have to configure # as the prefix and ",{"type":414,"tag":889,"props":1498,"children":1501},{"href":1499,"rel":1500},"https://dev.azure.com/%7BorganizationName%7D/%7BprojectName%7D/_workitems/edit/",[893],[1502],{"type":420,"value":1503},"https://dev.azure.com/{organizationName}/{projectName}/_workitems/edit/",{"type":414,"tag":1505,"props":1506,"children":1507},"num",{},[1508],{"type":420,"value":1509}," as the URL) to make it work.",{"type":414,"tag":423,"props":1511,"children":1512},{},[1513],{"type":414,"tag":903,"props":1514,"children":1518},{"alt":1515,"className":1516,"src":1517,"width":1490},"A commit GitLens popin in vscode with an Azure DevOps link.",[907,908],"/posts/images/w462022tips_gitlens_autolink_2.png",[],{"type":414,"tag":423,"props":1520,"children":1521},{},[1522],{"type":420,"value":1263},{"type":414,"tag":1265,"props":1524,"children":1525},{},[1526],{"type":420,"value":1269},{"title":401,"searchDepth":499,"depth":499,"links":1528},[1529,1530,1531],{"id":1290,"depth":499,"text":1293},{"id":1354,"depth":499,"text":1357},{"id":1473,"depth":499,"text":1476},"content:1.posts:44.w46-2022-tips-learned-this-week.md","1.posts/44.w46-2022-tips-learned-this-week.md",{"_path":121,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":120,"description":1535,"lead":1535,"date":1536,"image":1537,"badge":1538,"tags":1539,"body":1540,"_type":1275,"_id":2714,"_source":1277,"_file":2715,"_extension":1279},"The \"this\" in TypeScript, a must-have tool for Durable Functions, and a new git alias.","2022-05-23T00:00:00.000Z",{"src":405},{"label":407},[272,358,241,257,206],{"type":411,"children":1541,"toc":2708},[1542,1554,1575,1580,1805,1840,1866,1973,1982,2002,2115,2148,2551,2557,2571,2580,2592,2601,2607,2621,2665,2700,2704],{"type":414,"tag":415,"props":1543,"children":1545},{"id":1544},"reminder-for-my-future-self-dont-forget-about-this-in-ts",[1546,1548],{"type":420,"value":1547},"Reminder for my future self: don't forget about \"this\" in ",{"type":414,"tag":440,"props":1549,"children":1551},{"className":1550},[],[1552],{"type":420,"value":1553},"ts",{"type":414,"tag":423,"props":1555,"children":1556},{},[1557,1559,1565,1567,1573],{"type":420,"value":1558},"Once again, I found myself forgetting that ",{"type":414,"tag":440,"props":1560,"children":1562},{"className":1561},[],[1563],{"type":420,"value":1564},"this",{"type":420,"value":1566}," can lose context in JavaScript/TypeScript which results in exceptions because ",{"type":414,"tag":440,"props":1568,"children":1570},{"className":1569},[],[1571],{"type":420,"value":1572},"this ",{"type":420,"value":1574}," is undefined. This is probably obvious for most developers but this is not a case I come across often so it's better to write it down so that I have something to refer to next time.",{"type":414,"tag":423,"props":1576,"children":1577},{},[1578],{"type":420,"value":1579},"Let's take an example:",{"type":414,"tag":434,"props":1581,"children":1584},{"className":1582,"code":1583,"language":1553,"meta":401,"style":401},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","class AudioBook {\n    private isStarted = false;\n\n    constructor(public title: string) {\n    }\n    \n    play() {\n        this.isStarted = true;\n    }\n\n    stop() {\n        this.isStarted = false;\n    }\n}\n",[1585],{"type":414,"tag":440,"props":1586,"children":1587},{"__ignoreMap":401},[1588,1606,1633,1640,1680,1687,1695,1712,1738,1745,1752,1768,1791,1798],{"type":414,"tag":444,"props":1589,"children":1590},{"class":446,"line":447},[1591,1596,1601],{"type":414,"tag":444,"props":1592,"children":1593},{"style":451},[1594],{"type":420,"value":1595},"class",{"type":414,"tag":444,"props":1597,"children":1598},{"style":457},[1599],{"type":420,"value":1600}," AudioBook",{"type":414,"tag":444,"props":1602,"children":1603},{"style":468},[1604],{"type":420,"value":1605}," {\n",{"type":414,"tag":444,"props":1607,"children":1608},{"class":446,"line":499},[1609,1613,1618,1623,1629],{"type":414,"tag":444,"props":1610,"children":1611},{"style":451},[1612],{"type":420,"value":542},{"type":414,"tag":444,"props":1614,"children":1615},{"style":997},[1616],{"type":420,"value":1617}," isStarted",{"type":414,"tag":444,"props":1619,"children":1620},{"style":468},[1621],{"type":420,"value":1622}," =",{"type":414,"tag":444,"props":1624,"children":1626},{"style":1625},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[1627],{"type":420,"value":1628}," false",{"type":414,"tag":444,"props":1630,"children":1631},{"style":468},[1632],{"type":420,"value":577},{"type":414,"tag":444,"props":1634,"children":1635},{"class":446,"line":509},[1636],{"type":414,"tag":444,"props":1637,"children":1638},{"emptyLinePlaceholder":503},[1639],{"type":420,"value":506},{"type":414,"tag":444,"props":1641,"children":1642},{"class":446,"line":527},[1643,1648,1652,1656,1662,1666,1671,1676],{"type":414,"tag":444,"props":1644,"children":1645},{"style":451},[1646],{"type":420,"value":1647},"    constructor",{"type":414,"tag":444,"props":1649,"children":1650},{"style":468},[1651],{"type":420,"value":471},{"type":414,"tag":444,"props":1653,"children":1654},{"style":451},[1655],{"type":420,"value":454},{"type":414,"tag":444,"props":1657,"children":1659},{"style":1658},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8;--shiki-light-font-style:italic;--shiki-default-font-style:italic;--shiki-dark-font-style:italic",[1660],{"type":420,"value":1661}," title",{"type":414,"tag":444,"props":1663,"children":1664},{"style":468},[1665],{"type":420,"value":1005},{"type":414,"tag":444,"props":1667,"children":1668},{"style":457},[1669],{"type":420,"value":1670}," string",{"type":414,"tag":444,"props":1672,"children":1673},{"style":468},[1674],{"type":420,"value":1675},")",{"type":414,"tag":444,"props":1677,"children":1678},{"style":468},[1679],{"type":420,"value":1605},{"type":414,"tag":444,"props":1681,"children":1682},{"class":446,"line":536},[1683],{"type":414,"tag":444,"props":1684,"children":1685},{"style":468},[1686],{"type":420,"value":672},{"type":414,"tag":444,"props":1688,"children":1689},{"class":446,"line":580},[1690],{"type":414,"tag":444,"props":1691,"children":1692},{"style":647},[1693],{"type":420,"value":1694},"    \n",{"type":414,"tag":444,"props":1696,"children":1697},{"class":446,"line":588},[1698,1703,1708],{"type":414,"tag":444,"props":1699,"children":1700},{"style":997},[1701],{"type":420,"value":1702},"    play",{"type":414,"tag":444,"props":1704,"children":1705},{"style":468},[1706],{"type":420,"value":1707},"()",{"type":414,"tag":444,"props":1709,"children":1710},{"style":468},[1711],{"type":420,"value":1605},{"type":414,"tag":444,"props":1713,"children":1714},{"class":446,"line":634},[1715,1720,1725,1729,1734],{"type":414,"tag":444,"props":1716,"children":1717},{"style":468},[1718],{"type":420,"value":1719},"        this.",{"type":414,"tag":444,"props":1721,"children":1722},{"style":647},[1723],{"type":420,"value":1724},"isStarted",{"type":414,"tag":444,"props":1726,"children":1727},{"style":468},[1728],{"type":420,"value":1622},{"type":414,"tag":444,"props":1730,"children":1731},{"style":1625},[1732],{"type":420,"value":1733}," true",{"type":414,"tag":444,"props":1735,"children":1736},{"style":468},[1737],{"type":420,"value":577},{"type":414,"tag":444,"props":1739,"children":1740},{"class":446,"line":643},[1741],{"type":414,"tag":444,"props":1742,"children":1743},{"style":468},[1744],{"type":420,"value":672},{"type":414,"tag":444,"props":1746,"children":1747},{"class":446,"line":666},[1748],{"type":414,"tag":444,"props":1749,"children":1750},{"emptyLinePlaceholder":503},[1751],{"type":420,"value":506},{"type":414,"tag":444,"props":1753,"children":1754},{"class":446,"line":675},[1755,1760,1764],{"type":414,"tag":444,"props":1756,"children":1757},{"style":997},[1758],{"type":420,"value":1759},"    stop",{"type":414,"tag":444,"props":1761,"children":1762},{"style":468},[1763],{"type":420,"value":1707},{"type":414,"tag":444,"props":1765,"children":1766},{"style":468},[1767],{"type":420,"value":1605},{"type":414,"tag":444,"props":1769,"children":1770},{"class":446,"line":683},[1771,1775,1779,1783,1787],{"type":414,"tag":444,"props":1772,"children":1773},{"style":468},[1774],{"type":420,"value":1719},{"type":414,"tag":444,"props":1776,"children":1777},{"style":647},[1778],{"type":420,"value":1724},{"type":414,"tag":444,"props":1780,"children":1781},{"style":468},[1782],{"type":420,"value":1622},{"type":414,"tag":444,"props":1784,"children":1785},{"style":1625},[1786],{"type":420,"value":1628},{"type":414,"tag":444,"props":1788,"children":1789},{"style":468},[1790],{"type":420,"value":577},{"type":414,"tag":444,"props":1792,"children":1793},{"class":446,"line":711},[1794],{"type":414,"tag":444,"props":1795,"children":1796},{"style":468},[1797],{"type":420,"value":672},{"type":414,"tag":444,"props":1799,"children":1800},{"class":446,"line":776},[1801],{"type":414,"tag":444,"props":1802,"children":1803},{"style":468},[1804],{"type":420,"value":882},{"type":414,"tag":423,"props":1806,"children":1807},{},[1808,1810,1816,1818,1823,1825,1831,1833,1839],{"type":420,"value":1809},"This is a class ",{"type":414,"tag":440,"props":1811,"children":1813},{"className":1812},[],[1814],{"type":420,"value":1815},"AudioBook",{"type":420,"value":1817}," that has a private boolean field ",{"type":414,"tag":440,"props":1819,"children":1821},{"className":1820},[],[1822],{"type":420,"value":1724},{"type":420,"value":1824}," that is modified by the two methods ",{"type":414,"tag":440,"props":1826,"children":1828},{"className":1827},[],[1829],{"type":420,"value":1830},"play",{"type":420,"value":1832}," and ",{"type":414,"tag":440,"props":1834,"children":1836},{"className":1835},[],[1837],{"type":420,"value":1838},"stop",{"type":420,"value":795},{"type":414,"tag":423,"props":1841,"children":1842},{},[1843,1845,1850,1852,1857,1859,1864],{"type":420,"value":1844},"If I create an instance of ",{"type":414,"tag":440,"props":1846,"children":1848},{"className":1847},[],[1849],{"type":420,"value":1815},{"type":420,"value":1851}," and I want to assign the ",{"type":414,"tag":440,"props":1853,"children":1855},{"className":1854},[],[1856],{"type":420,"value":1830},{"type":420,"value":1858}," function to a variable, an exception will occur when the function is run because ",{"type":414,"tag":440,"props":1860,"children":1862},{"className":1861},[],[1863],{"type":420,"value":1564},{"type":420,"value":1865}," will be undefined.",{"type":414,"tag":434,"props":1867,"children":1869},{"className":1582,"code":1868,"language":1553,"meta":401,"style":401},"const audioBook = new AudioBook(\"The Unicorn Project\");\nconst listenDevOpsBook = audioBook.play;\nlistenDevOpsBook();\n",[1870],{"type":414,"tag":440,"props":1871,"children":1872},{"__ignoreMap":401},[1873,1924,1957],{"type":414,"tag":444,"props":1874,"children":1875},{"class":446,"line":447},[1876,1881,1886,1890,1895,1899,1903,1907,1912,1916,1920],{"type":414,"tag":444,"props":1877,"children":1878},{"style":451},[1879],{"type":420,"value":1880},"const",{"type":414,"tag":444,"props":1882,"children":1883},{"style":647},[1884],{"type":420,"value":1885}," audioBook ",{"type":414,"tag":444,"props":1887,"children":1888},{"style":468},[1889],{"type":420,"value":655},{"type":414,"tag":444,"props":1891,"children":1892},{"style":468},[1893],{"type":420,"value":1894}," new",{"type":414,"tag":444,"props":1896,"children":1897},{"style":597},[1898],{"type":420,"value":1600},{"type":414,"tag":444,"props":1900,"children":1901},{"style":647},[1902],{"type":420,"value":471},{"type":414,"tag":444,"props":1904,"children":1905},{"style":468},[1906],{"type":420,"value":745},{"type":414,"tag":444,"props":1908,"children":1909},{"style":748},[1910],{"type":420,"value":1911},"The Unicorn Project",{"type":414,"tag":444,"props":1913,"children":1914},{"style":468},[1915],{"type":420,"value":745},{"type":414,"tag":444,"props":1917,"children":1918},{"style":647},[1919],{"type":420,"value":1675},{"type":414,"tag":444,"props":1921,"children":1922},{"style":468},[1923],{"type":420,"value":577},{"type":414,"tag":444,"props":1925,"children":1926},{"class":446,"line":499},[1927,1931,1936,1940,1945,1949,1953],{"type":414,"tag":444,"props":1928,"children":1929},{"style":451},[1930],{"type":420,"value":1880},{"type":414,"tag":444,"props":1932,"children":1933},{"style":647},[1934],{"type":420,"value":1935}," listenDevOpsBook ",{"type":414,"tag":444,"props":1937,"children":1938},{"style":468},[1939],{"type":420,"value":655},{"type":414,"tag":444,"props":1941,"children":1942},{"style":647},[1943],{"type":420,"value":1944}," audioBook",{"type":414,"tag":444,"props":1946,"children":1947},{"style":468},[1948],{"type":420,"value":795},{"type":414,"tag":444,"props":1950,"children":1951},{"style":647},[1952],{"type":420,"value":1830},{"type":414,"tag":444,"props":1954,"children":1955},{"style":468},[1956],{"type":420,"value":577},{"type":414,"tag":444,"props":1958,"children":1959},{"class":446,"line":509},[1960,1965,1969],{"type":414,"tag":444,"props":1961,"children":1962},{"style":597},[1963],{"type":420,"value":1964},"listenDevOpsBook",{"type":414,"tag":444,"props":1966,"children":1967},{"style":647},[1968],{"type":420,"value":1707},{"type":414,"tag":444,"props":1970,"children":1971},{"style":468},[1972],{"type":420,"value":577},{"type":414,"tag":423,"props":1974,"children":1975},{},[1976],{"type":414,"tag":903,"props":1977,"children":1981},{"alt":1978,"className":1979,"src":1980},"JavaScript Failed error in console output.",[907,908],"/posts/images/w202022tips_this_1.png",[],{"type":414,"tag":423,"props":1983,"children":1984},{},[1985,1987,1994,1996,2001],{"type":420,"value":1986},"The solution to avoid that is to use the ",{"type":414,"tag":889,"props":1988,"children":1991},{"href":1989,"rel":1990},"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind",[893],[1992],{"type":420,"value":1993},"bind",{"type":420,"value":1995}," function to specify the object to use as ",{"type":414,"tag":440,"props":1997,"children":1999},{"className":1998},[],[2000],{"type":420,"value":1564},{"type":420,"value":795},{"type":414,"tag":434,"props":2003,"children":2005},{"className":1582,"code":2004,"language":1553,"meta":401,"style":401},"const audioBook = new AudioBook(\"The Unicorn Project\");\nconst listenDevOpsBook = audioBook.play.bind(audioBook);\nlistenDevOpsBook();\n",[2006],{"type":414,"tag":440,"props":2007,"children":2008},{"__ignoreMap":401},[2009,2056,2100],{"type":414,"tag":444,"props":2010,"children":2011},{"class":446,"line":447},[2012,2016,2020,2024,2028,2032,2036,2040,2044,2048,2052],{"type":414,"tag":444,"props":2013,"children":2014},{"style":451},[2015],{"type":420,"value":1880},{"type":414,"tag":444,"props":2017,"children":2018},{"style":647},[2019],{"type":420,"value":1885},{"type":414,"tag":444,"props":2021,"children":2022},{"style":468},[2023],{"type":420,"value":655},{"type":414,"tag":444,"props":2025,"children":2026},{"style":468},[2027],{"type":420,"value":1894},{"type":414,"tag":444,"props":2029,"children":2030},{"style":597},[2031],{"type":420,"value":1600},{"type":414,"tag":444,"props":2033,"children":2034},{"style":647},[2035],{"type":420,"value":471},{"type":414,"tag":444,"props":2037,"children":2038},{"style":468},[2039],{"type":420,"value":745},{"type":414,"tag":444,"props":2041,"children":2042},{"style":748},[2043],{"type":420,"value":1911},{"type":414,"tag":444,"props":2045,"children":2046},{"style":468},[2047],{"type":420,"value":745},{"type":414,"tag":444,"props":2049,"children":2050},{"style":647},[2051],{"type":420,"value":1675},{"type":414,"tag":444,"props":2053,"children":2054},{"style":468},[2055],{"type":420,"value":577},{"type":414,"tag":444,"props":2057,"children":2058},{"class":446,"line":499},[2059,2063,2067,2071,2075,2079,2083,2087,2091,2096],{"type":414,"tag":444,"props":2060,"children":2061},{"style":451},[2062],{"type":420,"value":1880},{"type":414,"tag":444,"props":2064,"children":2065},{"style":647},[2066],{"type":420,"value":1935},{"type":414,"tag":444,"props":2068,"children":2069},{"style":468},[2070],{"type":420,"value":655},{"type":414,"tag":444,"props":2072,"children":2073},{"style":647},[2074],{"type":420,"value":1944},{"type":414,"tag":444,"props":2076,"children":2077},{"style":468},[2078],{"type":420,"value":795},{"type":414,"tag":444,"props":2080,"children":2081},{"style":647},[2082],{"type":420,"value":1830},{"type":414,"tag":444,"props":2084,"children":2085},{"style":468},[2086],{"type":420,"value":795},{"type":414,"tag":444,"props":2088,"children":2089},{"style":597},[2090],{"type":420,"value":1993},{"type":414,"tag":444,"props":2092,"children":2093},{"style":647},[2094],{"type":420,"value":2095},"(audioBook)",{"type":414,"tag":444,"props":2097,"children":2098},{"style":468},[2099],{"type":420,"value":577},{"type":414,"tag":444,"props":2101,"children":2102},{"class":446,"line":509},[2103,2107,2111],{"type":414,"tag":444,"props":2104,"children":2105},{"style":597},[2106],{"type":420,"value":1964},{"type":414,"tag":444,"props":2108,"children":2109},{"style":647},[2110],{"type":420,"value":1707},{"type":414,"tag":444,"props":2112,"children":2113},{"style":468},[2114],{"type":420,"value":577},{"type":414,"tag":423,"props":2116,"children":2117},{},[2118,2120,2125,2127,2132,2134,2139,2141,2146],{"type":420,"value":2119},"To avoid having to use bind everywhere the ",{"type":414,"tag":440,"props":2121,"children":2123},{"className":2122},[],[2124],{"type":420,"value":1830},{"type":420,"value":2126}," or the ",{"type":414,"tag":440,"props":2128,"children":2130},{"className":2129},[],[2131],{"type":420,"value":1838},{"type":420,"value":2133}," methods are used, we can do the ",{"type":414,"tag":440,"props":2135,"children":2137},{"className":2136},[],[2138],{"type":420,"value":1993},{"type":420,"value":2140}," thing directly in the constructor of the ",{"type":414,"tag":440,"props":2142,"children":2144},{"className":2143},[],[2145],{"type":420,"value":1815},{"type":420,"value":2147}," class.",{"type":414,"tag":434,"props":2149,"children":2151},{"className":1582,"code":2150,"language":1553,"meta":401,"style":401},"class AudioBook {\n    private isStarted = false;\n\n    constructor(public title: string) {\n        this.play = this.play.bind(this);\n        this.stop = this.stop.bind(this);\n    }\n    \n    play() {\n        this.isStarted = true;\n    }\n\n    stop() {\n        this.isStarted = false;\n    }\n}\n\nconst audioBook = new AudioBook(\"The Unicorn Project\");\nconst listenDevOpsBook = audioBook.play;\nlistenDevOpsBook();\n",[2152],{"type":414,"tag":440,"props":2153,"children":2154},{"__ignoreMap":401},[2155,2170,2193,2200,2235,2283,2330,2337,2344,2359,2382,2389,2396,2411,2434,2441,2448,2455,2503,2535],{"type":414,"tag":444,"props":2156,"children":2157},{"class":446,"line":447},[2158,2162,2166],{"type":414,"tag":444,"props":2159,"children":2160},{"style":451},[2161],{"type":420,"value":1595},{"type":414,"tag":444,"props":2163,"children":2164},{"style":457},[2165],{"type":420,"value":1600},{"type":414,"tag":444,"props":2167,"children":2168},{"style":468},[2169],{"type":420,"value":1605},{"type":414,"tag":444,"props":2171,"children":2172},{"class":446,"line":499},[2173,2177,2181,2185,2189],{"type":414,"tag":444,"props":2174,"children":2175},{"style":451},[2176],{"type":420,"value":542},{"type":414,"tag":444,"props":2178,"children":2179},{"style":997},[2180],{"type":420,"value":1617},{"type":414,"tag":444,"props":2182,"children":2183},{"style":468},[2184],{"type":420,"value":1622},{"type":414,"tag":444,"props":2186,"children":2187},{"style":1625},[2188],{"type":420,"value":1628},{"type":414,"tag":444,"props":2190,"children":2191},{"style":468},[2192],{"type":420,"value":577},{"type":414,"tag":444,"props":2194,"children":2195},{"class":446,"line":509},[2196],{"type":414,"tag":444,"props":2197,"children":2198},{"emptyLinePlaceholder":503},[2199],{"type":420,"value":506},{"type":414,"tag":444,"props":2201,"children":2202},{"class":446,"line":527},[2203,2207,2211,2215,2219,2223,2227,2231],{"type":414,"tag":444,"props":2204,"children":2205},{"style":451},[2206],{"type":420,"value":1647},{"type":414,"tag":444,"props":2208,"children":2209},{"style":468},[2210],{"type":420,"value":471},{"type":414,"tag":444,"props":2212,"children":2213},{"style":451},[2214],{"type":420,"value":454},{"type":414,"tag":444,"props":2216,"children":2217},{"style":1658},[2218],{"type":420,"value":1661},{"type":414,"tag":444,"props":2220,"children":2221},{"style":468},[2222],{"type":420,"value":1005},{"type":414,"tag":444,"props":2224,"children":2225},{"style":457},[2226],{"type":420,"value":1670},{"type":414,"tag":444,"props":2228,"children":2229},{"style":468},[2230],{"type":420,"value":1675},{"type":414,"tag":444,"props":2232,"children":2233},{"style":468},[2234],{"type":420,"value":1605},{"type":414,"tag":444,"props":2236,"children":2237},{"class":446,"line":536},[2238,2242,2246,2250,2255,2259,2263,2267,2271,2275,2279],{"type":414,"tag":444,"props":2239,"children":2240},{"style":468},[2241],{"type":420,"value":1719},{"type":414,"tag":444,"props":2243,"children":2244},{"style":647},[2245],{"type":420,"value":1830},{"type":414,"tag":444,"props":2247,"children":2248},{"style":468},[2249],{"type":420,"value":1622},{"type":414,"tag":444,"props":2251,"children":2252},{"style":468},[2253],{"type":420,"value":2254}," this.",{"type":414,"tag":444,"props":2256,"children":2257},{"style":647},[2258],{"type":420,"value":1830},{"type":414,"tag":444,"props":2260,"children":2261},{"style":468},[2262],{"type":420,"value":795},{"type":414,"tag":444,"props":2264,"children":2265},{"style":597},[2266],{"type":420,"value":1993},{"type":414,"tag":444,"props":2268,"children":2269},{"style":997},[2270],{"type":420,"value":471},{"type":414,"tag":444,"props":2272,"children":2273},{"style":468},[2274],{"type":420,"value":1564},{"type":414,"tag":444,"props":2276,"children":2277},{"style":997},[2278],{"type":420,"value":1675},{"type":414,"tag":444,"props":2280,"children":2281},{"style":468},[2282],{"type":420,"value":577},{"type":414,"tag":444,"props":2284,"children":2285},{"class":446,"line":580},[2286,2290,2294,2298,2302,2306,2310,2314,2318,2322,2326],{"type":414,"tag":444,"props":2287,"children":2288},{"style":468},[2289],{"type":420,"value":1719},{"type":414,"tag":444,"props":2291,"children":2292},{"style":647},[2293],{"type":420,"value":1838},{"type":414,"tag":444,"props":2295,"children":2296},{"style":468},[2297],{"type":420,"value":1622},{"type":414,"tag":444,"props":2299,"children":2300},{"style":468},[2301],{"type":420,"value":2254},{"type":414,"tag":444,"props":2303,"children":2304},{"style":647},[2305],{"type":420,"value":1838},{"type":414,"tag":444,"props":2307,"children":2308},{"style":468},[2309],{"type":420,"value":795},{"type":414,"tag":444,"props":2311,"children":2312},{"style":597},[2313],{"type":420,"value":1993},{"type":414,"tag":444,"props":2315,"children":2316},{"style":997},[2317],{"type":420,"value":471},{"type":414,"tag":444,"props":2319,"children":2320},{"style":468},[2321],{"type":420,"value":1564},{"type":414,"tag":444,"props":2323,"children":2324},{"style":997},[2325],{"type":420,"value":1675},{"type":414,"tag":444,"props":2327,"children":2328},{"style":468},[2329],{"type":420,"value":577},{"type":414,"tag":444,"props":2331,"children":2332},{"class":446,"line":588},[2333],{"type":414,"tag":444,"props":2334,"children":2335},{"style":468},[2336],{"type":420,"value":672},{"type":414,"tag":444,"props":2338,"children":2339},{"class":446,"line":634},[2340],{"type":414,"tag":444,"props":2341,"children":2342},{"style":647},[2343],{"type":420,"value":1694},{"type":414,"tag":444,"props":2345,"children":2346},{"class":446,"line":643},[2347,2351,2355],{"type":414,"tag":444,"props":2348,"children":2349},{"style":997},[2350],{"type":420,"value":1702},{"type":414,"tag":444,"props":2352,"children":2353},{"style":468},[2354],{"type":420,"value":1707},{"type":414,"tag":444,"props":2356,"children":2357},{"style":468},[2358],{"type":420,"value":1605},{"type":414,"tag":444,"props":2360,"children":2361},{"class":446,"line":666},[2362,2366,2370,2374,2378],{"type":414,"tag":444,"props":2363,"children":2364},{"style":468},[2365],{"type":420,"value":1719},{"type":414,"tag":444,"props":2367,"children":2368},{"style":647},[2369],{"type":420,"value":1724},{"type":414,"tag":444,"props":2371,"children":2372},{"style":468},[2373],{"type":420,"value":1622},{"type":414,"tag":444,"props":2375,"children":2376},{"style":1625},[2377],{"type":420,"value":1733},{"type":414,"tag":444,"props":2379,"children":2380},{"style":468},[2381],{"type":420,"value":577},{"type":414,"tag":444,"props":2383,"children":2384},{"class":446,"line":675},[2385],{"type":414,"tag":444,"props":2386,"children":2387},{"style":468},[2388],{"type":420,"value":672},{"type":414,"tag":444,"props":2390,"children":2391},{"class":446,"line":683},[2392],{"type":414,"tag":444,"props":2393,"children":2394},{"emptyLinePlaceholder":503},[2395],{"type":420,"value":506},{"type":414,"tag":444,"props":2397,"children":2398},{"class":446,"line":711},[2399,2403,2407],{"type":414,"tag":444,"props":2400,"children":2401},{"style":997},[2402],{"type":420,"value":1759},{"type":414,"tag":444,"props":2404,"children":2405},{"style":468},[2406],{"type":420,"value":1707},{"type":414,"tag":444,"props":2408,"children":2409},{"style":468},[2410],{"type":420,"value":1605},{"type":414,"tag":444,"props":2412,"children":2413},{"class":446,"line":776},[2414,2418,2422,2426,2430],{"type":414,"tag":444,"props":2415,"children":2416},{"style":468},[2417],{"type":420,"value":1719},{"type":414,"tag":444,"props":2419,"children":2420},{"style":647},[2421],{"type":420,"value":1724},{"type":414,"tag":444,"props":2423,"children":2424},{"style":468},[2425],{"type":420,"value":1622},{"type":414,"tag":444,"props":2427,"children":2428},{"style":1625},[2429],{"type":420,"value":1628},{"type":414,"tag":444,"props":2431,"children":2432},{"style":468},[2433],{"type":420,"value":577},{"type":414,"tag":444,"props":2435,"children":2436},{"class":446,"line":784},[2437],{"type":414,"tag":444,"props":2438,"children":2439},{"style":468},[2440],{"type":420,"value":672},{"type":414,"tag":444,"props":2442,"children":2443},{"class":446,"line":868},[2444],{"type":414,"tag":444,"props":2445,"children":2446},{"style":468},[2447],{"type":420,"value":882},{"type":414,"tag":444,"props":2449,"children":2450},{"class":446,"line":876},[2451],{"type":414,"tag":444,"props":2452,"children":2453},{"emptyLinePlaceholder":503},[2454],{"type":420,"value":506},{"type":414,"tag":444,"props":2456,"children":2458},{"class":446,"line":2457},18,[2459,2463,2467,2471,2475,2479,2483,2487,2491,2495,2499],{"type":414,"tag":444,"props":2460,"children":2461},{"style":451},[2462],{"type":420,"value":1880},{"type":414,"tag":444,"props":2464,"children":2465},{"style":647},[2466],{"type":420,"value":1885},{"type":414,"tag":444,"props":2468,"children":2469},{"style":468},[2470],{"type":420,"value":655},{"type":414,"tag":444,"props":2472,"children":2473},{"style":468},[2474],{"type":420,"value":1894},{"type":414,"tag":444,"props":2476,"children":2477},{"style":597},[2478],{"type":420,"value":1600},{"type":414,"tag":444,"props":2480,"children":2481},{"style":647},[2482],{"type":420,"value":471},{"type":414,"tag":444,"props":2484,"children":2485},{"style":468},[2486],{"type":420,"value":745},{"type":414,"tag":444,"props":2488,"children":2489},{"style":748},[2490],{"type":420,"value":1911},{"type":414,"tag":444,"props":2492,"children":2493},{"style":468},[2494],{"type":420,"value":745},{"type":414,"tag":444,"props":2496,"children":2497},{"style":647},[2498],{"type":420,"value":1675},{"type":414,"tag":444,"props":2500,"children":2501},{"style":468},[2502],{"type":420,"value":577},{"type":414,"tag":444,"props":2504,"children":2506},{"class":446,"line":2505},19,[2507,2511,2515,2519,2523,2527,2531],{"type":414,"tag":444,"props":2508,"children":2509},{"style":451},[2510],{"type":420,"value":1880},{"type":414,"tag":444,"props":2512,"children":2513},{"style":647},[2514],{"type":420,"value":1935},{"type":414,"tag":444,"props":2516,"children":2517},{"style":468},[2518],{"type":420,"value":655},{"type":414,"tag":444,"props":2520,"children":2521},{"style":647},[2522],{"type":420,"value":1944},{"type":414,"tag":444,"props":2524,"children":2525},{"style":468},[2526],{"type":420,"value":795},{"type":414,"tag":444,"props":2528,"children":2529},{"style":647},[2530],{"type":420,"value":1830},{"type":414,"tag":444,"props":2532,"children":2533},{"style":468},[2534],{"type":420,"value":577},{"type":414,"tag":444,"props":2536,"children":2538},{"class":446,"line":2537},20,[2539,2543,2547],{"type":414,"tag":444,"props":2540,"children":2541},{"style":597},[2542],{"type":420,"value":1964},{"type":414,"tag":444,"props":2544,"children":2545},{"style":647},[2546],{"type":420,"value":1707},{"type":414,"tag":444,"props":2548,"children":2549},{"style":468},[2550],{"type":420,"value":577},{"type":414,"tag":415,"props":2552,"children":2554},{"id":2553},"tool-of-the-week-durable-functions-monitor",[2555],{"type":420,"value":2556},"Tool of the week: Durable Functions Monitor ⚡",{"type":414,"tag":423,"props":2558,"children":2559},{},[2560,2562,2569],{"type":420,"value":2561},"If you are an Azure developer, you are probably already familiar with Azure Functions which is one of the solutions to do serverless in Azure. And, you may also have used Durable Functions to build serverless workflows. If I quote ",{"type":414,"tag":889,"props":2563,"children":2566},{"href":2564,"rel":2565},"https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=csharp",[893],[2567],{"type":420,"value":2568},"Microsoft documentation",{"type":420,"value":2570},": \"Durable Functions is an extension of Azure Functions that lets you write stateful functions in a serverless compute environment.\" In concrete terms, if you are developing multiple Azure Functions and you want to orchestrate their execution while maintaining a state, Durable Functions are what you need. I like this technology a lot ❤️. When used correctly and for the right purpose, it can solve many issues you would face to implementing manually a workflow. Enough talk, let's go back to the tool of the week!",{"type":414,"tag":423,"props":2572,"children":2573},{},[2574],{"type":414,"tag":903,"props":2575,"children":2579},{"alt":2576,"className":2577,"src":2578},"GitHub README of the Durable Functions Monitor project.",[907,908],"/posts/images/w202022tips_durablemonitor_1.png",[],{"type":414,"tag":423,"props":2581,"children":2582},{},[2583,2590],{"type":414,"tag":889,"props":2584,"children":2587},{"href":2585,"rel":2586},"https://github.com/microsoft/DurableFunctionsMonitor",[893],[2588],{"type":420,"value":2589},"Durable Functions Monitor",{"type":420,"value":2591}," is a UI tool that allows you to monitor, manage and debug your Azure Durable Functions. That's something very valuable because the tooling in Azure Portal is very poor for Durable Functions. Moreover, because a workflow can last for a long time and is often composed of many Azure Functions, it can be quite hard to understand at what stage the workflow is and what functions have already been executed 🤔. Durable Functions can help you with that and offers many other interesting features (functions graph, sequence diagram...). I heard about it a while ago but did not take the time to try it until recently and honestly it's too bad because it's a must-have to work with Azure Durable Functions 🚀!",{"type":414,"tag":1152,"props":2593,"children":2595},{"icon":2594},"i-heroicons-light-bulb",[2596],{"type":414,"tag":423,"props":2597,"children":2598},{},[2599],{"type":420,"value":2600},"It's worth noting that Durable Functions Monitor can be used as a vscode extension, as a Standalone service, or directly in your Function App.",{"type":414,"tag":415,"props":2602,"children":2604},{"id":2603},"git-tip-of-the-week-alias-to-force-push-commits",[2605],{"type":420,"value":2606},"Git tip of the week: alias to force push commits",{"type":414,"tag":423,"props":2608,"children":2609},{},[2610,2612,2619],{"type":420,"value":2611},"I often force push changes on my git branches. Indeed, I try to keep a clean and easy to read the history on my branches by using the ",{"type":414,"tag":889,"props":2613,"children":2616},{"href":2614,"rel":2615},"https://www.techwatching.dev/gitcheatsheet#when-you-want-to-have-a-clean-commit-history-on-your-branch-before-creating-your-pull-request",[893],[2617],{"type":420,"value":2618},"interactive rebase command",{"type":420,"value":2620}," so that it's easier for my colleagues to review my Pull Requests and I can use a rebase merging strategy instead of squashing my changes in a big commit when completing them.",{"type":414,"tag":423,"props":2622,"children":2623},{},[2624,2626,2632,2634,2640,2642,2648,2650,2656,2658,2664],{"type":420,"value":2625},"Before, I was using the ",{"type":414,"tag":440,"props":2627,"children":2629},{"className":2628},[],[2630],{"type":420,"value":2631},"git push --force",{"type":420,"value":2633}," command but reading a few articles on the topic convinced me that I should use the ",{"type":414,"tag":440,"props":2635,"children":2637},{"className":2636},[],[2638],{"type":420,"value":2639},"git push --force-with-lease",{"type":420,"value":2641}," command instead to avoid crushing commits colleagues could have done on my branch (even if there is little risk as I only rewrite the history of already pushed changes when working alone on a branch). You can read more about ",{"type":414,"tag":440,"props":2643,"children":2645},{"className":2644},[],[2646],{"type":420,"value":2647},"--force-with-lease",{"type":420,"value":2649}," on the git ",{"type":414,"tag":889,"props":2651,"children":2654},{"href":2652,"rel":2653},"https://git-scm.com/docs/git-push#Documentation/git-push.txt---force-with-leaseltrefnamegt",[893],[2655],{"type":420,"value":936},{"type":420,"value":2657},". The only problem with this command is that it's a bit long to write so here is an alias to add to your ",{"type":414,"tag":440,"props":2659,"children":2661},{"className":2660},[],[2662],{"type":420,"value":2663},".gitconfig",{"type":420,"value":1005},{"type":414,"tag":434,"props":2666,"children":2670},{"className":2667,"code":2668,"language":2669,"meta":401,"style":401},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[alias]\n    pf = push origin --force-with-lease\n","yaml",[2671],{"type":414,"tag":440,"props":2672,"children":2673},{"__ignoreMap":401},[2674,2692],{"type":414,"tag":444,"props":2675,"children":2676},{"class":446,"line":447},[2677,2682,2687],{"type":414,"tag":444,"props":2678,"children":2679},{"style":468},[2680],{"type":420,"value":2681},"[",{"type":414,"tag":444,"props":2683,"children":2684},{"style":748},[2685],{"type":420,"value":2686},"alias",{"type":414,"tag":444,"props":2688,"children":2689},{"style":468},[2690],{"type":420,"value":2691},"]\n",{"type":414,"tag":444,"props":2693,"children":2694},{"class":446,"line":499},[2695],{"type":414,"tag":444,"props":2696,"children":2697},{"style":748},[2698],{"type":420,"value":2699},"    pf = push origin --force-with-lease\n",{"type":414,"tag":423,"props":2701,"children":2702},{},[2703],{"type":420,"value":1263},{"type":414,"tag":1265,"props":2705,"children":2706},{},[2707],{"type":420,"value":1269},{"title":401,"searchDepth":499,"depth":499,"links":2709},[2710,2712,2713],{"id":1544,"depth":499,"text":2711},"Reminder for my future self: don't forget about \"this\" in ts",{"id":2553,"depth":499,"text":2556},{"id":2603,"depth":499,"text":2606},"content:1.posts:38.w20-2022-tips-learned-this-week.md","1.posts/38.w20-2022-tips-learned-this-week.md",{"_path":118,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":117,"description":2717,"lead":2717,"date":2718,"image":2719,"badge":2720,"tags":2721,"body":2722,"_type":1275,"_id":2935,"_source":1277,"_file":2936,"_extension":1279},"Git commands in vscode, a nice tool for Vue developers and a must-have Visual Studio extension.","2022-05-14T00:00:00.000Z",{"src":405},{"label":407},[272,208,241,340,337,206],{"type":411,"children":2723,"toc":2930},[2724,2730,2762,2771,2776,2785,2797,2803,2852,2861,2874,2883,2889,2903,2912,2917,2926],{"type":414,"tag":415,"props":2725,"children":2727},{"id":2726},"git-tip-of-the-week",[2728],{"type":420,"value":2729},"Git tip of the week",{"type":414,"tag":423,"props":2731,"children":2732},{},[2733,2735,2742,2744,2751,2753,2760],{"type":420,"value":2734},"If you have read my ",{"type":414,"tag":889,"props":2736,"children":2739},{"href":2737,"rel":2738},"https://www.techwatching.dev/gitcheatsheet",[893],[2740],{"type":420,"value":2741},"git cheat sheet",{"type":420,"value":2743},", you know that I am a big fan of the ",{"type":414,"tag":889,"props":2745,"children":2748},{"href":2746,"rel":2747},"https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens",[893],[2749],{"type":420,"value":2750},"GitLens",{"type":420,"value":2752}," vscode extension. I have been using it for a while now but just discovered recently that there is a ",{"type":414,"tag":889,"props":2754,"children":2757},{"href":2755,"rel":2756},"https://github.com/gitkraken/vscode-gitlens#git-command-palette-",[893],[2758],{"type":420,"value":2759},"Git Command Palette",{"type":420,"value":2761}," that gives access to most common Git commands.",{"type":414,"tag":423,"props":2763,"children":2764},{},[2765],{"type":414,"tag":903,"props":2766,"children":2770},{"alt":2767,"className":2768,"src":2769,"width":1490},"GitLens Command Palette in vscode",[907,908],"/posts/images/w192022tips_gitlens_1.png",[],{"type":414,"tag":423,"props":2772,"children":2773},{},[2774],{"type":420,"value":2775},"Usually, I prefer typing the git commands rather than using a visual tool. This way, I know exactly what I am doing (no magic commands done by a tool behind the scene), and I improve my knowledge of git. However, I think that with Git Command Palette, I get the best of both worlds. The UI helps me to use the git command I need without having to type everything and remember the exact syntax of the command. Yet, this is not a UI with buttons that hide from me the git commands being run. I am still aware of the exact git commands I am using and how.",{"type":414,"tag":423,"props":2777,"children":2778},{},[2779],{"type":414,"tag":903,"props":2780,"children":2784},{"alt":2781,"className":2782,"src":2783,"width":1490},"Doing a Git fetch in GitLens Command Palette.",[907,908],"/posts/images/w192022tips_gitlens_2.png",[],{"type":414,"tag":423,"props":2786,"children":2787},{},[2788,2790,2796],{"type":420,"value":2789},"On Windows, the default shortcut to use the Git Command Palette is ",{"type":414,"tag":440,"props":2791,"children":2793},{"className":2792},[],[2794],{"type":420,"value":2795},"Ctrl + Shift + G : ",{"type":420,"value":795},{"type":414,"tag":415,"props":2798,"children":2800},{"id":2799},"tool-of-the-week-vue-telescope",[2801],{"type":420,"value":2802},"Tool of the week: Vue Telescope",{"type":414,"tag":423,"props":2804,"children":2805},{},[2806,2808,2815,2817,2824,2826,2833,2835,2842,2844,2850],{"type":420,"value":2807},"If you are a Vue developer and don't know this tool yet, this is going to make your day! When browsing a website, you are probably wondering if it has been made with Vue.js and if so what is the technology stack behind it. Personally, I find it very interesting to know which frameworks, libraries, or plugins have been used to create a website in Vue. And that's what ",{"type":414,"tag":889,"props":2809,"children":2812},{"href":2810,"rel":2811},"https://vuetelescope.com/",[893],[2813],{"type":420,"value":2814},"Vue Telescope",{"type":420,"value":2816}," is about. It's an open source tool made by ",{"type":414,"tag":889,"props":2818,"children":2821},{"href":2819,"rel":2820},"https://nuxtlabs.com/",[893],[2822],{"type":420,"value":2823},"NuxtLabs",{"type":420,"value":2825}," (the team behind the ",{"type":414,"tag":889,"props":2827,"children":2830},{"href":2828,"rel":2829},"https://nuxtjs.org/",[893],[2831],{"type":420,"value":2832},"Nuxt",{"type":420,"value":2834}," framework) that detects the Vue technologies used in a website. It can be used from a browser ",{"type":414,"tag":889,"props":2836,"children":2839},{"href":2837,"rel":2838},"https://chrome.google.com/webstore/detail/vue-telescope/neaebjphlfplgdhedjdhcnpjkndddbpd",[893],[2840],{"type":420,"value":2841},"extension",{"type":420,"value":2843}," or from Vue Telescope's ",{"type":414,"tag":889,"props":2845,"children":2847},{"href":2810,"rel":2846},[893],[2848],{"type":420,"value":2849},"website",{"type":420,"value":2851}," to search a analyze a specific website.",{"type":414,"tag":423,"props":2853,"children":2854},{},[2855],{"type":414,"tag":903,"props":2856,"children":2860},{"alt":2857,"className":2858,"src":2859,"width":1490},"Vue Telescope extension showing Vue Telescope stack on its website.",[907,908],"/posts/images/w192022tips_vuetelescope_1.png",[],{"type":414,"tag":423,"props":2862,"children":2863},{},[2864,2866,2872],{"type":420,"value":2865},"You can explore the Vue.js websites already scanned by VueTelescope ",{"type":414,"tag":889,"props":2867,"children":2870},{"href":2868,"rel":2869},"https://vuetelescope.com/explore",[893],[2871],{"type":420,"value":1340},{"type":420,"value":2873}," and filter on the frameworks, UI Frameworks you are interested in.",{"type":414,"tag":423,"props":2875,"children":2876},{},[2877],{"type":414,"tag":903,"props":2878,"children":2882},{"alt":2879,"className":2880,"src":2881,"width":1490},"Vue Telescope search.",[907,908],"/posts/images/w192022tips_vuetelescope_2.png",[],{"type":414,"tag":415,"props":2884,"children":2886},{"id":2885},"the-visual-studio-extension-you-should-try-add-new-file",[2887],{"type":420,"value":2888},"The Visual Studio extension you should try: Add New File",{"type":414,"tag":423,"props":2890,"children":2891},{},[2892,2894,2901],{"type":420,"value":2893},"Sometimes the simplest IDE extensions are the best. That's the case for the ",{"type":414,"tag":889,"props":2895,"children":2898},{"href":2896,"rel":2897},"https://marketplace.visualstudio.com/items?itemName=MadsKristensen.AddNewFile64",[893],[2899],{"type":420,"value":2900},"\"Add New\"",{"type":420,"value":2902}," Visual Studio extension which allows you to quickly create a new file by hitting \"Shift+F2\" and writing the name of the file with its extension. Nothing fancy, but it saves you a lot of time compared to adding a new file using the default dialog.",{"type":414,"tag":423,"props":2904,"children":2905},{},[2906],{"type":414,"tag":903,"props":2907,"children":2911},{"alt":2908,"className":2909,"src":2910,"width":1490},"Website of Add New File Visual Studio extension.",[907,908],"/posts/images/w192022tips_addnewfile_1.png",[],{"type":414,"tag":423,"props":2913,"children":2914},{},[2915],{"type":420,"value":2916},"As you can see you can even create the missing folders where the file is placed.",{"type":414,"tag":423,"props":2918,"children":2919},{},[2920],{"type":414,"tag":903,"props":2921,"children":2925},{"alt":2922,"className":2923,"src":2924,"width":1490},"Usage of Add New File in Visual Studio.",[907,908],"/posts/images/w192022tips_addnewfile.gif",[],{"type":414,"tag":423,"props":2927,"children":2928},{},[2929],{"type":420,"value":1263},{"title":401,"searchDepth":499,"depth":499,"links":2931},[2932,2933,2934],{"id":2726,"depth":499,"text":2729},{"id":2799,"depth":499,"text":2802},{"id":2885,"depth":499,"text":2888},"content:1.posts:37.w19-2022-tips-learned-this-week.md","1.posts/37.w19-2022-tips-learned-this-week.md",{"_path":109,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":108,"description":2938,"lead":2939,"date":2940,"image":2941,"badge":2942,"tags":2943,"body":2944,"_type":1275,"_id":3241,"_source":1277,"_file":3242,"_extension":1279},"This week we talk about code analysis in .NET, cron expressions with crontab guru, diagrams in Azure DevOps wikis, and sending HTTP requests in VS Code.","Tooling around .NET, Azure DevOps and VS Code.","2022-02-04T00:00:00.000Z",{"src":405},{"label":407},[272,239,349,343,352,208,206],{"type":411,"children":2945,"toc":3235},[2946,2950,2956,3003,3016,3025,3038,3047,3059,3068,3081,3087,3100,3109,3122,3128,3133,3176,3181,3190,3196,3208,3217,3231],{"type":414,"tag":423,"props":2947,"children":2948},{},[2949],{"type":420,"value":2938},{"type":414,"tag":415,"props":2951,"children":2953},{"id":2952},"net-tip-of-the-week-configuring-code-analysis-on-your-project",[2954],{"type":420,"value":2955},".NET tip of the week: configuring code analysis on your project",{"type":414,"tag":423,"props":2957,"children":2958},{},[2959,2961,2967,2969,2976,2978,2985,2987,2993,2995,3001],{"type":420,"value":2960},"Static code analysis is great because it helps you to have a better code quality, and it allows you to detect potential issues or bad practices in your code directly from your IDE. I knew about Roslyn Analyzers and the possibility to configure which rules are enabled or not (with their level of severity) through an ",{"type":414,"tag":440,"props":2962,"children":2964},{"className":2963},[],[2965],{"type":420,"value":2966},".editorconfig",{"type":420,"value":2968}," file. However, until I read this ",{"type":414,"tag":889,"props":2970,"children":2973},{"href":2971,"rel":2972},"https://endjin.com/blog/2022/01/raising-coding-standard-dotnet-analyzers.html",[893],[2974],{"type":420,"value":2975},"article",{"type":420,"value":2977}," a few days ago, I did not know that you could set a ",{"type":414,"tag":889,"props":2979,"children":2982},{"href":2980,"rel":2981},"https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#analysismode",[893],[2983],{"type":420,"value":2984},"predefined code analysis configuration",{"type":420,"value":2986}," just by setting an ",{"type":414,"tag":440,"props":2988,"children":2990},{"className":2989},[],[2991],{"type":420,"value":2992},"AnalysisMode",{"type":420,"value":2994}," property in your project file. This is great, especially if you don't want to lose time configuring all the rules individually in an ",{"type":414,"tag":440,"props":2996,"children":2998},{"className":2997},[],[2999],{"type":420,"value":3000},"editorconfig",{"type":420,"value":3002}," file. You can just choose the analysis mode you feel more appropriate and eventually disable a few rules that you don't want.",{"type":414,"tag":423,"props":3004,"children":3005},{},[3006,3008,3014],{"type":420,"value":3007},"For instance, in this ASP.NET Core 6 project I created from the built-in template, I added an empty interface in the ",{"type":414,"tag":440,"props":3009,"children":3011},{"className":3010},[],[3012],{"type":420,"value":3013},"Program.cs",{"type":420,"value":3015}," file.\nBy default I see a message indicating that I should declare my interface in a namespace.",{"type":414,"tag":423,"props":3017,"children":3018},{},[3019],{"type":414,"tag":903,"props":3020,"children":3024},{"alt":3021,"className":3022,"src":3023},"Program in vscode with default analysis mode.",[907,908],"/posts/images/w052022tips_analysismode_1.png",[],{"type":414,"tag":423,"props":3026,"children":3027},{},[3028,3030,3036],{"type":420,"value":3029},"If I set the analysis mode to ",{"type":414,"tag":440,"props":3031,"children":3033},{"className":3032},[],[3034],{"type":420,"value":3035},"Recommended",{"type":420,"value":3037},", the code analysis indicates to me the same thing but this time as a warning.",{"type":414,"tag":423,"props":3039,"children":3040},{},[3041],{"type":414,"tag":903,"props":3042,"children":3046},{"alt":3043,"className":3044,"src":3045},"Program in vscode with 'Recommended' analysis mode.",[907,908],"/posts/images/w052022tips_analysismode_2.png",[],{"type":414,"tag":423,"props":3048,"children":3049},{},[3050,3051,3057],{"type":420,"value":3029},{"type":414,"tag":440,"props":3052,"children":3054},{"className":3053},[],[3055],{"type":420,"value":3056},"All",{"type":420,"value":3058},", then not only do I have the previous warning but I also have a warning to tell me I should not have an empty interface.",{"type":414,"tag":423,"props":3060,"children":3061},{},[3062],{"type":414,"tag":903,"props":3063,"children":3067},{"alt":3064,"className":3065,"src":3066},"Program in vscode with 'All' analysis mode.",[907,908],"/posts/images/w052022tips_analysismode_3.png",[],{"type":414,"tag":423,"props":3069,"children":3070},{},[3071,3073,3079],{"type":420,"value":3072},"There are also properties to only apply rules specific to a category (security for instance). You can check the ",{"type":414,"tag":889,"props":3074,"children":3077},{"href":3075,"rel":3076},"https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#analysismodecategory",[893],[3078],{"type":420,"value":936},{"type":420,"value":3080}," to learn more about these.",{"type":414,"tag":415,"props":3082,"children":3084},{"id":3083},"tool-of-the-week-crontab-guru",[3085],{"type":420,"value":3086},"Tool of the week: crontab guru",{"type":414,"tag":423,"props":3088,"children":3089},{},[3090,3092,3098],{"type":420,"value":3091},"You are probably using cron expressions in a lot of different contexts whether it be to schedule an Azure Function or to trigger periodically a CI/CD pipeline (GitHub Actions or Azure DevOps for instance). Cron expressions are useful but you might not use them often, which makes it hard to remember the syntax. ",{"type":414,"tag":440,"props":3093,"children":3095},{"className":3094},[],[3096],{"type":420,"value":3097},"crontab guru",{"type":420,"value":3099}," is a tool that helps you create cron schedule expressions or understand what existing cron expressions mean.",{"type":414,"tag":423,"props":3101,"children":3102},{},[3103],{"type":414,"tag":903,"props":3104,"children":3108},{"alt":3105,"className":3106,"src":3107},"Crontab Guru website.",[907,908],"/posts/images/w052022tips_crontab_guru.png",[],{"type":414,"tag":423,"props":3110,"children":3111},{},[3112,3114,3121],{"type":420,"value":3113},"It's really helpful, so add it to your ",{"type":414,"tag":889,"props":3115,"children":3118},{"href":3116,"rel":3117},"https://crontab.guru/",[893],[3119],{"type":420,"value":3120},"bookmarks",{"type":420,"value":795},{"type":414,"tag":415,"props":3123,"children":3125},{"id":3124},"the-azure-devops-tip-you-did-not-know-about-creating-diagrams-in-markdown-with-mermaidjs",[3126],{"type":420,"value":3127},"The Azure DevOps tip you did not know about: creating diagrams in markdown with Mermaid.js",{"type":414,"tag":423,"props":3129,"children":3130},{},[3131],{"type":420,"value":3132},"If you are using Azure DevOps, you are probably writing your technical documentation in markdown in a wiki. I like the idea of having \"documentation as code\" with markdown stored in a git repository that keeps the history of changes. Yet, sometimes documentation is not just about text, you want to have diagrams to properly illustrate what your text is explaining. And you don't want to have these diagrams just stored as images in your repository but you want them within the markdown to be modified as easily as the text.",{"type":414,"tag":423,"props":3134,"children":3135},{},[3136,3138,3144,3146,3152,3154,3159,3161,3166,3168,3175],{"type":420,"value":3137},"And guess what, that's possible thanks to ",{"type":414,"tag":440,"props":3139,"children":3141},{"className":3140},[],[3142],{"type":420,"value":3143},"Mermaid.js",{"type":420,"value":3145},". As you can read on its website, ",{"type":414,"tag":889,"props":3147,"children":3150},{"href":3148,"rel":3149},"https://mermaid-js.github.io/",[893],[3151],{"type":420,"value":3143},{"type":420,"value":3153}," is a \"JavaScript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically\". It means that you can write in your markdown file some text that describes a diagram and it will be rendered by ",{"type":414,"tag":440,"props":3155,"children":3157},{"className":3156},[],[3158],{"type":420,"value":3143},{"type":420,"value":3160},". There are a lot of types of diagrams that you can create using ",{"type":414,"tag":440,"props":3162,"children":3164},{"className":3163},[],[3165],{"type":420,"value":3143},{"type":420,"value":3167}," but Azure DevOps only ",{"type":414,"tag":889,"props":3169,"children":3172},{"href":3170,"rel":3171},"https://docs.microsoft.com/en-us/azure/devops/project/wiki/wiki-markdown-guidance?view=azure-devops#add-mermaid-diagrams-to-a-wiki-page",[893],[3173],{"type":420,"value":3174},"supports Sequence diagrams, Gantt Charts, and Flowcharts",{"type":420,"value":795},{"type":414,"tag":423,"props":3177,"children":3178},{},[3179],{"type":420,"value":3180},"Here is an example of a diagram I created in an Azure DevOps wiki:",{"type":414,"tag":423,"props":3182,"children":3183},{},[3184],{"type":414,"tag":903,"props":3185,"children":3189},{"alt":3186,"className":3187,"src":3188},"Mermaid.js diagram in Azure DevOps wiki.",[907,908],"/posts/images/w052022tips_mermaid_1.png",[],{"type":414,"tag":415,"props":3191,"children":3193},{"id":3192},"the-vs-code-extension-you-should-try-rest-client",[3194],{"type":420,"value":3195},"The VS Code extension you should try: Rest Client",{"type":414,"tag":423,"props":3197,"children":3198},{},[3199,3206],{"type":414,"tag":889,"props":3200,"children":3203},{"href":3201,"rel":3202},"https://github.com/Huachao/vscode-restclient",[893],[3204],{"type":420,"value":3205},"REST Client",{"type":420,"value":3207}," is an open source VS Code extension that allows you to send HTTP requests and view the responses as you would do with Postman. But I prefer using REST Client over Postman because with REST Client you write the HTTP requests in text files (using the RFC 2616 standard) that you can version in your git repository along with your code. REST Client is not something I discovered this week, I have been using it for quite a long time but it's still very useful to me so I thought this post was a good opportunity to tell you to try it if you have not yet.",{"type":414,"tag":423,"props":3209,"children":3210},{},[3211],{"type":414,"tag":903,"props":3212,"children":3216},{"alt":3213,"className":3214,"src":3215},"REST Client vscode extension.",[907,908],"/posts/images/w052022tips_restclient.png",[],{"type":414,"tag":423,"props":3218,"children":3219},{},[3220,3222,3229],{"type":420,"value":3221},"In fact, it's quite funny because the ",{"type":414,"tag":889,"props":3223,"children":3226},{"href":3224,"rel":3225},"https://www.techwatching.dev/posts/testing-your-api-with-rest-client",[893],[3227],{"type":420,"value":3228},"first article",{"type":420,"value":3230}," I wrote here on my blog was an article about REST Client, how to use it and why you should use it instead of Postman.",{"type":414,"tag":423,"props":3232,"children":3233},{},[3234],{"type":420,"value":1263},{"title":401,"searchDepth":499,"depth":499,"links":3236},[3237,3238,3239,3240],{"id":2952,"depth":499,"text":2955},{"id":3083,"depth":499,"text":3086},{"id":3124,"depth":499,"text":3127},{"id":3192,"depth":499,"text":3195},"content:1.posts:34.w05-2022-tips-learned-this-week.md","1.posts/34.w05-2022-tips-learned-this-week.md",{"_path":106,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":105,"description":3244,"lead":3245,"date":3246,"image":3247,"badge":3248,"tags":3249,"body":3250,"_type":1275,"_id":3675,"_source":1277,"_file":3676,"_extension":1279},".NET configuration providers, Vite vscode extension, Azure DevOps pull request templates, and degit.","Tooling around .NET, Azure DevOps, and VS Code.","2022-01-24T00:00:00.000Z",{"src":405},{"label":407},[272,239,263,343,208,346,241,206],{"type":411,"children":3251,"toc":3669},[3252,3258,3308,3317,3330,3424,3446,3452,3475,3480,3489,3495,3500,3514,3527,3540,3545,3554,3559,3564,3569,3578,3594,3600,3605,3640,3649,3661,3665],{"type":414,"tag":415,"props":3253,"children":3255},{"id":3254},"net-tip-of-the-week-the-new-way-to-add-a-configuration-source",[3256],{"type":420,"value":3257},".NET tip of the week: the new way to add a configuration source",{"type":414,"tag":423,"props":3259,"children":3260},{},[3261,3263,3269,3270,3276,3278,3284,3286,3291,3293,3298,3300,3307],{"type":420,"value":3262},".NET 6 introduced a new way to build a .NET application using the new ",{"type":414,"tag":440,"props":3264,"children":3266},{"className":3265},[],[3267],{"type":420,"value":3268},"WebApplication",{"type":420,"value":1832},{"type":414,"tag":440,"props":3271,"children":3273},{"className":3272},[],[3274],{"type":420,"value":3275},"WebApplicationBuilder",{"type":420,"value":3277}," classes. One thing I like about it is how configuration is handled. Instead of using the ",{"type":414,"tag":440,"props":3279,"children":3281},{"className":3280},[],[3282],{"type":420,"value":3283},"ConfigureAppConfiguration",{"type":420,"value":3285}," method to add a new configuration source, you can directly use the ",{"type":414,"tag":440,"props":3287,"children":3289},{"className":3288},[],[3290],{"type":420,"value":263},{"type":420,"value":3292}," property on the ",{"type":414,"tag":440,"props":3294,"children":3296},{"className":3295},[],[3297],{"type":420,"value":3275},{"type":420,"value":3299}," instance. You can see an example of this change on this screenshot of the ",{"type":414,"tag":889,"props":3301,"children":3304},{"href":3302,"rel":3303},"https://docs.microsoft.com/en-us/aspnet/core/migration/50-to-60-samples?view=aspnetcore-6.0#add-configuration-providers",[893],[3305],{"type":420,"value":3306},"ASP.NET Core documentation",{"type":420,"value":1005},{"type":414,"tag":423,"props":3309,"children":3310},{},[3311],{"type":414,"tag":903,"props":3312,"children":3316},{"alt":3313,"className":3314,"src":3315},"Using configuration provider in ASP.NET 5 versus ASP.NET 6.",[907,908],"/posts/images/w032022tips_net_configuration_1.png",[],{"type":414,"tag":423,"props":3318,"children":3319},{},[3320,3322,3328],{"type":420,"value":3321},"You may think this way of adding a new configuration source does not bring much apart from making the code shorter. I thought it too until I discovered that it enables you to access configuration in the builder from previously registered configuration sources. For instance, if you want to load secrets from an Azure Key Vault into your configuration, you will need to retrieve the Key Vault URI from your configuration (that you may have set in your ",{"type":414,"tag":440,"props":3323,"children":3325},{"className":3324},[],[3326],{"type":420,"value":3327},"appsettings.Development.json",{"type":420,"value":3329}," file). Before you would have to partially build your configuration to get the value of a setting, now you can just access it.",{"type":414,"tag":434,"props":3331,"children":3333},{"className":436,"code":3332,"language":326,"meta":401,"style":401},"builder.Configuration.AddAzureKeyVault(new Uri(builder.Configuration[\"KeyVault:VaultUri\"]), new DefaultAzureCredential());\n",[3334],{"type":414,"tag":440,"props":3335,"children":3336},{"__ignoreMap":401},[3337],{"type":414,"tag":444,"props":3338,"children":3339},{"class":446,"line":447},[3340,3345,3349,3353,3357,3362,3367,3372,3376,3380,3384,3388,3392,3396,3401,3405,3410,3414,3419],{"type":414,"tag":444,"props":3341,"children":3342},{"style":647},[3343],{"type":420,"value":3344},"builder",{"type":414,"tag":444,"props":3346,"children":3347},{"style":468},[3348],{"type":420,"value":795},{"type":414,"tag":444,"props":3350,"children":3351},{"style":647},[3352],{"type":420,"value":263},{"type":414,"tag":444,"props":3354,"children":3355},{"style":468},[3356],{"type":420,"value":795},{"type":414,"tag":444,"props":3358,"children":3359},{"style":597},[3360],{"type":420,"value":3361},"AddAzureKeyVault",{"type":414,"tag":444,"props":3363,"children":3364},{"style":468},[3365],{"type":420,"value":3366},"(new",{"type":414,"tag":444,"props":3368,"children":3369},{"style":457},[3370],{"type":420,"value":3371}," Uri",{"type":414,"tag":444,"props":3373,"children":3374},{"style":468},[3375],{"type":420,"value":471},{"type":414,"tag":444,"props":3377,"children":3378},{"style":647},[3379],{"type":420,"value":3344},{"type":414,"tag":444,"props":3381,"children":3382},{"style":468},[3383],{"type":420,"value":795},{"type":414,"tag":444,"props":3385,"children":3386},{"style":647},[3387],{"type":420,"value":263},{"type":414,"tag":444,"props":3389,"children":3390},{"style":468},[3391],{"type":420,"value":2681},{"type":414,"tag":444,"props":3393,"children":3394},{"style":468},[3395],{"type":420,"value":745},{"type":414,"tag":444,"props":3397,"children":3398},{"style":748},[3399],{"type":420,"value":3400},"KeyVault:VaultUri",{"type":414,"tag":444,"props":3402,"children":3403},{"style":468},[3404],{"type":420,"value":745},{"type":414,"tag":444,"props":3406,"children":3407},{"style":468},[3408],{"type":420,"value":3409},"]),",{"type":414,"tag":444,"props":3411,"children":3412},{"style":468},[3413],{"type":420,"value":1894},{"type":414,"tag":444,"props":3415,"children":3416},{"style":457},[3417],{"type":420,"value":3418}," DefaultAzureCredential",{"type":414,"tag":444,"props":3420,"children":3421},{"style":468},[3422],{"type":420,"value":3423},"());\n",{"type":414,"tag":423,"props":3425,"children":3426},{},[3427,3429,3436,3438,3444],{"type":420,"value":3428},"Configuration from previously registered sources is already available because configuration sources are directly loaded once they are added. If you want to learn more about the behind-the-scenes, Andrew Lock has a ",{"type":414,"tag":889,"props":3430,"children":3433},{"href":3431,"rel":3432},"https://andrewlock.net/exploring-dotnet-6-part-1-looking-inside-configurationmanager-in-dotnet-6/",[893],[3434],{"type":420,"value":3435},"very interesting article",{"type":420,"value":3437}," about ",{"type":414,"tag":440,"props":3439,"children":3441},{"className":3440},[],[3442],{"type":420,"value":3443},"ConfigurationManager",{"type":420,"value":3445}," that I suggest you read.",{"type":414,"tag":415,"props":3447,"children":3449},{"id":3448},"the-vs-code-extension-you-should-try-vite",[3450],{"type":420,"value":3451},"The VS Code extension you should try: Vite",{"type":414,"tag":423,"props":3453,"children":3454},{},[3455,3457,3464,3466,3473],{"type":420,"value":3456},"If you are developing a front-end using Vite (and there are ",{"type":414,"tag":889,"props":3458,"children":3461},{"href":3459,"rel":3460},"https://vitejs.dev/guide/why.html",[893],[3462],{"type":420,"value":3463},"good reasons",{"type":420,"value":3465}," why you should), there is a ",{"type":414,"tag":889,"props":3467,"children":3470},{"href":3468,"rel":3469},"https://marketplace.visualstudio.com/items?itemName=antfu.vite",[893],[3471],{"type":420,"value":3472},"Vite extension for VS Code",{"type":420,"value":3474}," currently in preview.",{"type":414,"tag":423,"props":3476,"children":3477},{},[3478],{"type":420,"value":3479},"You can see the main features of this extension below: little things that make you always more productive.",{"type":414,"tag":423,"props":3481,"children":3482},{},[3483],{"type":414,"tag":903,"props":3484,"children":3488},{"alt":3485,"className":3486,"src":3487},"Vs code vite exension.",[907,908],"/posts/images/w032022tips_vscode_vite_1.png",[],{"type":414,"tag":415,"props":3490,"children":3492},{"id":3491},"the-azure-devops-tip-you-did-not-know-about-creating-pull-requests-templates",[3493],{"type":420,"value":3494},"The Azure DevOps tip you did not know about: creating pull requests templates",{"type":414,"tag":423,"props":3496,"children":3497},{},[3498],{"type":420,"value":3499},"As a developer working with Azure DevOps, you probably spend a lot of time reviewing your colleagues pull requests and what helps you to have a good context (of what problem a pull request solves or what new feature it brings) are having a work item associated to the pull request, and having a good description. You can enforce the pull request to have an associated work item by setting it to mandatory in your branch policies, but \"having a good description\" is not something you can enforce.",{"type":414,"tag":423,"props":3501,"children":3502},{},[3503,3505,3512],{"type":420,"value":3504},"However, you can provide some guidance on what the description should tell, how it should be organized, what are the key points to verify before submitting the pull request... How do you do that? By creating a pull request template in your repository which will be a markdown file that will be automatically added to a pull request description when the pull request is created. You can read the ",{"type":414,"tag":889,"props":3506,"children":3509},{"href":3507,"rel":3508},"https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-request-templates?view=azure-devops",[893],[3510],{"type":420,"value":3511},"official documentation",{"type":420,"value":3513}," but let me show you quickly how it works:",{"type":414,"tag":423,"props":3515,"children":3516},{},[3517,3519,3525],{"type":420,"value":3518},"1- You create a ",{"type":414,"tag":440,"props":3520,"children":3522},{"className":3521},[],[3523],{"type":420,"value":3524},".azuredevops",{"type":420,"value":3526}," folder in the root of your git repository",{"type":414,"tag":423,"props":3528,"children":3529},{},[3530,3532,3538],{"type":420,"value":3531},"2- You create a markdown file ",{"type":414,"tag":440,"props":3533,"children":3535},{"className":3534},[],[3536],{"type":420,"value":3537},"pull_request_template.md",{"type":420,"value":3539}," containing the description you want",{"type":414,"tag":423,"props":3541,"children":3542},{},[3543],{"type":420,"value":3544},"You can see below an example of a template I created:",{"type":414,"tag":423,"props":3546,"children":3547},{},[3548],{"type":414,"tag":903,"props":3549,"children":3553},{"alt":3550,"className":3551,"src":3552},"Pull request markdown template file.",[907,908],"/posts/images/w032022tips_pr_template_1.png",[],{"type":414,"tag":423,"props":3555,"children":3556},{},[3557],{"type":420,"value":3558},"3- You commit this file and push it in your main branch",{"type":414,"tag":423,"props":3560,"children":3561},{},[3562],{"type":420,"value":3563},"4- Now when someone creates a pull request, he will have a pre-filled description to complete before submitting his pull request",{"type":414,"tag":423,"props":3565,"children":3566},{},[3567],{"type":420,"value":3568},"This is what it looks like for my template:",{"type":414,"tag":423,"props":3570,"children":3571},{},[3572],{"type":414,"tag":903,"props":3573,"children":3577},{"alt":3574,"className":3575,"src":3576},"Pull request template in Azure DevOps.",[907,908],"/posts/images/w032022tips_pr_template_2.png",[],{"type":414,"tag":1152,"props":3579,"children":3581},{"icon":3580},"i-heroicons-chat-bubble-left-20-solid",[3582],{"type":414,"tag":423,"props":3583,"children":3584},{},[3585,3587,3593],{"type":420,"value":3586},"If you are using GitHub and not Azure DevOps, just know that there are also pull requests templates in ",{"type":414,"tag":889,"props":3588,"children":3591},{"href":3589,"rel":3590},"https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository",[893],[3592],{"type":420,"value":233},{"type":420,"value":795},{"type":414,"tag":415,"props":3595,"children":3597},{"id":3596},"tool-of-the-week-degit",[3598],{"type":420,"value":3599},"Tool of the week: degit",{"type":414,"tag":423,"props":3601,"children":3602},{},[3603],{"type":420,"value":3604},"Sometimes you find an interesting open source git repository that could help you save some time when starting a new project. That can be a project template or a sample, it's a repository that you want to start coding from. You can clone it or fork it but you will retrieve the whole git history and that is something that you probably don't want.",{"type":414,"tag":423,"props":3606,"children":3607},{},[3608,3615,3617,3623,3625,3631,3633,3639],{"type":414,"tag":889,"props":3609,"children":3612},{"href":3610,"rel":3611},"https://github.com/Rich-Harris/degit",[893],[3613],{"type":420,"value":3614},"degit",{"type":420,"value":3616}," is a helpful tool that solves this issue. When you run this tool on a git repository, it retrieves locally the latest version of this repository without its git history. It's an ",{"type":414,"tag":440,"props":3618,"children":3620},{"className":3619},[],[3621],{"type":420,"value":3622},"npm",{"type":420,"value":3624}," tool so you can install it globally with ",{"type":414,"tag":440,"props":3626,"children":3628},{"className":3627},[],[3629],{"type":420,"value":3630},"npm install -g degit",{"type":420,"value":3632}," or directly run it using ",{"type":414,"tag":440,"props":3634,"children":3636},{"className":3635},[],[3637],{"type":420,"value":3638},"npx",{"type":420,"value":795},{"type":414,"tag":423,"props":3641,"children":3642},{},[3643],{"type":414,"tag":903,"props":3644,"children":3648},{"alt":3645,"className":3646,"src":3647},"Ouput when using degit package on a repository.",[907,908],"/posts/images/w032022tips_degit_1.png",[],{"type":414,"tag":423,"props":3650,"children":3651},{},[3652,3654,3659],{"type":420,"value":3653},"Don't hesitate to give the project a star on ",{"type":414,"tag":889,"props":3655,"children":3657},{"href":3610,"rel":3656},[893],[3658],{"type":420,"value":233},{"type":420,"value":3660}," if you find it useful.",{"type":414,"tag":423,"props":3662,"children":3663},{},[3664],{"type":420,"value":1263},{"type":414,"tag":1265,"props":3666,"children":3667},{},[3668],{"type":420,"value":1269},{"title":401,"searchDepth":499,"depth":499,"links":3670},[3671,3672,3673,3674],{"id":3254,"depth":499,"text":3257},{"id":3448,"depth":499,"text":3451},{"id":3491,"depth":499,"text":3494},{"id":3596,"depth":499,"text":3599},"content:1.posts:33.w03-2022-tips-learned-this-week.md","1.posts/33.w03-2022-tips-learned-this-week.md",{"_path":103,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":102,"description":3678,"lead":3679,"date":3680,"image":3681,"badge":3682,"tags":3683,"body":3684,"_type":1275,"_id":3918,"_source":1277,"_file":3919,"_extension":1279},"This is my first article of the series Tips I learned this week for 2022 🚀! And today we are going to see some tips about .NET, Azure, GitHub, and VS Code.","Tooling around .NET, Azure, Github and VS Code.","2022-01-14T00:00:00.000Z",{"src":405},{"label":407},[272,239,225,233,208,206],{"type":411,"children":3685,"toc":3911},[3686,3700,3706,3719,3728,3733,3745,3758,3788,3797,3803,3817,3830,3843,3852,3865,3871,3885,3894,3907],{"type":414,"tag":423,"props":3687,"children":3688},{},[3689,3691,3698],{"type":420,"value":3690},"This is my first article of the series ",{"type":414,"tag":889,"props":3692,"children":3695},{"href":3693,"rel":3694},"https://www.techwatching.dev/tags/tips-learned-this-week/",[893],[3696],{"type":420,"value":3697},"Tips I learned this week",{"type":420,"value":3699}," for 2022 🚀! And today we are going to see some tips about .NET, Azure, GitHub, and VS Code.",{"type":414,"tag":415,"props":3701,"children":3703},{"id":3702},"net-tip-of-the-week-changing-the-net-cli-language",[3704],{"type":420,"value":3705},".NET tip of the week: changing the .NET CLI language",{"type":414,"tag":423,"props":3707,"children":3708},{},[3709,3711,3717],{"type":420,"value":3710},"Did you know that you could change the language of the .NET CLI to the one you find most appropriate? By default, the dotnet CLI messages you see when running a dotnet program are your language OS (French in my case). However, by setting the \"DOTNET_CLI_UI_LANGUAGE\" variable environment to ",{"type":414,"tag":440,"props":3712,"children":3714},{"className":3713},[],[3715],{"type":420,"value":3716},"en",{"type":420,"value":3718}," for instance I can change it to English.",{"type":414,"tag":423,"props":3720,"children":3721},{},[3722],{"type":414,"tag":903,"props":3723,"children":3727},{"alt":3724,"className":3725,"src":3726},".NET CLI language change in terminal.",[907,908],"/posts/images/w022022tips_dotnet_cli.png",[],{"type":414,"tag":423,"props":3729,"children":3730},{},[3731],{"type":420,"value":3732},"Why is it useful? Let's imagine I have an issue with a dotnet CLI command and that I want to get some help from the community by posting a question to a Q&A website with a screenshot of my error. If all the messages are in French I will probably not get many answers whereas if it's in English everyone will be able to understand what my commands are doing. There is also the fact that sometimes French accents and special characters are not well displayed by some terminals.",{"type":414,"tag":415,"props":3734,"children":3736},{"id":3735},"the-azure-tip-you-did-not-know-about-simplify-your-azure-cli-configuration-with-azure-init",[3737,3739],{"type":420,"value":3738},"The Azure tip you did not know about: simplify your Azure CLI configuration with ",{"type":414,"tag":440,"props":3740,"children":3742},{"className":3741},[],[3743],{"type":420,"value":3744},"azure init",{"type":414,"tag":423,"props":3746,"children":3747},{},[3748,3750,3756],{"type":420,"value":3749},"I don't know if you use a lot Azure CLI but it's a very nice tool! Each time I use Azure CLI, I think \"it's awesome 🤩 I should use it more often instead of using Azure Portal\". I even wrote a post about that 2 years ago: \"",{"type":414,"tag":889,"props":3751,"children":3754},{"href":3752,"rel":3753},"https://www.techwatching.dev/posts/welcome-azure-cli",[893],[3755],{"type":420,"value":15},{"type":420,"value":3757},"\".",{"type":414,"tag":423,"props":3759,"children":3760},{},[3761,3763,3769,3771,3778,3780,3786],{"type":420,"value":3762},"However, if you want to configure your Azure CLI, it can be sometimes a bit boring and slow to configure it using the ",{"type":414,"tag":440,"props":3764,"children":3766},{"className":3765},[],[3767],{"type":420,"value":3768},"az config",{"type":420,"value":3770}," command. That is why Microsoft has ",{"type":414,"tag":889,"props":3772,"children":3775},{"href":3773,"rel":3774},"https://techcommunity.microsoft.com/t5/azure-tools-blog/streamline-configuring-azure-cli-with-az-init/ba-p/3051810",[893],[3776],{"type":420,"value":3777},"released in preview",{"type":420,"value":3779}," an Azure CLI extension called ",{"type":414,"tag":440,"props":3781,"children":3783},{"className":3782},[],[3784],{"type":420,"value":3785},"az init",{"type":420,"value":3787}," to simplify this configuration. For example you can quickly configure the output of the commands or the syntax highlighting, things like that.",{"type":414,"tag":423,"props":3789,"children":3790},{},[3791],{"type":414,"tag":903,"props":3792,"children":3796},{"alt":3793,"className":3794,"src":3795},"azure init command output.",[907,908],"/posts/images/w022022tips_az_init.png",[],{"type":414,"tag":415,"props":3798,"children":3800},{"id":3799},"tool-of-the-week-github-code-search",[3801],{"type":420,"value":3802},"Tool of the week: GitHub Code Search",{"type":414,"tag":423,"props":3804,"children":3805},{},[3806,3808,3815],{"type":420,"value":3807},"Have you ever wished you could easily search code on GitHub in multiple repositories without cloning anything? That is now possible with ",{"type":414,"tag":889,"props":3809,"children":3812},{"href":3810,"rel":3811},"https://cs.github.com/",[893],[3813],{"type":420,"value":3814},"GitHub Code Search",{"type":420,"value":3816},". It is still in preview but looks promising! You have access to nice filters to find exactly the code you are looking for, and once you get it you can navigate in and across files.",{"type":414,"tag":423,"props":3818,"children":3819},{},[3820,3822,3828],{"type":420,"value":3821},"For a long time, I have kept a bookmark to the \"",{"type":414,"tag":889,"props":3823,"children":3826},{"href":3824,"rel":3825},"https://source.dot.net/",[893],[3827],{"type":420,"value":3824},{"type":420,"value":3829},"\" website for the times when I needed to understand how something was implemented in the .NET Core framework. But with GitHub Code Search I think I don't need it anymore. .NET Core is open source and all the source code is on GitHub so I can quickly find everything I need just by searching it on GitHub.",{"type":414,"tag":423,"props":3831,"children":3832},{},[3833,3835,3841],{"type":420,"value":3834},"For instance, let's say I don't remember exactly what configuration is injected by default in a dotnet project when you use the ",{"type":414,"tag":440,"props":3836,"children":3838},{"className":3837},[],[3839],{"type":420,"value":3840},"Host.CreateDefaultBuilder",{"type":420,"value":3842}," method. I will scope my search to dotnet organization repositories and a few keystrokes later, I can see all the configuration providers used to load some default configuration in a project.",{"type":414,"tag":423,"props":3844,"children":3845},{},[3846],{"type":414,"tag":903,"props":3847,"children":3851},{"alt":3848,"className":3849,"src":3850},"GitHub search usage.",[907,908],"/posts/images/w022022tips_githu_cs.gif",[],{"type":414,"tag":423,"props":3853,"children":3854},{},[3855,3857,3864],{"type":420,"value":3856},"You can read more about GitHub Code Search on ",{"type":414,"tag":889,"props":3858,"children":3861},{"href":3859,"rel":3860},"https://github.blog/2021-12-08-improving-github-code-search/",[893],[3862],{"type":420,"value":3863},"GitHub's blog",{"type":420,"value":795},{"type":414,"tag":415,"props":3866,"children":3868},{"id":3867},"the-vs-code-extension-you-should-try-i18n-ally",[3869],{"type":420,"value":3870},"The VS Code extension you should try: i18n ally",{"type":414,"tag":423,"props":3872,"children":3873},{},[3874,3876,3883],{"type":420,"value":3875},"When you are developing an application that supports several languages, it can quickly become annoying to go in every translation file when you need to check or modify a translation. If you are developing your application using VS Code, you probably should check out the extension ",{"type":414,"tag":889,"props":3877,"children":3880},{"href":3878,"rel":3879},"https://github.com/lokalise/i18n-ally",[893],[3881],{"type":420,"value":3882},"i18n ally",{"type":420,"value":3884}," because it will save you a lot of time.",{"type":414,"tag":423,"props":3886,"children":3887},{},[3888],{"type":414,"tag":903,"props":3889,"children":3893},{"alt":3890,"className":3891,"src":3892},"i18n ally extension in vscode.",[907,908],"/posts/images/w222021tips_i18n_ally.png",[],{"type":414,"tag":423,"props":3895,"children":3896},{},[3897,3899,3905],{"type":420,"value":3898},"It is very handy and I like the fact the extension support lots of frameworks like Vue.js, Angular, React, Svelte, and Flutter (you can find the complete list of supported frameworks ",{"type":414,"tag":889,"props":3900,"children":3903},{"href":3901,"rel":3902},"https://github.com/lokalise/i18n-ally/wiki/Supported-Frameworks",[893],[3904],{"type":420,"value":1340},{"type":420,"value":3906},"). My only regret with this extension is not to have heard about it sooner.",{"type":414,"tag":423,"props":3908,"children":3909},{},[3910],{"type":420,"value":1263},{"title":401,"searchDepth":499,"depth":499,"links":3912},[3913,3914,3916,3917],{"id":3702,"depth":499,"text":3705},{"id":3735,"depth":499,"text":3915},"The Azure tip you did not know about: simplify your Azure CLI configuration with azure init",{"id":3799,"depth":499,"text":3802},{"id":3867,"depth":499,"text":3870},"content:1.posts:32.w02-2022-tips-learned-this-week.md","1.posts/32.w02-2022-tips-learned-this-week.md",{"_path":91,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":90,"description":3921,"lead":3922,"date":3923,"image":3924,"badge":3925,"tags":3926,"body":3927,"_type":1275,"_id":4188,"_source":1277,"_file":4189,"_extension":1279},"Vue Devtools, Visual Studio themes, Git tips, and .NET Conf replays.","A bit of tooling and a bit of git.","2021-11-14T00:00:00.000Z",{"src":405},{"label":407},[272,337,340,241],{"type":411,"children":3928,"toc":4180},[3929,3941,3953,3983,3992,3998,4021,4044,4053,4059,4064,4069,4075,4103,4131,4148,4154,4167,4176],{"type":414,"tag":415,"props":3930,"children":3932},{"id":3931},"vue-devtools-a-must-have-browser-extension-when-using-vuejs",[3933,3939],{"type":414,"tag":440,"props":3934,"children":3936},{"className":3935},[],[3937],{"type":420,"value":3938},"Vue Devtools",{"type":420,"value":3940},", a must-have browser extension when using Vue.js",{"type":414,"tag":423,"props":3942,"children":3943},{},[3944,3946,3951],{"type":420,"value":3945},"Since a colleague showed me the ",{"type":414,"tag":440,"props":3947,"children":3949},{"className":3948},[],[3950],{"type":420,"value":3938},{"type":420,"value":3952}," extension, it has been a game-changer for me to work on Vue.js projects. It is very useful!",{"type":414,"tag":423,"props":3954,"children":3955},{},[3956,3958,3965,3967,3973,3975,3981],{"type":420,"value":3957},"I could describe to you how this extension works and what are its features but there are already very good articles that do that, like this ",{"type":414,"tag":889,"props":3959,"children":3962},{"href":3960,"rel":3961},"https://www.vuemastery.com/blog/whats-new-in-the-vue3-devtools/",[893],[3963],{"type":420,"value":3964},"one",{"type":420,"value":3966}," on Vue Mastery's blog. Check that, have a look at the ",{"type":414,"tag":889,"props":3968,"children":3971},{"href":3969,"rel":3970},"https://devtools.vuejs.org/",[893],[3972],{"type":420,"value":936},{"type":420,"value":3974},", install ",{"type":414,"tag":889,"props":3976,"children":3979},{"href":3977,"rel":3978},"https://chrome.google.com/webstore/detail/vuejs-devtools/ljjemllljcmogpfapbkkighbhhppjdbg",[893],[3980],{"type":420,"value":268},{"type":420,"value":3982}," (the beta version), and try it.",{"type":414,"tag":423,"props":3984,"children":3985},{},[3986],{"type":414,"tag":903,"props":3987,"children":3991},{"alt":3988,"className":3989,"src":3990},"Vue Devtools website.",[907,908],"/posts/images/w452021tips_vue_1.png",[],{"type":414,"tag":415,"props":3993,"children":3995},{"id":3994},"cobalt2-theme-is-available-in-visual-studio-2022",[3996],{"type":420,"value":3997},"Cobalt2 theme is available in Visual Studio 2022",{"type":414,"tag":423,"props":3999,"children":4000},{},[4001,4003,4010,4012,4019],{"type":420,"value":4002},"I have used ",{"type":414,"tag":889,"props":4004,"children":4007},{"href":4005,"rel":4006},"https://marketplace.visualstudio.com/items?itemName=wesbos.theme-cobalt2",[893],[4008],{"type":420,"value":4009},"Cobalt2 theme",{"type":420,"value":4011}," for vscode for quite some time now. And this theme is now available in Visual Studio 2022, you can check ",{"type":414,"tag":889,"props":4013,"children":4016},{"href":4014,"rel":4015},"https://marketplace.visualstudio.com/items?itemName=SIBA.Cobalt2Theme",[893],[4017],{"type":420,"value":4018},"this extension",{"type":420,"value":4020}," to get it.",{"type":414,"tag":423,"props":4022,"children":4023},{},[4024,4026,4033,4035,4042],{"type":420,"value":4025},"A lot of vscode themes have been made available in Visual Studio 2022 thanks to a new tool: ",{"type":414,"tag":889,"props":4027,"children":4030},{"href":4028,"rel":4029},"https://github.com/microsoft/theme-converter-for-vs",[893],[4031],{"type":420,"value":4032},"Theme Converter for Visual Studio",{"type":420,"value":4034},". You can read more about that ",{"type":414,"tag":889,"props":4036,"children":4039},{"href":4037,"rel":4038},"https://devblogs.microsoft.com/visualstudio/custom-themes/",[893],[4040],{"type":420,"value":4041},"in this article",{"type":420,"value":4043}," from Visual Studio dev blog.",{"type":414,"tag":423,"props":4045,"children":4046},{},[4047],{"type":414,"tag":903,"props":4048,"children":4052},{"alt":4049,"className":4050,"src":4051},"Visual Studio 2022 with cobalt theme.",[907,908],"/posts/images/w452021tips_vs_1.png",[],{"type":414,"tag":415,"props":4054,"children":4056},{"id":4055},"keep-a-2nd-clone-for-reviewing-pull-requests",[4057],{"type":420,"value":4058},"Keep a 2nd clone for reviewing pull requests",{"type":414,"tag":423,"props":4060,"children":4061},{},[4062],{"type":420,"value":4063},"I think it is often interesting to checkout the branch of a pull request instead of relying only on the web view to review a PR. It allows checking more things and a better comprehension of the code. However, when you are working on a feature, you don't want to mix your current work with the pull request you are reviewing.",{"type":414,"tag":423,"props":4065,"children":4066},{},[4067],{"type":420,"value":4068},"That is why instead of stashing code changes and switching branches I prefer having on my laptop 2 clones of the same repository I am working on, with one clone dedicated to code reviews.",{"type":414,"tag":415,"props":4070,"children":4072},{"id":4071},"git-clrf",[4073],{"type":420,"value":4074},"Git CLRF",{"type":414,"tag":423,"props":4076,"children":4077},{},[4078,4080,4086,4088,4094,4096,4102],{"type":420,"value":4079},"If you are using Git on Windows, it is a good practice to set your ",{"type":414,"tag":440,"props":4081,"children":4083},{"className":4082},[],[4084],{"type":420,"value":4085},"autocrlf",{"type":420,"value":4087}," to true in your Git configuration to avoid line-ending issues (learn more about this topic in the ",{"type":414,"tag":889,"props":4089,"children":4092},{"href":4090,"rel":4091},"https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration",[893],[4093],{"type":420,"value":936},{"type":420,"value":4095},"). You can do that with the following command ",{"type":414,"tag":440,"props":4097,"children":4099},{"className":4098},[],[4100],{"type":420,"value":4101},"git config --global core.autocrlf true",{"type":420,"value":795},{"type":414,"tag":423,"props":4104,"children":4105},{},[4106,4108,4113,4115,4121,4123,4129],{"type":420,"value":4107},"Unfortunately, maybe not all your colleagues have correctly configured ",{"type":414,"tag":440,"props":4109,"children":4111},{"className":4110},[],[4112],{"type":420,"value":4085},{"type":420,"value":4114}," on their machine. And you will probably forget to ask each newcomer to check that. So something that can be interesting (if all your team is working on Windows) is to directly enforce this setting on your repository by pushing a ",{"type":414,"tag":440,"props":4116,"children":4118},{"className":4117},[],[4119],{"type":420,"value":4120},".gitattributes",{"type":420,"value":4122}," with ",{"type":414,"tag":440,"props":4124,"children":4126},{"className":4125},[],[4127],{"type":420,"value":4128},"text=auto",{"type":420,"value":4130}," in it).",{"type":414,"tag":1152,"props":4132,"children":4133},{"icon":3580},[4134],{"type":414,"tag":423,"props":4135,"children":4136},{},[4137,4139,4146],{"type":420,"value":4138},"As I was writing these lines, I just saw an article from Scott Hanselman about ",{"type":414,"tag":889,"props":4140,"children":4143},{"href":4141,"rel":4142},"https://www.hanselman.com/blog/carriage-returns-and-line-feeds-will-ultimately-bite-you-some-git-tips",[893],[4144],{"type":420,"value":4145},"Carriage Returns and Line Feeds",{"type":420,"value":4147},", if you want to read more about it.",{"type":414,"tag":415,"props":4149,"children":4151},{"id":4150},"dotnetconf-playlist",[4152],{"type":420,"value":4153},"dotNetConf playlist",{"type":414,"tag":423,"props":4155,"children":4156},{},[4157,4159,4165],{"type":420,"value":4158},"dotNetConf was this week and the replays are available ",{"type":414,"tag":889,"props":4160,"children":4163},{"href":4161,"rel":4162},"https://www.youtube.com/playlist?list=PLdo4fOcmZ0oVFtp9MDEBNbA2sSqYvXSXO",[893],[4164],{"type":420,"value":1340},{"type":420,"value":4166}," if you want to watch some talks you missed.",{"type":414,"tag":423,"props":4168,"children":4169},{},[4170],{"type":414,"tag":903,"props":4171,"children":4175},{"alt":4172,"className":4173,"src":4174},".NET Conf 2021 YouTube playlist.",[907,908],"/posts/images/w452021tips_dotnetconf_1.png",[],{"type":414,"tag":423,"props":4177,"children":4178},{},[4179],{"type":420,"value":1263},{"title":401,"searchDepth":499,"depth":499,"links":4181},[4182,4184,4185,4186,4187],{"id":3931,"depth":499,"text":4183},"Vue Devtools, a must-have browser extension when using Vue.js",{"id":3994,"depth":499,"text":3997},{"id":4055,"depth":499,"text":4058},{"id":4071,"depth":499,"text":4074},{"id":4150,"depth":499,"text":4153},"content:1.posts:28.w45-2021-tips-learned-this-week.md","1.posts/28.w45-2021-tips-learned-this-week.md",{"_path":85,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":84,"description":4191,"lead":4192,"date":4193,"image":4194,"badge":4195,"tags":4196,"body":4197,"_type":1275,"_id":5448,"_source":1277,"_file":5449,"_extension":1279},"This week I worked mainly in vs code to do some web development so tips will mostly be about vscode.","vscode, vscode Jest extension, csharp attributes for nullables.","2021-10-18T00:00:00.000Z",{"src":405},{"label":407},[272,208,326,328],{"type":411,"children":4198,"toc":5441},[4199,4203,4209,4214,4223,4236,4245,4257,4277,4292,4312,4321,4334,4339,4345,4350,4359,4380,4475,4483,4488,4497,4542,4547,4553,4558,4566,4571,4594,4607,4620,5218,5230,5359,5433,5437],{"type":414,"tag":423,"props":4200,"children":4201},{},[4202],{"type":420,"value":4191},{"type":414,"tag":415,"props":4204,"children":4206},{"id":4205},"work-on-different-parts-of-your-file-with-the-new-split-in-group-command",[4207],{"type":420,"value":4208},"Work on different parts of your file with the new \"split in group\" command",{"type":414,"tag":423,"props":4210,"children":4211},{},[4212],{"type":420,"value":4213},"When you are developing a component in Vue.js, it is convenient to be able to work at the same time on the HTML template and the TypeScript code which happen to be in the same file.",{"type":414,"tag":423,"props":4215,"children":4216},{},[4217],{"type":414,"tag":903,"props":4218,"children":4222},{"alt":4219,"className":4220,"src":4221},"Split in Group option in vscode.",[907,908],"/posts/images/w412021tips_vscode_1.png",[],{"type":414,"tag":423,"props":4224,"children":4225},{},[4226,4228,4234],{"type":420,"value":4227},"The latest release of vscode allows you to do that easily by introducing a new command \"Split in Group\" (the shortcut is ",{"type":414,"tag":440,"props":4229,"children":4231},{"className":4230},[],[4232],{"type":420,"value":4233},"Ctrl+K Ctrl+Shift+*",{"type":420,"value":4235}," on Windows)\" that splits an editor into two sides.",{"type":414,"tag":423,"props":4237,"children":4238},{},[4239],{"type":414,"tag":903,"props":4240,"children":4244},{"alt":4241,"className":4242,"src":4243},"Vue component split in 2 in vscode.",[907,908],"/posts/images/w412021tips_vscode_2.png",[],{"type":414,"tag":415,"props":4246,"children":4248},{"id":4247},"vscode-jest-a-must-have-extension-when-using-jest",[4249,4255],{"type":414,"tag":440,"props":4250,"children":4252},{"className":4251},[],[4253],{"type":420,"value":4254},"vscode-jest",{"type":420,"value":4256},", a must-have extension when using Jest",{"type":414,"tag":423,"props":4258,"children":4259},{},[4260,4262,4268,4270,4275],{"type":420,"value":4261},"Many projects are using ",{"type":414,"tag":440,"props":4263,"children":4265},{"className":4264},[],[4266],{"type":420,"value":4267},"Jest",{"type":420,"value":4269}," as their testing framework for the frontend. But I was quite surprised to see that by default there is no test explorer in vscode to run or debug your ",{"type":414,"tag":440,"props":4271,"children":4273},{"className":4272},[],[4274],{"type":420,"value":4267},{"type":420,"value":4276}," tests. I like the command line but for some things, like debugging a specific test, a UI is way more convenient.",{"type":414,"tag":1152,"props":4278,"children":4279},{"icon":3580},[4280],{"type":414,"tag":423,"props":4281,"children":4282},{},[4283,4285,4291],{"type":420,"value":4284},"From what I understood, there is a native API/UI in vscode that extensions can use to help you managed your tests. You can learn about that ",{"type":414,"tag":889,"props":4286,"children":4289},{"href":4287,"rel":4288},"https://code.visualstudio.com/api/extension-guides/testing",[893],[4290],{"type":420,"value":1340},{"type":420,"value":795},{"type":414,"tag":423,"props":4293,"children":4294},{},[4295,4297,4302,4304,4310],{"type":420,"value":4296},"So we have to install the ",{"type":414,"tag":440,"props":4298,"children":4300},{"className":4299},[],[4301],{"type":420,"value":4254},{"type":420,"value":4303}," ",{"type":414,"tag":889,"props":4305,"children":4308},{"href":4306,"rel":4307},"https://github.com/jest-community/vscode-jest",[893],[4309],{"type":420,"value":2841},{"type":420,"value":4311}," to be able to discover our tests, run them and debug them.",{"type":414,"tag":423,"props":4313,"children":4314},{},[4315],{"type":414,"tag":903,"props":4316,"children":4320},{"alt":4317,"className":4318,"src":4319},"Jest vscoe extension.",[907,908],"/posts/images/w412021tips_jest_1.png",[],{"type":414,"tag":423,"props":4322,"children":4323},{},[4324,4326,4332],{"type":420,"value":4325},"If you are familiar with full-featured IDEs, you will like this extension that gives you a nice test explorer as well as other interesting features such as automatically running tests when code changes are made (similar to ",{"type":414,"tag":440,"props":4327,"children":4329},{"className":4328},[],[4330],{"type":420,"value":4331},"Live Unit Testing",{"type":420,"value":4333}," in Visual Studio )",{"type":414,"tag":423,"props":4335,"children":4336},{},[4337],{"type":420,"value":4338},"That brings me to talking about sharing your vs code extensions with your colleagues.",{"type":414,"tag":415,"props":4340,"children":4342},{"id":4341},"share-to-your-colleagues-the-vscode-extensions-to-use-on-your-project",[4343],{"type":420,"value":4344},"Share to your colleagues the vscode extensions to use on your project",{"type":414,"tag":423,"props":4346,"children":4347},{},[4348],{"type":420,"value":4349},"When you start working on a new project, you often have to find out which extensions your colleagues are using so that you install everything you need to work on the project. If your colleagues are nice, they would have written this kind of information in the README or the wiki of the project. But what if vscode could directly suggest to you which extensions to install when you open the project on your computer.",{"type":414,"tag":423,"props":4351,"children":4352},{},[4353],{"type":414,"tag":903,"props":4354,"children":4358},{"alt":4355,"className":4356,"src":4357},"Suggested extensions popin in vscode.",[907,908],"/posts/images/w412021tips_vscode_3.png",[],{"type":414,"tag":423,"props":4360,"children":4361},{},[4362,4364,4370,4372,4378],{"type":420,"value":4363},"As you can see on the screenshot above that is exactly what vscode can do for you if someone has specified the recommended vscode extensions of the workspace in the ",{"type":414,"tag":440,"props":4365,"children":4367},{"className":4366},[],[4368],{"type":420,"value":4369},"extensions.json",{"type":420,"value":4371}," file of the ",{"type":414,"tag":440,"props":4373,"children":4375},{"className":4374},[],[4376],{"type":420,"value":4377},".vscode",{"type":420,"value":4379}," folder.\nHere is an example of such a file:",{"type":414,"tag":434,"props":4381,"children":4385},{"className":4382,"code":4383,"language":4384,"meta":401,"style":401},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n    \"recommendations\": [\n        \"orta.vscode-jest\",\n        \"sdras.vue-vscode-extensionpack\"\n    ]\n}\n","json",[4386],{"type":414,"tag":440,"props":4387,"children":4388},{"__ignoreMap":401},[4389,4396,4422,4444,4460,4468],{"type":414,"tag":444,"props":4390,"children":4391},{"class":446,"line":447},[4392],{"type":414,"tag":444,"props":4393,"children":4394},{"style":468},[4395],{"type":420,"value":533},{"type":414,"tag":444,"props":4397,"children":4398},{"class":446,"line":499},[4399,4404,4409,4413,4417],{"type":414,"tag":444,"props":4400,"children":4401},{"style":468},[4402],{"type":420,"value":4403},"    \"",{"type":414,"tag":444,"props":4405,"children":4406},{"style":451},[4407],{"type":420,"value":4408},"recommendations",{"type":414,"tag":444,"props":4410,"children":4411},{"style":468},[4412],{"type":420,"value":745},{"type":414,"tag":444,"props":4414,"children":4415},{"style":468},[4416],{"type":420,"value":1005},{"type":414,"tag":444,"props":4418,"children":4419},{"style":468},[4420],{"type":420,"value":4421}," [\n",{"type":414,"tag":444,"props":4423,"children":4424},{"class":446,"line":509},[4425,4430,4435,4439],{"type":414,"tag":444,"props":4426,"children":4427},{"style":468},[4428],{"type":420,"value":4429},"        \"",{"type":414,"tag":444,"props":4431,"children":4432},{"style":748},[4433],{"type":420,"value":4434},"orta.vscode-jest",{"type":414,"tag":444,"props":4436,"children":4437},{"style":468},[4438],{"type":420,"value":745},{"type":414,"tag":444,"props":4440,"children":4441},{"style":468},[4442],{"type":420,"value":4443},",\n",{"type":414,"tag":444,"props":4445,"children":4446},{"class":446,"line":527},[4447,4451,4456],{"type":414,"tag":444,"props":4448,"children":4449},{"style":468},[4450],{"type":420,"value":4429},{"type":414,"tag":444,"props":4452,"children":4453},{"style":748},[4454],{"type":420,"value":4455},"sdras.vue-vscode-extensionpack",{"type":414,"tag":444,"props":4457,"children":4458},{"style":468},[4459],{"type":420,"value":1132},{"type":414,"tag":444,"props":4461,"children":4462},{"class":446,"line":536},[4463],{"type":414,"tag":444,"props":4464,"children":4465},{"style":468},[4466],{"type":420,"value":4467},"    ]\n",{"type":414,"tag":444,"props":4469,"children":4470},{"class":446,"line":580},[4471],{"type":414,"tag":444,"props":4472,"children":4473},{"style":468},[4474],{"type":420,"value":882},{"type":414,"tag":1152,"props":4476,"children":4477},{"icon":3580},[4478],{"type":414,"tag":423,"props":4479,"children":4480},{},[4481],{"type":420,"value":4482},"If you don't want vscode to recommend you some extensions, you can also specify a list of unwanted recommendations in this file.",{"type":414,"tag":423,"props":4484,"children":4485},{},[4486],{"type":420,"value":4487},"This is just a list of vscode extensions identifiers. You can find the identifier of an extension on its details page in vscode. You will also find there a button to directly add the extension to your recommended list of extensions.",{"type":414,"tag":423,"props":4489,"children":4490},{},[4491],{"type":414,"tag":903,"props":4492,"children":4496},{"alt":4493,"className":4494,"src":4495},"Add to workspace recommendation example.",[907,908],"/posts/images/w412021tips_vscode_4.png",[],{"type":414,"tag":1152,"props":4498,"children":4499},{"icon":3580},[4500],{"type":414,"tag":423,"props":4501,"children":4502},{},[4503,4505,4510,4512,4518,4520,4526,4528,4533,4535,4540],{"type":420,"value":4504},"If the ",{"type":414,"tag":440,"props":4506,"children":4508},{"className":4507},[],[4509],{"type":420,"value":4377},{"type":420,"value":4511}," folder is in the ",{"type":414,"tag":440,"props":4513,"children":4515},{"className":4514},[],[4516],{"type":420,"value":4517},"gitignore",{"type":420,"value":4519}," of your repository, do not forget to add this line ",{"type":414,"tag":440,"props":4521,"children":4523},{"className":4522},[],[4524],{"type":420,"value":4525},"!.vscode/extensions.json",{"type":420,"value":4527}," to your ",{"type":414,"tag":440,"props":4529,"children":4531},{"className":4530},[],[4532],{"type":420,"value":4517},{"type":420,"value":4534}," file to be able to add your ",{"type":414,"tag":440,"props":4536,"children":4538},{"className":4537},[],[4539],{"type":420,"value":4369},{"type":420,"value":4541}," file in your repository.",{"type":414,"tag":423,"props":4543,"children":4544},{},[4545],{"type":420,"value":4546},"And finally, let's talk a little bit about C#.",{"type":414,"tag":415,"props":4548,"children":4550},{"id":4549},"help-the-c-compiler-helps-you-with-nullable-reference-types",[4551],{"type":420,"value":4552},"Help the C# compiler helps you with nullable reference types.",{"type":414,"tag":423,"props":4554,"children":4555},{},[4556],{"type":420,"value":4557},"I am a big fan of enabling nullable on c# projects because I am convinced that it enforces you to write better code.",{"type":414,"tag":1152,"props":4559,"children":4560},{"icon":3580},[4561],{"type":414,"tag":423,"props":4562,"children":4563},{},[4564],{"type":420,"value":4565},"As you can guess I am very happy to see that nullable will be enabled by default on new projects in .NET 6.  I think that warnings as errors for nullable should be set by default as well but that is another story.",{"type":414,"tag":423,"props":4567,"children":4568},{},[4569],{"type":420,"value":4570},"However, sometimes the compiler is not enough clever or does not have enough context to know that some code is fine and that it should not raise a warning. When something like that happens, we often solve this by using one of these 2 solutions:",{"type":414,"tag":4572,"props":4573,"children":4574},"ul",{},[4575,4589],{"type":414,"tag":1399,"props":4576,"children":4577},{},[4578,4580,4587],{"type":420,"value":4579},"Use the ",{"type":414,"tag":889,"props":4581,"children":4584},{"href":4582,"rel":4583},"https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-forgiving",[893],[4585],{"type":420,"value":4586},"null forgiving operator",{"type":420,"value":4588}," that should not be used in most cases",{"type":414,"tag":1399,"props":4590,"children":4591},{},[4592],{"type":420,"value":4593},"Use an additional and unnecessary check just to please the compiler",{"type":414,"tag":423,"props":4595,"children":4596},{},[4597,4599,4605],{"type":420,"value":4598},"It's because we often forget that we can add attributes on our code for null-state analysis as it is described in the ",{"type":414,"tag":889,"props":4600,"children":4603},{"href":4601,"rel":4602},"https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis",[893],[4604],{"type":420,"value":936},{"type":420,"value":4606},". These attributes will provide more information to the compiler which will be able to provide more accurate warnings.",{"type":414,"tag":423,"props":4608,"children":4609},{},[4610,4612,4618],{"type":420,"value":4611},"I recently read a Pull Request where the developer was doing an additional check on the nullability of an out parameter coming from a ",{"type":414,"tag":440,"props":4613,"children":4615},{"className":4614},[],[4616],{"type":420,"value":4617},"TryGet",{"type":420,"value":4619}," method like in the example below.",{"type":414,"tag":434,"props":4621,"children":4623},{"className":436,"code":4622,"language":326,"meta":401,"style":401},"string name = \".NET 6\";\nvar myStore = new MyAwesomeStore();\nmyStore.Add(\"WelcomeMessage\", \"  Hello \");\n\nif (myStore.TryGet(\"WelcomeMessage\", out var value) && value is not null)\n{\n    var welcomeMessage = value.TrimStart();\n    string message = welcomeMessage + name;\n}\n\npublic class MyAwesomeStore\n{\n    private IDictionary\u003Cstring, string> _store = new Dictionary\u003Cstring, string>();\n\n    public void Add(string key, string value) => _store.Add(key, value);\n    public bool TryGet(string key, out string? value) => _store.TryGetValue(key, out value);\n}\n",[4624],{"type":414,"tag":440,"props":4625,"children":4626},{"__ignoreMap":401},[4627,4660,4691,4746,4753,4842,4849,4883,4918,4925,4932,4948,4955,5026,5033,5116,5211],{"type":414,"tag":444,"props":4628,"children":4629},{"class":446,"line":447},[4630,4634,4639,4643,4647,4652,4656],{"type":414,"tag":444,"props":4631,"children":4632},{"style":468},[4633],{"type":420,"value":476},{"type":414,"tag":444,"props":4635,"children":4636},{"style":457},[4637],{"type":420,"value":4638}," name",{"type":414,"tag":444,"props":4640,"children":4641},{"style":468},[4642],{"type":420,"value":1622},{"type":414,"tag":444,"props":4644,"children":4645},{"style":468},[4646],{"type":420,"value":1050},{"type":414,"tag":444,"props":4648,"children":4649},{"style":748},[4650],{"type":420,"value":4651},".NET 6",{"type":414,"tag":444,"props":4653,"children":4654},{"style":468},[4655],{"type":420,"value":745},{"type":414,"tag":444,"props":4657,"children":4658},{"style":468},[4659],{"type":420,"value":577},{"type":414,"tag":444,"props":4661,"children":4662},{"class":446,"line":499},[4663,4668,4673,4677,4681,4686],{"type":414,"tag":444,"props":4664,"children":4665},{"style":457},[4666],{"type":420,"value":4667},"var",{"type":414,"tag":444,"props":4669,"children":4670},{"style":457},[4671],{"type":420,"value":4672}," myStore",{"type":414,"tag":444,"props":4674,"children":4675},{"style":468},[4676],{"type":420,"value":1622},{"type":414,"tag":444,"props":4678,"children":4679},{"style":468},[4680],{"type":420,"value":1894},{"type":414,"tag":444,"props":4682,"children":4683},{"style":457},[4684],{"type":420,"value":4685}," MyAwesomeStore",{"type":414,"tag":444,"props":4687,"children":4688},{"style":468},[4689],{"type":420,"value":4690},"();\n",{"type":414,"tag":444,"props":4692,"children":4693},{"class":446,"line":509},[4694,4699,4703,4708,4712,4716,4721,4725,4729,4733,4738,4742],{"type":414,"tag":444,"props":4695,"children":4696},{"style":647},[4697],{"type":420,"value":4698},"myStore",{"type":414,"tag":444,"props":4700,"children":4701},{"style":468},[4702],{"type":420,"value":795},{"type":414,"tag":444,"props":4704,"children":4705},{"style":597},[4706],{"type":420,"value":4707},"Add",{"type":414,"tag":444,"props":4709,"children":4710},{"style":468},[4711],{"type":420,"value":471},{"type":414,"tag":444,"props":4713,"children":4714},{"style":468},[4715],{"type":420,"value":745},{"type":414,"tag":444,"props":4717,"children":4718},{"style":748},[4719],{"type":420,"value":4720},"WelcomeMessage",{"type":414,"tag":444,"props":4722,"children":4723},{"style":468},[4724],{"type":420,"value":745},{"type":414,"tag":444,"props":4726,"children":4727},{"style":468},[4728],{"type":420,"value":1097},{"type":414,"tag":444,"props":4730,"children":4731},{"style":468},[4732],{"type":420,"value":1050},{"type":414,"tag":444,"props":4734,"children":4735},{"style":748},[4736],{"type":420,"value":4737},"  Hello ",{"type":414,"tag":444,"props":4739,"children":4740},{"style":468},[4741],{"type":420,"value":745},{"type":414,"tag":444,"props":4743,"children":4744},{"style":468},[4745],{"type":420,"value":496},{"type":414,"tag":444,"props":4747,"children":4748},{"class":446,"line":527},[4749],{"type":414,"tag":444,"props":4750,"children":4751},{"emptyLinePlaceholder":503},[4752],{"type":420,"value":506},{"type":414,"tag":444,"props":4754,"children":4755},{"class":446,"line":536},[4756,4761,4766,4770,4774,4778,4782,4786,4790,4794,4798,4803,4808,4813,4817,4822,4827,4832,4837],{"type":414,"tag":444,"props":4757,"children":4758},{"style":968},[4759],{"type":420,"value":4760},"if",{"type":414,"tag":444,"props":4762,"children":4763},{"style":468},[4764],{"type":420,"value":4765}," (",{"type":414,"tag":444,"props":4767,"children":4768},{"style":647},[4769],{"type":420,"value":4698},{"type":414,"tag":444,"props":4771,"children":4772},{"style":468},[4773],{"type":420,"value":795},{"type":414,"tag":444,"props":4775,"children":4776},{"style":597},[4777],{"type":420,"value":4617},{"type":414,"tag":444,"props":4779,"children":4780},{"style":468},[4781],{"type":420,"value":471},{"type":414,"tag":444,"props":4783,"children":4784},{"style":468},[4785],{"type":420,"value":745},{"type":414,"tag":444,"props":4787,"children":4788},{"style":748},[4789],{"type":420,"value":4720},{"type":414,"tag":444,"props":4791,"children":4792},{"style":468},[4793],{"type":420,"value":745},{"type":414,"tag":444,"props":4795,"children":4796},{"style":468},[4797],{"type":420,"value":1097},{"type":414,"tag":444,"props":4799,"children":4800},{"style":451},[4801],{"type":420,"value":4802}," out",{"type":414,"tag":444,"props":4804,"children":4805},{"style":457},[4806],{"type":420,"value":4807}," var",{"type":414,"tag":444,"props":4809,"children":4810},{"style":457},[4811],{"type":420,"value":4812}," value",{"type":414,"tag":444,"props":4814,"children":4815},{"style":468},[4816],{"type":420,"value":1675},{"type":414,"tag":444,"props":4818,"children":4819},{"style":468},[4820],{"type":420,"value":4821}," &&",{"type":414,"tag":444,"props":4823,"children":4824},{"style":647},[4825],{"type":420,"value":4826}," value ",{"type":414,"tag":444,"props":4828,"children":4829},{"style":468},[4830],{"type":420,"value":4831},"is",{"type":414,"tag":444,"props":4833,"children":4834},{"style":468},[4835],{"type":420,"value":4836}," not",{"type":414,"tag":444,"props":4838,"children":4839},{"style":468},[4840],{"type":420,"value":4841}," null)\n",{"type":414,"tag":444,"props":4843,"children":4844},{"class":446,"line":580},[4845],{"type":414,"tag":444,"props":4846,"children":4847},{"style":468},[4848],{"type":420,"value":533},{"type":414,"tag":444,"props":4850,"children":4851},{"class":446,"line":588},[4852,4857,4862,4866,4870,4874,4879],{"type":414,"tag":444,"props":4853,"children":4854},{"style":457},[4855],{"type":420,"value":4856},"    var",{"type":414,"tag":444,"props":4858,"children":4859},{"style":457},[4860],{"type":420,"value":4861}," welcomeMessage",{"type":414,"tag":444,"props":4863,"children":4864},{"style":468},[4865],{"type":420,"value":1622},{"type":414,"tag":444,"props":4867,"children":4868},{"style":647},[4869],{"type":420,"value":4812},{"type":414,"tag":444,"props":4871,"children":4872},{"style":468},[4873],{"type":420,"value":795},{"type":414,"tag":444,"props":4875,"children":4876},{"style":597},[4877],{"type":420,"value":4878},"TrimStart",{"type":414,"tag":444,"props":4880,"children":4881},{"style":468},[4882],{"type":420,"value":4690},{"type":414,"tag":444,"props":4884,"children":4885},{"class":446,"line":634},[4886,4891,4896,4900,4905,4910,4914],{"type":414,"tag":444,"props":4887,"children":4888},{"style":468},[4889],{"type":420,"value":4890},"    string",{"type":414,"tag":444,"props":4892,"children":4893},{"style":457},[4894],{"type":420,"value":4895}," message",{"type":414,"tag":444,"props":4897,"children":4898},{"style":468},[4899],{"type":420,"value":1622},{"type":414,"tag":444,"props":4901,"children":4902},{"style":647},[4903],{"type":420,"value":4904}," welcomeMessage ",{"type":414,"tag":444,"props":4906,"children":4907},{"style":468},[4908],{"type":420,"value":4909},"+",{"type":414,"tag":444,"props":4911,"children":4912},{"style":647},[4913],{"type":420,"value":4638},{"type":414,"tag":444,"props":4915,"children":4916},{"style":468},[4917],{"type":420,"value":577},{"type":414,"tag":444,"props":4919,"children":4920},{"class":446,"line":643},[4921],{"type":414,"tag":444,"props":4922,"children":4923},{"style":468},[4924],{"type":420,"value":882},{"type":414,"tag":444,"props":4926,"children":4927},{"class":446,"line":666},[4928],{"type":414,"tag":444,"props":4929,"children":4930},{"emptyLinePlaceholder":503},[4931],{"type":420,"value":506},{"type":414,"tag":444,"props":4933,"children":4934},{"class":446,"line":675},[4935,4939,4943],{"type":414,"tag":444,"props":4936,"children":4937},{"style":451},[4938],{"type":420,"value":454},{"type":414,"tag":444,"props":4940,"children":4941},{"style":457},[4942],{"type":420,"value":519},{"type":414,"tag":444,"props":4944,"children":4945},{"style":457},[4946],{"type":420,"value":4947}," MyAwesomeStore\n",{"type":414,"tag":444,"props":4949,"children":4950},{"class":446,"line":683},[4951],{"type":414,"tag":444,"props":4952,"children":4953},{"style":468},[4954],{"type":420,"value":533},{"type":414,"tag":444,"props":4956,"children":4957},{"class":446,"line":711},[4958,4962,4967,4971,4975,4979,4983,4987,4992,4996,5000,5005,5009,5013,5017,5021],{"type":414,"tag":444,"props":4959,"children":4960},{"style":451},[4961],{"type":420,"value":542},{"type":414,"tag":444,"props":4963,"children":4964},{"style":457},[4965],{"type":420,"value":4966}," IDictionary",{"type":414,"tag":444,"props":4968,"children":4969},{"style":468},[4970],{"type":420,"value":557},{"type":414,"tag":444,"props":4972,"children":4973},{"style":468},[4974],{"type":420,"value":476},{"type":414,"tag":444,"props":4976,"children":4977},{"style":468},[4978],{"type":420,"value":1097},{"type":414,"tag":444,"props":4980,"children":4981},{"style":468},[4982],{"type":420,"value":1670},{"type":414,"tag":444,"props":4984,"children":4985},{"style":468},[4986],{"type":420,"value":567},{"type":414,"tag":444,"props":4988,"children":4989},{"style":457},[4990],{"type":420,"value":4991}," _store",{"type":414,"tag":444,"props":4993,"children":4994},{"style":468},[4995],{"type":420,"value":1622},{"type":414,"tag":444,"props":4997,"children":4998},{"style":468},[4999],{"type":420,"value":1894},{"type":414,"tag":444,"props":5001,"children":5002},{"style":457},[5003],{"type":420,"value":5004}," Dictionary",{"type":414,"tag":444,"props":5006,"children":5007},{"style":468},[5008],{"type":420,"value":557},{"type":414,"tag":444,"props":5010,"children":5011},{"style":468},[5012],{"type":420,"value":476},{"type":414,"tag":444,"props":5014,"children":5015},{"style":468},[5016],{"type":420,"value":1097},{"type":414,"tag":444,"props":5018,"children":5019},{"style":468},[5020],{"type":420,"value":1670},{"type":414,"tag":444,"props":5022,"children":5023},{"style":468},[5024],{"type":420,"value":5025},">();\n",{"type":414,"tag":444,"props":5027,"children":5028},{"class":446,"line":776},[5029],{"type":414,"tag":444,"props":5030,"children":5031},{"emptyLinePlaceholder":503},[5032],{"type":420,"value":506},{"type":414,"tag":444,"props":5034,"children":5035},{"class":446,"line":784},[5036,5040,5044,5049,5053,5057,5062,5066,5070,5074,5078,5083,5087,5091,5095,5099,5104,5108,5112],{"type":414,"tag":444,"props":5037,"children":5038},{"style":451},[5039],{"type":420,"value":594},{"type":414,"tag":444,"props":5041,"children":5042},{"style":468},[5043],{"type":420,"value":721},{"type":414,"tag":444,"props":5045,"children":5046},{"style":597},[5047],{"type":420,"value":5048}," Add",{"type":414,"tag":444,"props":5050,"children":5051},{"style":468},[5052],{"type":420,"value":471},{"type":414,"tag":444,"props":5054,"children":5055},{"style":468},[5056],{"type":420,"value":476},{"type":414,"tag":444,"props":5058,"children":5059},{"style":457},[5060],{"type":420,"value":5061}," key",{"type":414,"tag":444,"props":5063,"children":5064},{"style":468},[5065],{"type":420,"value":1097},{"type":414,"tag":444,"props":5067,"children":5068},{"style":468},[5069],{"type":420,"value":1670},{"type":414,"tag":444,"props":5071,"children":5072},{"style":457},[5073],{"type":420,"value":4812},{"type":414,"tag":444,"props":5075,"children":5076},{"style":468},[5077],{"type":420,"value":1675},{"type":414,"tag":444,"props":5079,"children":5080},{"style":468},[5081],{"type":420,"value":5082}," =>",{"type":414,"tag":444,"props":5084,"children":5085},{"style":647},[5086],{"type":420,"value":4991},{"type":414,"tag":444,"props":5088,"children":5089},{"style":468},[5090],{"type":420,"value":795},{"type":414,"tag":444,"props":5092,"children":5093},{"style":597},[5094],{"type":420,"value":4707},{"type":414,"tag":444,"props":5096,"children":5097},{"style":468},[5098],{"type":420,"value":471},{"type":414,"tag":444,"props":5100,"children":5101},{"style":647},[5102],{"type":420,"value":5103},"key",{"type":414,"tag":444,"props":5105,"children":5106},{"style":468},[5107],{"type":420,"value":1097},{"type":414,"tag":444,"props":5109,"children":5110},{"style":647},[5111],{"type":420,"value":4812},{"type":414,"tag":444,"props":5113,"children":5114},{"style":468},[5115],{"type":420,"value":496},{"type":414,"tag":444,"props":5117,"children":5118},{"class":446,"line":868},[5119,5123,5128,5133,5137,5141,5145,5149,5153,5157,5162,5166,5170,5174,5178,5182,5187,5191,5195,5199,5203,5207],{"type":414,"tag":444,"props":5120,"children":5121},{"style":451},[5122],{"type":420,"value":594},{"type":414,"tag":444,"props":5124,"children":5125},{"style":468},[5126],{"type":420,"value":5127}," bool",{"type":414,"tag":444,"props":5129,"children":5130},{"style":597},[5131],{"type":420,"value":5132}," TryGet",{"type":414,"tag":444,"props":5134,"children":5135},{"style":468},[5136],{"type":420,"value":471},{"type":414,"tag":444,"props":5138,"children":5139},{"style":468},[5140],{"type":420,"value":476},{"type":414,"tag":444,"props":5142,"children":5143},{"style":457},[5144],{"type":420,"value":5061},{"type":414,"tag":444,"props":5146,"children":5147},{"style":468},[5148],{"type":420,"value":1097},{"type":414,"tag":444,"props":5150,"children":5151},{"style":451},[5152],{"type":420,"value":4802},{"type":414,"tag":444,"props":5154,"children":5155},{"style":468},[5156],{"type":420,"value":1670},{"type":414,"tag":444,"props":5158,"children":5159},{"style":468},[5160],{"type":420,"value":5161},"?",{"type":414,"tag":444,"props":5163,"children":5164},{"style":457},[5165],{"type":420,"value":4812},{"type":414,"tag":444,"props":5167,"children":5168},{"style":468},[5169],{"type":420,"value":1675},{"type":414,"tag":444,"props":5171,"children":5172},{"style":468},[5173],{"type":420,"value":5082},{"type":414,"tag":444,"props":5175,"children":5176},{"style":647},[5177],{"type":420,"value":4991},{"type":414,"tag":444,"props":5179,"children":5180},{"style":468},[5181],{"type":420,"value":795},{"type":414,"tag":444,"props":5183,"children":5184},{"style":597},[5185],{"type":420,"value":5186},"TryGetValue",{"type":414,"tag":444,"props":5188,"children":5189},{"style":468},[5190],{"type":420,"value":471},{"type":414,"tag":444,"props":5192,"children":5193},{"style":647},[5194],{"type":420,"value":5103},{"type":414,"tag":444,"props":5196,"children":5197},{"style":468},[5198],{"type":420,"value":1097},{"type":414,"tag":444,"props":5200,"children":5201},{"style":451},[5202],{"type":420,"value":4802},{"type":414,"tag":444,"props":5204,"children":5205},{"style":647},[5206],{"type":420,"value":4812},{"type":414,"tag":444,"props":5208,"children":5209},{"style":468},[5210],{"type":420,"value":496},{"type":414,"tag":444,"props":5212,"children":5213},{"class":446,"line":876},[5214],{"type":414,"tag":444,"props":5215,"children":5216},{"style":468},[5217],{"type":420,"value":882},{"type":414,"tag":423,"props":5219,"children":5220},{},[5221,5223,5228],{"type":420,"value":5222},"But if we annotate correctly the ",{"type":414,"tag":440,"props":5224,"children":5226},{"className":5225},[],[5227],{"type":420,"value":4617},{"type":420,"value":5229}," method we don't need this check:",{"type":414,"tag":434,"props":5231,"children":5233},{"className":436,"code":5232,"language":326,"meta":401,"style":401},"public bool TryGet(string key, [NotNullWhen(returnValue: true)] out string? value) => _store.TryGetValue(key, out value);\n",[5234],{"type":414,"tag":440,"props":5235,"children":5236},{"__ignoreMap":401},[5237],{"type":414,"tag":444,"props":5238,"children":5239},{"class":446,"line":447},[5240,5244,5248,5252,5256,5260,5264,5268,5273,5278,5282,5287,5291,5295,5299,5303,5307,5311,5315,5319,5323,5327,5331,5335,5339,5343,5347,5351,5355],{"type":414,"tag":444,"props":5241,"children":5242},{"style":451},[5243],{"type":420,"value":454},{"type":414,"tag":444,"props":5245,"children":5246},{"style":468},[5247],{"type":420,"value":5127},{"type":414,"tag":444,"props":5249,"children":5250},{"style":597},[5251],{"type":420,"value":5132},{"type":414,"tag":444,"props":5253,"children":5254},{"style":468},[5255],{"type":420,"value":471},{"type":414,"tag":444,"props":5257,"children":5258},{"style":468},[5259],{"type":420,"value":476},{"type":414,"tag":444,"props":5261,"children":5262},{"style":457},[5263],{"type":420,"value":5061},{"type":414,"tag":444,"props":5265,"children":5266},{"style":468},[5267],{"type":420,"value":1097},{"type":414,"tag":444,"props":5269,"children":5270},{"style":468},[5271],{"type":420,"value":5272}," [",{"type":414,"tag":444,"props":5274,"children":5275},{"style":457},[5276],{"type":420,"value":5277},"NotNullWhen",{"type":414,"tag":444,"props":5279,"children":5280},{"style":468},[5281],{"type":420,"value":471},{"type":414,"tag":444,"props":5283,"children":5284},{"style":647},[5285],{"type":420,"value":5286},"returnValue",{"type":414,"tag":444,"props":5288,"children":5289},{"style":468},[5290],{"type":420,"value":1005},{"type":414,"tag":444,"props":5292,"children":5293},{"style":1625},[5294],{"type":420,"value":1733},{"type":414,"tag":444,"props":5296,"children":5297},{"style":468},[5298],{"type":420,"value":760},{"type":414,"tag":444,"props":5300,"children":5301},{"style":451},[5302],{"type":420,"value":4802},{"type":414,"tag":444,"props":5304,"children":5305},{"style":468},[5306],{"type":420,"value":1670},{"type":414,"tag":444,"props":5308,"children":5309},{"style":468},[5310],{"type":420,"value":5161},{"type":414,"tag":444,"props":5312,"children":5313},{"style":457},[5314],{"type":420,"value":4812},{"type":414,"tag":444,"props":5316,"children":5317},{"style":468},[5318],{"type":420,"value":1675},{"type":414,"tag":444,"props":5320,"children":5321},{"style":468},[5322],{"type":420,"value":5082},{"type":414,"tag":444,"props":5324,"children":5325},{"style":647},[5326],{"type":420,"value":4991},{"type":414,"tag":444,"props":5328,"children":5329},{"style":468},[5330],{"type":420,"value":795},{"type":414,"tag":444,"props":5332,"children":5333},{"style":597},[5334],{"type":420,"value":5186},{"type":414,"tag":444,"props":5336,"children":5337},{"style":468},[5338],{"type":420,"value":471},{"type":414,"tag":444,"props":5340,"children":5341},{"style":647},[5342],{"type":420,"value":5103},{"type":414,"tag":444,"props":5344,"children":5345},{"style":468},[5346],{"type":420,"value":1097},{"type":414,"tag":444,"props":5348,"children":5349},{"style":451},[5350],{"type":420,"value":4802},{"type":414,"tag":444,"props":5352,"children":5353},{"style":647},[5354],{"type":420,"value":4812},{"type":414,"tag":444,"props":5356,"children":5357},{"style":468},[5358],{"type":420,"value":496},{"type":414,"tag":434,"props":5360,"children":5362},{"className":436,"code":5361,"language":326,"meta":401,"style":401},"if (myStore.TryGet(\"WelcomeMessage\", out var value))\n{\n",[5363],{"type":414,"tag":440,"props":5364,"children":5365},{"__ignoreMap":401},[5366,5426],{"type":414,"tag":444,"props":5367,"children":5368},{"class":446,"line":447},[5369,5373,5377,5381,5385,5389,5393,5397,5401,5405,5409,5413,5417,5421],{"type":414,"tag":444,"props":5370,"children":5371},{"style":968},[5372],{"type":420,"value":4760},{"type":414,"tag":444,"props":5374,"children":5375},{"style":468},[5376],{"type":420,"value":4765},{"type":414,"tag":444,"props":5378,"children":5379},{"style":647},[5380],{"type":420,"value":4698},{"type":414,"tag":444,"props":5382,"children":5383},{"style":468},[5384],{"type":420,"value":795},{"type":414,"tag":444,"props":5386,"children":5387},{"style":597},[5388],{"type":420,"value":4617},{"type":414,"tag":444,"props":5390,"children":5391},{"style":468},[5392],{"type":420,"value":471},{"type":414,"tag":444,"props":5394,"children":5395},{"style":468},[5396],{"type":420,"value":745},{"type":414,"tag":444,"props":5398,"children":5399},{"style":748},[5400],{"type":420,"value":4720},{"type":414,"tag":444,"props":5402,"children":5403},{"style":468},[5404],{"type":420,"value":745},{"type":414,"tag":444,"props":5406,"children":5407},{"style":468},[5408],{"type":420,"value":1097},{"type":414,"tag":444,"props":5410,"children":5411},{"style":451},[5412],{"type":420,"value":4802},{"type":414,"tag":444,"props":5414,"children":5415},{"style":457},[5416],{"type":420,"value":4807},{"type":414,"tag":444,"props":5418,"children":5419},{"style":457},[5420],{"type":420,"value":4812},{"type":414,"tag":444,"props":5422,"children":5423},{"style":468},[5424],{"type":420,"value":5425},"))\n",{"type":414,"tag":444,"props":5427,"children":5428},{"class":446,"line":499},[5429],{"type":414,"tag":444,"props":5430,"children":5431},{"style":468},[5432],{"type":420,"value":533},{"type":414,"tag":423,"props":5434,"children":5435},{},[5436],{"type":420,"value":1263},{"type":414,"tag":1265,"props":5438,"children":5439},{},[5440],{"type":420,"value":1269},{"title":401,"searchDepth":499,"depth":499,"links":5442},[5443,5444,5446,5447],{"id":4205,"depth":499,"text":4208},{"id":4247,"depth":499,"text":5445},"vscode-jest, a must-have extension when using Jest",{"id":4341,"depth":499,"text":4344},{"id":4549,"depth":499,"text":4552},"content:1.posts:26.w41-2021-tips-learned-this-week.md","1.posts/26.w41-2021-tips-learned-this-week.md",{"_path":82,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":81,"description":5451,"lead":5452,"date":5453,"image":5454,"badge":5455,"tags":5456,"body":5457,"_type":1275,"_id":5819,"_source":1277,"_file":5820,"_extension":1279},"This week is mainly about learning Azure tooling.","Azure emulators, Use my current account Edge extension, Azure icons in Visio, and Azure Charts.","2021-10-04T00:00:00.000Z",{"src":405},{"label":407},[272,228,318,321,324],{"type":411,"children":5458,"toc":5810},[5459,5463,5469,5476,5481,5490,5504,5571,5584,5590,5602,5615,5624,5629,5638,5652,5669,5675,5680,5689,5719,5725,5730,5752,5768,5774,5788,5797,5802,5806],{"type":414,"tag":423,"props":5460,"children":5461},{},[5462],{"type":420,"value":5451},{"type":414,"tag":415,"props":5464,"children":5466},{"id":5465},"playing-with-new-emulators",[5467],{"type":420,"value":5468},"Playing with \"new\" emulators",{"type":414,"tag":5470,"props":5471,"children":5473},"h3",{"id":5472},"azure-signalr-local-emulator",[5474],{"type":420,"value":5475},"Azure SignalR Local Emulator",{"type":414,"tag":423,"props":5477,"children":5478},{},[5479],{"type":420,"value":5480},"This week I was playing with SignalR Service (using the serverless service mode) and I needed to debug my Azure Functions locally. While I was implementing the infrastructure as code to deploy the Azure SignalR Service resource to Azure, I realized that I did not need to do that to test my code as there was a local emulator for SignalR Service. This emulator is currently in preview but looks promising.",{"type":414,"tag":423,"props":5482,"children":5483},{},[5484],{"type":414,"tag":903,"props":5485,"children":5489},{"alt":5486,"className":5487,"src":5488},"Azure SignalR Service emulator website.",[907,908],"/posts/images/w392021tips_nuget_1.png",[],{"type":414,"tag":423,"props":5491,"children":5492},{},[5493,5495,5502],{"type":420,"value":5494},"It is available as a ",{"type":414,"tag":889,"props":5496,"children":5499},{"href":5497,"rel":5498},"https://www.nuget.org/packages/Microsoft.Azure.SignalR.Emulator",[893],[5500],{"type":420,"value":5501},"dotnet tool",{"type":420,"value":5503}," here so you can just install it by using the following command:",{"type":414,"tag":434,"props":5505,"children":5507},{"className":1310,"code":5506,"language":248,"meta":401,"style":401},"dotnet tool install -g Microsoft.Azure.SignalR.Emulator --version 1.0.0-preview1-10809\n",[5508],{"type":414,"tag":440,"props":5509,"children":5510},{"__ignoreMap":401},[5511],{"type":414,"tag":444,"props":5512,"children":5513},{"class":446,"line":447},[5514,5519,5524,5529,5534,5539,5544,5548,5553,5557,5562,5566],{"type":414,"tag":444,"props":5515,"children":5516},{"style":647},[5517],{"type":420,"value":5518},"dotnet tool install ",{"type":414,"tag":444,"props":5520,"children":5521},{"style":468},[5522],{"type":420,"value":5523},"-",{"type":414,"tag":444,"props":5525,"children":5526},{"style":647},[5527],{"type":420,"value":5528},"g Microsoft.Azure.SignalR.Emulator ",{"type":414,"tag":444,"props":5530,"children":5531},{"style":468},[5532],{"type":420,"value":5533},"--",{"type":414,"tag":444,"props":5535,"children":5536},{"style":647},[5537],{"type":420,"value":5538},"version ",{"type":414,"tag":444,"props":5540,"children":5541},{"style":979},[5542],{"type":420,"value":5543},"1.0",{"type":414,"tag":444,"props":5545,"children":5546},{"style":647},[5547],{"type":420,"value":795},{"type":414,"tag":444,"props":5549,"children":5550},{"style":979},[5551],{"type":420,"value":5552},"0",{"type":414,"tag":444,"props":5554,"children":5555},{"style":468},[5556],{"type":420,"value":5523},{"type":414,"tag":444,"props":5558,"children":5559},{"style":647},[5560],{"type":420,"value":5561},"preview1",{"type":414,"tag":444,"props":5563,"children":5564},{"style":468},[5565],{"type":420,"value":5523},{"type":414,"tag":444,"props":5567,"children":5568},{"style":979},[5569],{"type":420,"value":5570},"10809\n",{"type":414,"tag":423,"props":5572,"children":5573},{},[5574,5576,5582],{"type":420,"value":5575},"Have a look at the ",{"type":414,"tag":889,"props":5577,"children":5580},{"href":5578,"rel":5579},"https://github.com/Azure/azure-signalr/blob/dev/docs/emulator.md",[893],[5581],{"type":420,"value":936},{"type":420,"value":5583}," if you want to learn more about it.",{"type":414,"tag":5470,"props":5585,"children":5587},{"id":5586},"azurite",[5588],{"type":420,"value":5589},"Azurite",{"type":414,"tag":423,"props":5591,"children":5592},{},[5593,5595,5600],{"type":420,"value":5594},"You probably have already heard about ",{"type":414,"tag":889,"props":5596,"children":5598},{"href":891,"rel":5597},[893],[5599],{"type":420,"value":5589},{"type":420,"value":5601}," the cross-platform emulator for local Azure Storage development. It is really useful when you are using queues, tables, or blobs from Azure Storage in your project and you want to debug your code with emulated versions of these services running locally. If you are developing Azure Functions you are certainly using an emulator for the storage but maybe not be aware of it.",{"type":414,"tag":423,"props":5603,"children":5604},{},[5605,5607,5613],{"type":420,"value":5606},"Azurite is the successor of Azure Storage Emulator but as the ",{"type":414,"tag":889,"props":5608,"children":5611},{"href":5609,"rel":5610},"https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator",[893],[5612],{"type":420,"value":936},{"type":420,"value":5614}," says:",{"type":414,"tag":423,"props":5616,"children":5617},{},[5618],{"type":414,"tag":903,"props":5619,"children":5623},{"alt":5620,"className":5621,"src":5622},"Documentation about Azure Storage emulator deprecation.",[907,908],"/posts/images/w392021tips_azurite_1.png",[],{"type":414,"tag":423,"props":5625,"children":5626},{},[5627],{"type":420,"value":5628},"It's funny because I try to keep myself up-to-date on this kind of news but I did not know at all Azure Storage Emulator had been already deprecated in favor of Azurite for quite some time. Yet, as you can see in the following screenshot when you create a Function App with the \"storage emulator\" option selected you can see the Azurite emulator in your connected services:",{"type":414,"tag":423,"props":5630,"children":5631},{},[5632],{"type":414,"tag":903,"props":5633,"children":5637},{"alt":5634,"className":5635,"src":5636},"Service dependencies in Visual Studio.",[907,908],"/posts/images/w392021tips_vs_1.png",[],{"type":414,"tag":423,"props":5639,"children":5640},{},[5641,5643,5650],{"type":420,"value":5642},"You can check this ",{"type":414,"tag":889,"props":5644,"children":5647},{"href":5645,"rel":5646},"https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio",[893],[5648],{"type":420,"value":5649},"tutorial",{"type":420,"value":5651}," to see how to install and use Azurite.",{"type":414,"tag":1152,"props":5653,"children":5654},{"icon":3580},[5655],{"type":414,"tag":423,"props":5656,"children":5657},{},[5658,5660,5667],{"type":420,"value":5659},"Be aware that Azurite is also available in a ",{"type":414,"tag":889,"props":5661,"children":5664},{"href":5662,"rel":5663},"https://marketplace.visualstudio.com/items?itemName=Azurite.azurite",[893],[5665],{"type":420,"value":5666},"vscode extension",{"type":420,"value":5668}," which allows you to start and stop storage services individually. If you don't want to bother with the command line, using Azurite from vscode is a good option.",{"type":414,"tag":415,"props":5670,"children":5672},{"id":5671},"using-your-edge-profile-and-skipping-the-account-prompt-screen-when-signing-into-microsoft-sites",[5673],{"type":420,"value":5674},"Using your Edge profile and skipping the account prompt screen when signing into Microsoft sites.",{"type":414,"tag":423,"props":5676,"children":5677},{},[5678],{"type":420,"value":5679},"As I have different Azure Active Directory accounts (for my company, for some of the clients I am working for, for testing purposes) it can be quite challenging to manage so I am using different Microsoft Edge profiles to keep things separated and to avoid signing out when switching from one account to another. However, even with different profiles, when you access a Microsoft site (Azure DevOps for instance) the browser prompts you to choose the account you want to use.",{"type":414,"tag":423,"props":5681,"children":5682},{},[5683],{"type":414,"tag":903,"props":5684,"children":5688},{"alt":5685,"className":5686,"src":5687},"Use my current account extension page.",[907,908],"/posts/images/w392021tips_extension_1.png",[],{"type":414,"tag":423,"props":5690,"children":5691},{},[5692,5694,5700,5702,5708,5710,5717],{"type":420,"value":5693},"Claire Novotny (currently executive director at the .NET Foundation and working in the .NET team at Microsoft) developed a Microsoft Edge extension ",{"type":414,"tag":440,"props":5695,"children":5697},{"className":5696},[],[5698],{"type":420,"value":5699},"Use my current account",{"type":420,"value":5701}," that solves this problem. This plugin is available ",{"type":414,"tag":889,"props":5703,"children":5706},{"href":5704,"rel":5705},"https://microsoftedge.microsoft.com/addons/detail/use-my-current-account/hbfacnnpimgddoojjaonnnbeljegicfl",[893],[5707],{"type":420,"value":1340},{"type":420,"value":5709}," to download and you can check the source code on ",{"type":414,"tag":889,"props":5711,"children":5714},{"href":5712,"rel":5713},"https://github.com/novotnyllc/UseMyCurrentAccount",[893],[5715],{"type":420,"value":5716},"this GitHub repository",{"type":420,"value":5718},". It is a simple but very useful extension that I strongly encourage you to download if you use multiple Azure AD accounts.",{"type":414,"tag":415,"props":5720,"children":5722},{"id":5721},"using-up-to-date-azure-icons-in-visio",[5723],{"type":420,"value":5724},"Using up-to-date Azure icons in Visio.",{"type":414,"tag":423,"props":5726,"children":5727},{},[5728],{"type":420,"value":5729},"I use Visio from time to time to create nice-looking Azure architecture diagrams (at least I try 😀). To do that I use Visio packages about Azure some people provide on GitHub and that contain all the Azure resources icons I need.",{"type":414,"tag":423,"props":5731,"children":5732},{},[5733,5735,5742,5744,5750],{"type":420,"value":5734},"Azure icons often change, and there are always new resources added so always downloading the latest version of these Visio packages is a bit cumbersome. Fortunately, my friend Xavier Mignot shared on his ",{"type":414,"tag":889,"props":5736,"children":5739},{"href":5737,"rel":5738},"https://blog.xmi.fr/posts/visio-tips-git-clone/",[893],[5740],{"type":420,"value":5741},"blog",{"type":420,"value":5743}," a nice and simple solution for that problem: cloning the Visio packages git repositories under the ",{"type":414,"tag":440,"props":5745,"children":5747},{"className":5746},[],[5748],{"type":420,"value":5749},"My Shapes",{"type":420,"value":5751}," folder and regularly pulling new changes to have always up-to-date Azure icons.",{"type":414,"tag":1152,"props":5753,"children":5754},{"icon":3580},[5755],{"type":414,"tag":423,"props":5756,"children":5757},{},[5758,5760,5766],{"type":420,"value":5759},"If you want more tips about Visio, check the other articles of Xavier on his ",{"type":414,"tag":889,"props":5761,"children":5764},{"href":5762,"rel":5763},"https://blog.xmi.fr/",[893],[5765],{"type":420,"value":5741},{"type":420,"value":5767},", there are also articles about Azure, IoT, .NET...",{"type":414,"tag":415,"props":5769,"children":5771},{"id":5770},"explore-azure-services-easily-with-azure-charts",[5772],{"type":420,"value":5773},"Explore Azure services easily with Azure Charts",{"type":414,"tag":423,"props":5775,"children":5776},{},[5777,5779,5786],{"type":420,"value":5778},"Microsoft's documentation is great but it is sometimes not easy to have a good overview of the services Azure provides. Finding basic things like the SLA of a service, the regions where it is available, and the learning resources to getting started on it can often take time. Unless you know about Alexey Polkovnikov's website ",{"type":414,"tag":889,"props":5780,"children":5783},{"href":5781,"rel":5782},"https://azurecharts.com/",[893],[5784],{"type":420,"value":5785},"Azure Charts",{"type":420,"value":5787}," which gives you all that and much more in a visual way.",{"type":414,"tag":423,"props":5789,"children":5790},{},[5791],{"type":414,"tag":903,"props":5792,"children":5796},{"alt":5793,"className":5794,"src":5795},"Azure Charts website.",[907,908],"/posts/images/w392021tips_charts_1.png",[],{"type":414,"tag":423,"props":5798,"children":5799},{},[5800],{"type":420,"value":5801},"It's not a website I discovered this week but I showed it to a colleague this week and I thought (as each time I go on this website) that I should use it more often as it is a very useful tool.",{"type":414,"tag":423,"props":5803,"children":5804},{},[5805],{"type":420,"value":1263},{"type":414,"tag":1265,"props":5807,"children":5808},{},[5809],{"type":420,"value":1269},{"title":401,"searchDepth":499,"depth":499,"links":5811},[5812,5816,5817,5818],{"id":5465,"depth":499,"text":5468,"children":5813},[5814,5815],{"id":5472,"depth":509,"text":5475},{"id":5586,"depth":509,"text":5589},{"id":5671,"depth":499,"text":5674},{"id":5721,"depth":499,"text":5724},{"id":5770,"depth":499,"text":5773},"content:1.posts:25.w39-2021-tips-learned-this-week.md","1.posts/25.w39-2021-tips-learned-this-week.md",{"_path":64,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":63,"description":5822,"lead":5823,"date":5824,"image":5825,"badge":5826,"tags":5827,"body":5828,"_type":1275,"_id":6181,"_source":1277,"_file":6182,"_extension":1279},"This week I learned some Azure CLI commands, how to have JSON IntelliSense in vscode and that Azure Storage Explorer was usable again.","IntelliSense in vscode, Azure CLI command to get assigned roles, and Azure Storage Explorer new version.","2021-06-07T00:00:00.000Z",{"src":405},{"label":407},[272,208,225,228],{"type":411,"children":5829,"toc":6176},[5830,5834,5840,5845,5858,5867,5872,5885,5891,5910,5919,5946,5966,6008,6013,6131,6137,6149,6154,6163,6168,6172],{"type":414,"tag":423,"props":5831,"children":5832},{},[5833],{"type":420,"value":5822},{"type":414,"tag":415,"props":5835,"children":5837},{"id":5836},"autocompletion-and-schema-validation-when-editing-a-json-file-in-vscode",[5838],{"type":420,"value":5839},"Autocompletion and schema validation when editing a JSON file in vscode.",{"type":414,"tag":423,"props":5841,"children":5842},{},[5843],{"type":420,"value":5844},"When you are editing a JSON file in vscode, chances are that there is a JSON schema somewhere that describes the shape of the JSON you are modifying. Wouldn't it be great if vscode could provide you suggestions and validate the JSON according to such a schema while you are typing ⌨?",{"type":414,"tag":423,"props":5846,"children":5847},{},[5848,5850,5856],{"type":420,"value":5849},"Well in fact it is possible, you just have to add at the beginning of your file a ",{"type":414,"tag":440,"props":5851,"children":5853},{"className":5852},[],[5854],{"type":420,"value":5855},"$schema",{"type":420,"value":5857}," key (with the URI of the JSON schema as the value) and you will have IntelliSense to edit your JSON in vscode.",{"type":414,"tag":423,"props":5859,"children":5860},{},[5861],{"type":414,"tag":903,"props":5862,"children":5866},{"alt":5863,"className":5864,"src":5865},"Json file in vscode.",[907,908],"/posts/images/w222021tips_vscode_1.png",[],{"type":414,"tag":423,"props":5868,"children":5869},{},[5870],{"type":420,"value":5871},"In the screenshot above, I am editing a JSON file where the linked JSON schema is a Microsoft Teams app manifest schema, and as you can see vscode gives me suggestions based on this schema.",{"type":414,"tag":423,"props":5873,"children":5874},{},[5875,5877,5884],{"type":420,"value":5876},"This is a tip that you probably already know but as far as I am concerned I only discovered it recently and it is really useful. If you want to do more advanced things like mapping some files types to specific JSON schemas you can have a look in ",{"type":414,"tag":889,"props":5878,"children":5881},{"href":5879,"rel":5880},"https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings",[893],[5882],{"type":420,"value":5883},"vscode documentation",{"type":420,"value":795},{"type":414,"tag":415,"props":5886,"children":5888},{"id":5887},"listing-assigned-roles-for-a-user-on-a-subscription-with-azure-cli",[5889],{"type":420,"value":5890},"Listing assigned roles for a user on a subscription with Azure CLI",{"type":414,"tag":423,"props":5892,"children":5893},{},[5894,5896,5909],{"type":420,"value":5895},"I recently had to list all the roles assigned to my user on a subscription. 👮‍♀️\nFor that I used the ",{"type":414,"tag":889,"props":5897,"children":5900},{"href":5898,"rel":5899},"https://docs.microsoft.com/en-us/cli/azure/role/assignment?view=azure-cli-latest#az_role_assignment_list",[893],[5901,5907],{"type":414,"tag":440,"props":5902,"children":5904},{"className":5903},[],[5905],{"type":420,"value":5906},"az role assignment list",{"type":420,"value":5908}," command",{"type":420,"value":898},{"type":414,"tag":423,"props":5911,"children":5912},{},[5913],{"type":414,"tag":903,"props":5914,"children":5918},{"alt":5915,"className":5916,"src":5917},"Terminal showing az role assigment command.",[907,908],"/posts/images/w222021tips_azcli_1.png",[],{"type":414,"tag":423,"props":5920,"children":5921},{},[5922,5924,5930,5932,5938,5939,5945],{"type":420,"value":5923},"I am filtering the command result with the ",{"type":414,"tag":440,"props":5925,"children":5927},{"className":5926},[],[5928],{"type":420,"value":5929},"--query",{"type":420,"value":5931}," argument to only have the information I am interested in which are ",{"type":414,"tag":440,"props":5933,"children":5935},{"className":5934},[],[5936],{"type":420,"value":5937},"roleDefinitionName",{"type":420,"value":1832},{"type":414,"tag":440,"props":5940,"children":5942},{"className":5941},[],[5943],{"type":420,"value":5944},"scope",{"type":420,"value":795},{"type":414,"tag":423,"props":5947,"children":5948},{},[5949,5951,5957,5959,5965],{"type":420,"value":5950},"You can specify a subscription by using the optional parameter ",{"type":414,"tag":440,"props":5952,"children":5954},{"className":5953},[],[5955],{"type":420,"value":5956},"--subscription",{"type":420,"value":5958}," but by default, the subscription selected is the current subscription which you can see by doing an ",{"type":414,"tag":440,"props":5960,"children":5962},{"className":5961},[],[5963],{"type":420,"value":5964},"az account show",{"type":420,"value":795},{"type":414,"tag":423,"props":5967,"children":5968},{},[5969,5971,5977,5979,5985,5987,5993,5995,6006],{"type":420,"value":5970},"The variable ",{"type":414,"tag":440,"props":5972,"children":5974},{"className":5973},[],[5975],{"type":420,"value":5976},"UserId",{"type":420,"value":5978}," which is passed to the option ",{"type":414,"tag":440,"props":5980,"children":5982},{"className":5981},[],[5983],{"type":420,"value":5984},"--assignee",{"type":420,"value":5986}," contains my user id but I could have also passed my user principal name. As I was looking to list my assigned roles on a subscription in a tenant id where I am a guest, my user principal name is a bit strange with an ",{"type":414,"tag":440,"props":5988,"children":5990},{"className":5989},[],[5991],{"type":420,"value":5992},"#EXT#",{"type":420,"value":5994}," in it so I can never remember what it is. And as I don't know by heart my user id either, I use the ",{"type":414,"tag":889,"props":5996,"children":5999},{"href":5997,"rel":5998},"https://docs.microsoft.com/en-us/cli/azure/ad/user?view=azure-cli-latest#az_ad_user_show",[893],[6000],{"type":414,"tag":440,"props":6001,"children":6003},{"className":6002},[],[6004],{"type":420,"value":6005},"az ad signed-in-user show",{"type":420,"value":6007}," command to get my user id.",{"type":414,"tag":423,"props":6009,"children":6010},{},[6011],{"type":420,"value":6012},"So at the end my command to list the assigned roles to my user on the current subscription is the following:",{"type":414,"tag":434,"props":6014,"children":6016},{"className":1310,"code":6015,"language":248,"meta":401,"style":401},"az role assignment list --assignee $(az ad signed-in-user show --query \"objectId\") --query \"[*].{role:roleDefinitionName,scope:scope}\" --include-inherited\n",[6017],{"type":414,"tag":440,"props":6018,"children":6019},{"__ignoreMap":401},[6020],{"type":414,"tag":444,"props":6021,"children":6022},{"class":446,"line":447},[6023,6028,6032,6037,6042,6047,6051,6056,6060,6065,6069,6074,6078,6083,6087,6091,6096,6100,6104,6109,6113,6117,6122,6126],{"type":414,"tag":444,"props":6024,"children":6025},{"style":647},[6026],{"type":420,"value":6027},"az role assignment list ",{"type":414,"tag":444,"props":6029,"children":6030},{"style":468},[6031],{"type":420,"value":5533},{"type":414,"tag":444,"props":6033,"children":6034},{"style":647},[6035],{"type":420,"value":6036},"assignee ",{"type":414,"tag":444,"props":6038,"children":6039},{"style":468},[6040],{"type":420,"value":6041},"$(",{"type":414,"tag":444,"props":6043,"children":6044},{"style":647},[6045],{"type":420,"value":6046},"az ad signed",{"type":414,"tag":444,"props":6048,"children":6049},{"style":468},[6050],{"type":420,"value":5523},{"type":414,"tag":444,"props":6052,"children":6053},{"style":647},[6054],{"type":420,"value":6055},"in",{"type":414,"tag":444,"props":6057,"children":6058},{"style":468},[6059],{"type":420,"value":5523},{"type":414,"tag":444,"props":6061,"children":6062},{"style":647},[6063],{"type":420,"value":6064},"user show ",{"type":414,"tag":444,"props":6066,"children":6067},{"style":468},[6068],{"type":420,"value":5533},{"type":414,"tag":444,"props":6070,"children":6071},{"style":647},[6072],{"type":420,"value":6073},"query ",{"type":414,"tag":444,"props":6075,"children":6076},{"style":468},[6077],{"type":420,"value":745},{"type":414,"tag":444,"props":6079,"children":6080},{"style":748},[6081],{"type":420,"value":6082},"objectId",{"type":414,"tag":444,"props":6084,"children":6085},{"style":468},[6086],{"type":420,"value":745},{"type":414,"tag":444,"props":6088,"children":6089},{"style":468},[6090],{"type":420,"value":1675},{"type":414,"tag":444,"props":6092,"children":6093},{"style":468},[6094],{"type":420,"value":6095}," --",{"type":414,"tag":444,"props":6097,"children":6098},{"style":647},[6099],{"type":420,"value":6073},{"type":414,"tag":444,"props":6101,"children":6102},{"style":468},[6103],{"type":420,"value":745},{"type":414,"tag":444,"props":6105,"children":6106},{"style":748},[6107],{"type":420,"value":6108},"[*].{role:roleDefinitionName,scope:scope}",{"type":414,"tag":444,"props":6110,"children":6111},{"style":468},[6112],{"type":420,"value":745},{"type":414,"tag":444,"props":6114,"children":6115},{"style":468},[6116],{"type":420,"value":6095},{"type":414,"tag":444,"props":6118,"children":6119},{"style":647},[6120],{"type":420,"value":6121},"include",{"type":414,"tag":444,"props":6123,"children":6124},{"style":468},[6125],{"type":420,"value":5523},{"type":414,"tag":444,"props":6127,"children":6128},{"style":647},[6129],{"type":420,"value":6130},"inherited\n",{"type":414,"tag":415,"props":6132,"children":6134},{"id":6133},"azure-storage-explorer-just-got-better",[6135],{"type":420,"value":6136},"Azure Storage Explorer just got better!",{"type":414,"tag":423,"props":6138,"children":6139},{},[6140,6147],{"type":414,"tag":889,"props":6141,"children":6144},{"href":6142,"rel":6143},"https://azure.microsoft.com/en-us/features/storage-explorer/",[893],[6145],{"type":420,"value":6146},"Azure Storage Explorer",{"type":420,"value":6148}," is a tool to manage your Azure cloud storage resources from your desktop. Instead of going to the Azure portal and navigating between all the panes and resources, you can do everything from this tool like viewing the tables and blobs in the storage accounts you have access to.",{"type":414,"tag":423,"props":6150,"children":6151},{},[6152],{"type":420,"value":6153},"Unfortunately, if your account had access to multiple subscriptions on multiple tenants with MFA enabled, using Azure Storage Explorer was a nightmare where you had to log in to every tenant multiple times to access any storage account. If you had the correct permissions you ended up grabbing a secret connection string to access your storage account from Azure Storage Explorer but it was not a good solution (using secrets instead of your Azure AD account to access resources is never a good idea ⛔).",{"type":414,"tag":423,"props":6155,"children":6156},{},[6157],{"type":414,"tag":903,"props":6158,"children":6162},{"alt":6159,"className":6160,"src":6161},"Azure Storage Explorer account management section.",[907,908],"/posts/images/w222021tips_storageexplorer_1.png",[],{"type":414,"tag":423,"props":6164,"children":6165},{},[6166],{"type":420,"value":6167},"As you can see on the screenshot above, in v1.19.x Azure Storage Explorer account management section has been completely refreshed to allow us to control exactly the tenants and the subscriptions that we want to load. This way we only have to enter the credentials we need and Azure Storage Explorer becomes usable again! 🎉",{"type":414,"tag":423,"props":6169,"children":6170},{},[6171],{"type":420,"value":1263},{"type":414,"tag":1265,"props":6173,"children":6174},{},[6175],{"type":420,"value":1269},{"title":401,"searchDepth":499,"depth":499,"links":6177},[6178,6179,6180],{"id":5836,"depth":499,"text":5839},{"id":5887,"depth":499,"text":5890},{"id":6133,"depth":499,"text":6136},"content:1.posts:19.w22-2021-tips-learned-this-week.md","1.posts/19.w22-2021-tips-learned-this-week.md",{"_path":52,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":51,"description":6184,"lead":6185,"date":6186,"image":6187,"badge":6188,"tags":6189,"body":6190,"_type":1275,"_id":6360,"_source":1277,"_file":6361,"_extension":1279},"This week I learned a few things related to vscode and especially about the Azure IoT Hub vscode extension.","Azure tenant in vs code and Azure IoT Hub vs code extension.","2021-04-10T00:00:00.000Z",{"src":405},{"label":407},[272,208,284,228],{"type":411,"children":6191,"toc":6356},[6192,6205,6211,6225,6245,6254,6269,6275,6280,6292,6301,6306,6315,6320,6329,6343,6352],{"type":414,"tag":423,"props":6193,"children":6194},{},[6195,6197,6203],{"type":420,"value":6196},"This week I learned a few things related to vscode and especially about the ",{"type":414,"tag":440,"props":6198,"children":6200},{"className":6199},[],[6201],{"type":420,"value":6202},"Azure IoT Hub",{"type":420,"value":6204}," vscode extension.",{"type":414,"tag":415,"props":6206,"children":6208},{"id":6207},"accessing-azure-resources-in-vscode-from-a-specific-tenant",[6209],{"type":420,"value":6210},"Accessing Azure resources in vscode from a specific tenant.",{"type":414,"tag":423,"props":6212,"children":6213},{},[6214,6216,6223],{"type":420,"value":6215},"There are a lot of vscode extensions (like the ones in ",{"type":414,"tag":889,"props":6217,"children":6220},{"href":6218,"rel":6219},"https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack",[893],[6221],{"type":420,"value":6222},"this extension pack",{"type":420,"value":6224},") that allow you to access and manipulate your Azure resources from Visual Studio Code.",{"type":414,"tag":423,"props":6226,"children":6227},{},[6228,6230,6243],{"type":420,"value":6229},"This ",{"type":414,"tag":889,"props":6231,"children":6234},{"href":6232,"rel":6233},"https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account",[893],[6235,6237],{"type":420,"value":6236},"specific extension ",{"type":414,"tag":440,"props":6238,"children":6240},{"className":6239},[],[6241],{"type":420,"value":6242},"Azure Account",{"type":420,"value":6244}," makes it easy for you to sign in to your Azure account and select the subscription you want to use. But what if you are working in a consulting company that works for different companies? How do you indicate the tenant of the customer to sign in to? Well, the answer is quite simple, the extension exposes a setting in vscode to specify a specific tenant to use.",{"type":414,"tag":423,"props":6246,"children":6247},{},[6248],{"type":414,"tag":903,"props":6249,"children":6253},{"alt":6250,"className":6251,"src":6252},"Azure tenant settings in vscode.",[907,908],"/posts/images/w142021tips_vscode_1.png",[],{"type":414,"tag":1152,"props":6255,"children":6257},{"icon":6256},"i-fluent-emoji-flat-pushpin",[6258],{"type":414,"tag":423,"props":6259,"children":6260},{},[6261,6263],{"type":420,"value":6262},"If you like to update the settings in JSON mode the key to use is ",{"type":414,"tag":440,"props":6264,"children":6266},{"className":6265},[],[6267],{"type":420,"value":6268},"azure.tenant",{"type":414,"tag":415,"props":6270,"children":6272},{"id":6271},"azure-iot-hub-vs-code-extension-is-awesome",[6273],{"type":420,"value":6274},"Azure IoT Hub vs code extension is awesome.",{"type":414,"tag":423,"props":6276,"children":6277},{},[6278],{"type":420,"value":6279},"I think everything is in the title. I knew about this extension before this week but I did not take the time to really use it. However this week it helped me a lot for my sprint demo where I needed to show new functionalities I implemented on an IoT backend: modify device twin tags in the IoT Hub and send some messages to an IoT device under certain conditions.",{"type":414,"tag":423,"props":6281,"children":6282},{},[6283,6285,6290],{"type":420,"value":6284},"The Azure IoT Hub extension adds an ",{"type":414,"tag":440,"props":6286,"children":6288},{"className":6287},[],[6289],{"type":420,"value":6202},{"type":420,"value":6291}," view in the Explorer where you can see the devices of the IoT Hub you selected and can do some actions on them.",{"type":414,"tag":423,"props":6293,"children":6294},{},[6295],{"type":414,"tag":903,"props":6296,"children":6300},{"alt":6297,"className":6298,"src":6299},"Azure IoT Hub view in vscode.",[907,908],"/posts/images/w142021tips_vscode_2.png",[],{"type":414,"tag":423,"props":6302,"children":6303},{},[6304],{"type":420,"value":6305},"There are also a lot of commands you can use to interact with an IoT Hub and its devices.",{"type":414,"tag":423,"props":6307,"children":6308},{},[6309],{"type":414,"tag":903,"props":6310,"children":6314},{"alt":6311,"className":6312,"src":6313},"Azure IoT Hub commands in vscode command palette.",[907,908],"/posts/images/w142021tips_vscode_3.png",[],{"type":414,"tag":423,"props":6316,"children":6317},{},[6318],{"type":420,"value":6319},"You can do pretty much anything you want from sending C2D / D2C messages to monitoring C2D / D2C messages. I found it quite nice to be able to directly visualize and edit a device twin as a JSON  document in vs code.",{"type":414,"tag":423,"props":6321,"children":6322},{},[6323],{"type":414,"tag":903,"props":6324,"children":6328},{"alt":6325,"className":6326,"src":6327},"Device twin json in vscode.",[907,908],"/posts/images/w142021tips_vscode_4.png",[],{"type":414,"tag":423,"props":6330,"children":6331},{},[6332,6334,6341],{"type":420,"value":6333},"To quickly test something related to IoT Hub, the Azure IoT Hub extension is a very useful tool. An interesting alternative to this tool is the ",{"type":414,"tag":889,"props":6335,"children":6338},{"href":6336,"rel":6337},"https://github.com/Azure/azure-iot-explorer/releases",[893],[6339],{"type":420,"value":6340},"Azure IoT Explorer",{"type":420,"value":6342}," which is more user-friendly thanks to its simple UI but does not have all the features.",{"type":414,"tag":423,"props":6344,"children":6345},{},[6346],{"type":414,"tag":903,"props":6347,"children":6351},{"alt":6348,"className":6349,"src":6350},"Device twin json in Azure Iot Explorer.",[907,908],"/posts/images/w142021tips_iotexplorer_1.png",[],{"type":414,"tag":423,"props":6353,"children":6354},{},[6355],{"type":420,"value":1263},{"title":401,"searchDepth":499,"depth":499,"links":6357},[6358,6359],{"id":6207,"depth":499,"text":6210},{"id":6271,"depth":499,"text":6274},"content:1.posts:15.w14-2021-tips-learned-this-week.md","1.posts/15.w14-2021-tips-learned-this-week.md",{"_path":49,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":48,"description":6363,"lead":6364,"date":6365,"image":6366,"badge":6367,"tags":6368,"body":6369,"_type":1275,"_id":6774,"_source":1277,"_file":6775,"_extension":1279},"This week I learned a few things related to versioning an application","Version in git tag with Azure Pipelines and in application insight logs.","2021-03-26T00:00:00.000Z",{"src":405},{"label":407},[272,241,278,281],{"type":411,"children":6370,"toc":6770},[6371,6375,6381,6394,6399,6421,6426,6506,6541,6554,6599,6611,6617,6630,6639,6644,6671,6762,6766],{"type":414,"tag":423,"props":6372,"children":6373},{},[6374],{"type":420,"value":6363},{"type":414,"tag":415,"props":6376,"children":6378},{"id":6377},"create-a-git-tag-from-an-azure-pipeline",[6379],{"type":420,"value":6380},"Create a git tag from an Azure Pipeline.",{"type":414,"tag":423,"props":6382,"children":6383},{},[6384,6386,6392],{"type":420,"value":6385},"Creating a git tag for your repository stored in Azure DevOps can be done quite easily by creating a tag in your local repository and pushing it to Azure DevOps or by simply manually creating it from the ",{"type":414,"tag":440,"props":6387,"children":6389},{"className":6388},[],[6390],{"type":420,"value":6391},"Tags",{"type":420,"value":6393}," page in Azure DevOps. So why bother creating a tag from an Azure Pipeline?",{"type":414,"tag":423,"props":6395,"children":6396},{},[6397],{"type":420,"value":6398},"Doing things manually is error-prone and takes time, so for repetitive tasks, it is a good idea to automate them. And Azure Pipelines are great at automating things especially when it is relative to building or deploying code. In my team what we wanted was to have our CI/CD pipeline compute in what version was the code we were building and automatically tag the commit built with that version.",{"type":414,"tag":423,"props":6400,"children":6401},{},[6402,6404,6411,6413,6420],{"type":420,"value":6403},"Computing the version in an azure pipeline is not the topic here, so let's just say there are multiple ways to do that like using ",{"type":414,"tag":889,"props":6405,"children":6408},{"href":6406,"rel":6407},"https://docs.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#counter",[893],[6409],{"type":420,"value":6410},"variables and the counter expression",{"type":420,"value":6412}," or using the ",{"type":414,"tag":889,"props":6414,"children":6417},{"href":6415,"rel":6416},"https://marketplace.visualstudio.com/items?itemName=gittools.gittools",[893],[6418],{"type":420,"value":6419},"gitversion task",{"type":420,"value":795},{"type":414,"tag":423,"props":6422,"children":6423},{},[6424],{"type":420,"value":6425},"Once you know the version you can use the git command line in a script task to create the tag and push it.",{"type":414,"tag":434,"props":6427,"children":6431},{"className":6428,"code":6429,"language":6430,"meta":401,"style":401},"language-yml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","- script: |\n    git tag $(VersionPreviouslyComputed)\n    git push origin $(VersionPreviouslyComputed)\n  displayName: Tag version\n  workingDirectory: $(Build.SourcesDirectory)\n","yml",[6432],{"type":414,"tag":440,"props":6433,"children":6434},{"__ignoreMap":401},[6435,6456,6464,6472,6489],{"type":414,"tag":444,"props":6436,"children":6437},{"class":446,"line":447},[6438,6442,6447,6451],{"type":414,"tag":444,"props":6439,"children":6440},{"style":468},[6441],{"type":420,"value":5523},{"type":414,"tag":444,"props":6443,"children":6444},{"style":997},[6445],{"type":420,"value":6446}," script",{"type":414,"tag":444,"props":6448,"children":6449},{"style":468},[6450],{"type":420,"value":1005},{"type":414,"tag":444,"props":6452,"children":6453},{"style":968},[6454],{"type":420,"value":6455}," |\n",{"type":414,"tag":444,"props":6457,"children":6458},{"class":446,"line":499},[6459],{"type":414,"tag":444,"props":6460,"children":6461},{"style":748},[6462],{"type":420,"value":6463},"    git tag $(VersionPreviouslyComputed)\n",{"type":414,"tag":444,"props":6465,"children":6466},{"class":446,"line":509},[6467],{"type":414,"tag":444,"props":6468,"children":6469},{"style":748},[6470],{"type":420,"value":6471},"    git push origin $(VersionPreviouslyComputed)\n",{"type":414,"tag":444,"props":6473,"children":6474},{"class":446,"line":527},[6475,6480,6484],{"type":414,"tag":444,"props":6476,"children":6477},{"style":997},[6478],{"type":420,"value":6479},"  displayName",{"type":414,"tag":444,"props":6481,"children":6482},{"style":468},[6483],{"type":420,"value":1005},{"type":414,"tag":444,"props":6485,"children":6486},{"style":748},[6487],{"type":420,"value":6488}," Tag version\n",{"type":414,"tag":444,"props":6490,"children":6491},{"class":446,"line":536},[6492,6497,6501],{"type":414,"tag":444,"props":6493,"children":6494},{"style":997},[6495],{"type":420,"value":6496},"  workingDirectory",{"type":414,"tag":444,"props":6498,"children":6499},{"style":468},[6500],{"type":420,"value":1005},{"type":414,"tag":444,"props":6502,"children":6503},{"style":748},[6504],{"type":420,"value":6505}," $(Build.SourcesDirectory)\n",{"type":414,"tag":423,"props":6507,"children":6508},{},[6509,6511,6517,6519,6524,6526,6532,6534,6540],{"type":420,"value":6510},"For this script to work, you have to ensure that the identity that executes your pipeline has the right to push a tag on your repository. Concretely you have to give the ",{"type":414,"tag":440,"props":6512,"children":6514},{"className":6513},[],[6515],{"type":420,"value":6516},"contribute",{"type":420,"value":6518}," permission to the ",{"type":414,"tag":932,"props":6520,"children":6521},{},[6522],{"type":420,"value":6523},"user",{"type":420,"value":6525}," named ",{"type":414,"tag":440,"props":6527,"children":6529},{"className":6528},[],[6530],{"type":420,"value":6531},"Project Collection Build Service ({your organization})",{"type":420,"value":6533}," as described ",{"type":414,"tag":889,"props":6535,"children":6538},{"href":6536,"rel":6537},"https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/git-commands?view=azure-devops&tabs=yaml#grant-version-control-permissions-to-the-build-service",[893],[6539],{"type":420,"value":1340},{"type":420,"value":795},{"type":414,"tag":423,"props":6542,"children":6543},{},[6544,6546,6552],{"type":420,"value":6545},"Moreover, you need to add an extra checkout task at the beginning of your pipeline. By default, you don't have to add this task, pipelines automatically do a checkout. But in this case, you want to set to true the parameter ",{"type":414,"tag":440,"props":6547,"children":6549},{"className":6548},[],[6550],{"type":420,"value":6551},"persistsCredentials",{"type":420,"value":6553}," to reuse the same credentials used for the initial checkout in the following other git operations in your pipelines.",{"type":414,"tag":434,"props":6555,"children":6557},{"className":6428,"code":6556,"language":6430,"meta":401,"style":401},"- checkout: self\n  persistCredentials: true\n",[6558],{"type":414,"tag":440,"props":6559,"children":6560},{"__ignoreMap":401},[6561,6582],{"type":414,"tag":444,"props":6562,"children":6563},{"class":446,"line":447},[6564,6568,6573,6577],{"type":414,"tag":444,"props":6565,"children":6566},{"style":468},[6567],{"type":420,"value":5523},{"type":414,"tag":444,"props":6569,"children":6570},{"style":997},[6571],{"type":420,"value":6572}," checkout",{"type":414,"tag":444,"props":6574,"children":6575},{"style":468},[6576],{"type":420,"value":1005},{"type":414,"tag":444,"props":6578,"children":6579},{"style":748},[6580],{"type":420,"value":6581}," self\n",{"type":414,"tag":444,"props":6583,"children":6584},{"class":446,"line":499},[6585,6590,6594],{"type":414,"tag":444,"props":6586,"children":6587},{"style":997},[6588],{"type":420,"value":6589},"  persistCredentials",{"type":414,"tag":444,"props":6591,"children":6592},{"style":468},[6593],{"type":420,"value":1005},{"type":414,"tag":444,"props":6595,"children":6596},{"style":1625},[6597],{"type":420,"value":6598}," true\n",{"type":414,"tag":423,"props":6600,"children":6601},{},[6602,6604,6610],{"type":420,"value":6603},"If you are not using a Microsoft-hosted agent but your own on-premise agent, you can have a problem when you delete a tag that was created by a pipeline. Indeed tags in the local repository of an on-premise agent are not automatically fetched and pruned so your following build can fail if it tries to create a tag that still exists locally (even if does not on the remote repository). To avoid that you can do add following command in your script ",{"type":414,"tag":440,"props":6605,"children":6607},{"className":6606},[],[6608],{"type":420,"value":6609},"git fetch origin refs/tags/*:refs/tags/* --prune",{"type":420,"value":795},{"type":414,"tag":415,"props":6612,"children":6614},{"id":6613},"application-version-in-logs-in-application-insights",[6615],{"type":420,"value":6616},"Application version in logs in Application Insights",{"type":414,"tag":423,"props":6618,"children":6619},{},[6620,6622,6628],{"type":420,"value":6621},"When developing applications in Azure, Application Insights is a key component to monitor these applications. But as for many components, we sometimes do not know how to use it to its full potential.\nThis week a colleague told me about a very basic feature that I did not know about: logs in Application Insights contain the version of the application that sends the logs. Indeed there is a property ",{"type":414,"tag":440,"props":6623,"children":6625},{"className":6624},[],[6626],{"type":420,"value":6627},"application_Version",{"type":420,"value":6629}," in each log with the version number of the application.",{"type":414,"tag":423,"props":6631,"children":6632},{},[6633],{"type":414,"tag":903,"props":6634,"children":6638},{"alt":6635,"className":6636,"src":6637},"Application Insights logs.",[907,908],"/posts/images/w122021tips_ai_1.png",[],{"type":414,"tag":423,"props":6640,"children":6641},{},[6642],{"type":420,"value":6643},"It might look not very interesting but it can be really useful to have that in order to filter logs to a specific version in Log Analytics queries.",{"type":414,"tag":423,"props":6645,"children":6646},{},[6647,6649,6655,6657,6662,6664,6669],{"type":420,"value":6648},"One thing to note though is that by default Application Insights sets the ",{"type":414,"tag":440,"props":6650,"children":6652},{"className":6651},[],[6653],{"type":420,"value":6654},"AssemblyVersion",{"type":420,"value":6656}," in the ",{"type":414,"tag":440,"props":6658,"children":6660},{"className":6659},[],[6661],{"type":420,"value":6627},{"type":420,"value":6663}," property. So if you keep that by default, do not forget to set the ",{"type":414,"tag":440,"props":6665,"children":6667},{"className":6666},[],[6668],{"type":420,"value":6654},{"type":420,"value":6670}," with the correct version number when you build the application code. In Azure Pipelines it can be done like that:",{"type":414,"tag":434,"props":6672,"children":6674},{"className":6428,"code":6673,"language":6430,"meta":401,"style":401},"- task: DotNetCoreCLI@2\n  displayName: Build\n  inputs:\n    command: build\n    arguments: -p:AssemblyVersion=$(VersionPreviouslyComputed)\n",[6675],{"type":414,"tag":440,"props":6676,"children":6677},{"__ignoreMap":401},[6678,6699,6715,6728,6745],{"type":414,"tag":444,"props":6679,"children":6680},{"class":446,"line":447},[6681,6685,6690,6694],{"type":414,"tag":444,"props":6682,"children":6683},{"style":468},[6684],{"type":420,"value":5523},{"type":414,"tag":444,"props":6686,"children":6687},{"style":997},[6688],{"type":420,"value":6689}," task",{"type":414,"tag":444,"props":6691,"children":6692},{"style":468},[6693],{"type":420,"value":1005},{"type":414,"tag":444,"props":6695,"children":6696},{"style":748},[6697],{"type":420,"value":6698}," DotNetCoreCLI@2\n",{"type":414,"tag":444,"props":6700,"children":6701},{"class":446,"line":499},[6702,6706,6710],{"type":414,"tag":444,"props":6703,"children":6704},{"style":997},[6705],{"type":420,"value":6479},{"type":414,"tag":444,"props":6707,"children":6708},{"style":468},[6709],{"type":420,"value":1005},{"type":414,"tag":444,"props":6711,"children":6712},{"style":748},[6713],{"type":420,"value":6714}," Build\n",{"type":414,"tag":444,"props":6716,"children":6717},{"class":446,"line":509},[6718,6723],{"type":414,"tag":444,"props":6719,"children":6720},{"style":997},[6721],{"type":420,"value":6722},"  inputs",{"type":414,"tag":444,"props":6724,"children":6725},{"style":468},[6726],{"type":420,"value":6727},":\n",{"type":414,"tag":444,"props":6729,"children":6730},{"class":446,"line":527},[6731,6736,6740],{"type":414,"tag":444,"props":6732,"children":6733},{"style":997},[6734],{"type":420,"value":6735},"    command",{"type":414,"tag":444,"props":6737,"children":6738},{"style":468},[6739],{"type":420,"value":1005},{"type":414,"tag":444,"props":6741,"children":6742},{"style":748},[6743],{"type":420,"value":6744}," build\n",{"type":414,"tag":444,"props":6746,"children":6747},{"class":446,"line":536},[6748,6753,6757],{"type":414,"tag":444,"props":6749,"children":6750},{"style":997},[6751],{"type":420,"value":6752},"    arguments",{"type":414,"tag":444,"props":6754,"children":6755},{"style":468},[6756],{"type":420,"value":1005},{"type":414,"tag":444,"props":6758,"children":6759},{"style":748},[6760],{"type":420,"value":6761}," -p:AssemblyVersion=$(VersionPreviouslyComputed)\n",{"type":414,"tag":423,"props":6763,"children":6764},{},[6765],{"type":420,"value":1263},{"type":414,"tag":1265,"props":6767,"children":6768},{},[6769],{"type":420,"value":1269},{"title":401,"searchDepth":499,"depth":499,"links":6771},[6772,6773],{"id":6377,"depth":499,"text":6380},{"id":6613,"depth":499,"text":6616},"content:1.posts:14.w12-2021-tips-learned-this-week.md","1.posts/14.w12-2021-tips-learned-this-week.md",{"_path":46,"_dir":399,"_draft":400,"_partial":400,"_locale":401,"title":45,"description":6777,"lead":6778,"date":6779,"image":6780,"badge":6781,"tags":6782,"body":6783,"_type":1275,"_id":6985,"_source":1277,"_file":6986,"_extension":1279},"I often see developers talking on Twitter or Dev.to about things they have learned during the previous day or the previous week. I like the idea so I decided to write my first article about tips I learned during this past week. I am not intending to write an article like this every week but from time to time when I feel I have something interesting to share or that I want to keep track of for myself.","Windows Terminal startup actions, a git config setting for submodules, and a better IntelliSense for azure pipelines vscode extension.","2021-03-07T00:00:00.000Z",{"src":405},{"label":407},[272,241,206,275,278],{"type":411,"children":6784,"toc":6980},[6785,6789,6795,6800,6805,6845,6854,6860,6865,6886,6914,6926,6932,6945,6950,6959,6972,6976],{"type":414,"tag":423,"props":6786,"children":6787},{},[6788],{"type":420,"value":6777},{"type":414,"tag":415,"props":6790,"children":6792},{"id":6791},"start-windows-terminal-with-multiple-panes-thanks-to-startup-actions",[6793],{"type":420,"value":6794},"Start Windows Terminal with multiple panes thanks to startup actions.",{"type":414,"tag":423,"props":6796,"children":6797},{},[6798],{"type":420,"value":6799},"The new Windows Terminal has evolved a lot since its first release in preview in 2019. It now has a lot of nice features and it keeps getting better which is awesome. I was previously using Cmder but Windows Terminal has quickly become my default terminal.",{"type":414,"tag":423,"props":6801,"children":6802},{},[6803],{"type":420,"value":6804},"One of the latest releases of Windows Terminal allows specifying startup actions in your settings which is great if you want your terminal to open multiple panes or tabs with some specific profiles when the terminal starts. You can find below an example where I tell the terminal to open 3 panes vertically on 3 different locations using my PowerShell profile for each one. It is especially interesting when your daily work is about working on different git repositories.",{"type":414,"tag":434,"props":6806,"children":6808},{"className":4382,"code":6807,"language":4384,"meta":401,"style":401},"\"startupActions\": \"new-tab -p PowerShell -d d:/dev/MyApi1; split-pane -p PowerShell -V -d d:/dev/MyApi2; split-pane -p PowerShell -V -d d:/dev/MyAzureFunctions\"\n",[6809],{"type":414,"tag":440,"props":6810,"children":6811},{"__ignoreMap":401},[6812],{"type":414,"tag":444,"props":6813,"children":6814},{"class":446,"line":447},[6815,6819,6824,6828,6832,6836,6841],{"type":414,"tag":444,"props":6816,"children":6817},{"style":468},[6818],{"type":420,"value":745},{"type":414,"tag":444,"props":6820,"children":6821},{"style":748},[6822],{"type":420,"value":6823},"startupActions",{"type":414,"tag":444,"props":6825,"children":6826},{"style":468},[6827],{"type":420,"value":745},{"type":414,"tag":444,"props":6829,"children":6830},{"style":647},[6831],{"type":420,"value":1079},{"type":414,"tag":444,"props":6833,"children":6834},{"style":468},[6835],{"type":420,"value":745},{"type":414,"tag":444,"props":6837,"children":6838},{"style":748},[6839],{"type":420,"value":6840},"new-tab -p PowerShell -d d:/dev/MyApi1; split-pane -p PowerShell -V -d d:/dev/MyApi2; split-pane -p PowerShell -V -d d:/dev/MyAzureFunctions",{"type":414,"tag":444,"props":6842,"children":6843},{"style":468},[6844],{"type":420,"value":1132},{"type":414,"tag":423,"props":6846,"children":6847},{},[6848],{"type":414,"tag":903,"props":6849,"children":6853},{"alt":6850,"className":6851,"src":6852},"A Windows terminal split int 3 PowerShell tabs.",[907,908],"/posts/images/w092021tips_terminal_1.png",[],{"type":414,"tag":415,"props":6855,"children":6857},{"id":6856},"a-git-config-setting-to-make-working-with-submodule-easier",[6858],{"type":420,"value":6859},"A git config setting to make working with submodule easier.",{"type":414,"tag":423,"props":6861,"children":6862},{},[6863],{"type":420,"value":6864},"On the projects I am working on, we are using submodules to share some code between different components. NuGet packages are great to share code between different projects or applications but it is sometimes a bit complicated to handle when you simply want to share a few models and services between an API and an Azure Function for instance. In these situations, it is easier to use submodules for which you don't have to handle versioning (you just reference in your repository a commit or a branch of the submodule you want to use) nor set up source link (you can directly debug the code from the submodules in your project).",{"type":414,"tag":423,"props":6866,"children":6867},{},[6868,6870,6876,6878,6884],{"type":420,"value":6869},"However, one drawback of using submodules is that you have to learn and execute a few additional git commands to manipulate submodules. Typically when you do a ",{"type":414,"tag":440,"props":6871,"children":6873},{"className":6872},[],[6874],{"type":420,"value":6875},"git pull",{"type":420,"value":6877}," in your git repository, you have to do a ",{"type":414,"tag":440,"props":6879,"children":6881},{"className":6880},[],[6882],{"type":420,"value":6883},"git submodule update",{"type":420,"value":6885}," to update the submodules to their respective commit referenced in the \"super\" git repository. That is just one additional command but if you do that often it can quickly become boring 🥱.",{"type":414,"tag":423,"props":6887,"children":6888},{},[6889,6891,6897,6899,6904,6906,6913],{"type":420,"value":6890},"I never really look for a way to make that easier until this week where I discovered that you could pass the ",{"type":414,"tag":440,"props":6892,"children":6894},{"className":6893},[],[6895],{"type":420,"value":6896},"--recurse-submodules",{"type":420,"value":6898}," flag to a ",{"type":414,"tag":440,"props":6900,"children":6902},{"className":6901},[],[6903],{"type":420,"value":6875},{"type":420,"value":6905}," command to automate the process. It works for other commands as well as solving other similar inconveniences. And the best is that it is available as a setting to put in your git configuration. For more information have a look at ",{"type":414,"tag":889,"props":6907,"children":6910},{"href":6908,"rel":6909},"https://git-scm.com/book/en/v2/Git-Tools-Submodules",[893],[6911],{"type":420,"value":6912},"git documentation on the topic",{"type":420,"value":795},{"type":414,"tag":423,"props":6915,"children":6916},{},[6917,6919,6925],{"type":420,"value":6918},"So just execute the following command and be more productive with submodules 🐱‍🏍:\n",{"type":414,"tag":440,"props":6920,"children":6922},{"className":6921},[],[6923],{"type":420,"value":6924},"git config submodule.recurse true",{"type":420,"value":795},{"type":414,"tag":415,"props":6927,"children":6929},{"id":6928},"intellisense-for-azure-pipelines-custom-tasks-in-vscode",[6930],{"type":420,"value":6931},"IntelliSense for Azure Pipelines custom tasks in vscode.",{"type":414,"tag":423,"props":6933,"children":6934},{},[6935,6937,6943],{"type":420,"value":6936},"Azure Pipelines is an awesome CI/CD tool to automate your builds and deployments. The only problem when writing pipelines is that you have to write YAML  😿. I guess we just have to get used to writing YAML because it has become something used everywhere. Fortunately, there is a ",{"type":414,"tag":889,"props":6938,"children":6941},{"href":6939,"rel":6940},"https://marketplace.visualstudio.com/items?itemName=ms-azure-devops.azure-pipelines",[893],[6942],{"type":420,"value":5666},{"type":420,"value":6944}," that helps writing Azure Pipelines files by providing syntax highlighting and autocompletion for Azure Pipelines YAML files in vscode.",{"type":414,"tag":423,"props":6946,"children":6947},{},[6948],{"type":420,"value":6949},"The extension validates the YAML files by using a generic YAML schema containing the in-box tasks of Azure Pipelines yet that means it is not able to validate tasks that come from extensions you installed in Azure DevOps. But here comes the good news: you can provide your custom schema to the extension so that the extension knows how to validate all the Azure Pipelines tasks available in your Azure DevOps organization. That is not really a tip because it is a well-documented feature of the extension, I just did not take the time to read the documentation to find out about it 😅.",{"type":414,"tag":423,"props":6951,"children":6952},{},[6953],{"type":414,"tag":903,"props":6954,"children":6958},{"alt":6955,"className":6956,"src":6957},"Documentation of the Azure Pipelines vscode extension about YAML schema.",[907,908],"/posts/images/w092021tips_vscodeextension_1.png",[],{"type":414,"tag":423,"props":6960,"children":6961},{},[6962,6964,6970],{"type":420,"value":6963},"As you can see in the documentation, you just have to download the custom schema of your DevOps organization which is located at this URL ",{"type":414,"tag":440,"props":6965,"children":6967},{"className":6966},[],[6968],{"type":420,"value":6969},"https://dev.azure.com/YOU-ORG-HERE/_apis/distributedtask/yamlschema",{"type":420,"value":6971},", reference it in you vs code workspace settings to make it work and enjoy IntelliSense on custom tasks.",{"type":414,"tag":423,"props":6973,"children":6974},{},[6975],{"type":420,"value":1263},{"type":414,"tag":1265,"props":6977,"children":6978},{},[6979],{"type":420,"value":1269},{"title":401,"searchDepth":499,"depth":499,"links":6981},[6982,6983,6984],{"id":6791,"depth":499,"text":6794},{"id":6856,"depth":499,"text":6859},{"id":6928,"depth":499,"text":6931},"content:1.posts:13.w09-2021-tips-learned-this-week.md","1.posts/13.w09-2021-tips-learned-this-week.md",1716749600582]