Posts

OSS @Microsoft - Docs

Open source software (OSS) at Microsoft allows everyone to see, comment, and contribute to the products, services, documentation, sample code, and SDKs they use. I work at Microsoft and my opinions are my own. The Microsoft documentation set is not a single GitHub repository. It is many repositories, all with active writers, support engineers, and SLAs. When you see an issue in the docs or you think a concept or technique is unclear, GitHub repositories allow you to: Add an issue, via an Edit button , that is sent directly to the Product group or Content Developer.  Create a pull request (PR), that is sent directly to the Product group or Content Developer.  Is this open source though? Absolutely. You can immediately impact all users of the docs in a positive way. 2 things you can do when logging an issue against the docs: Be specific. Your comment is attached to the entire doc. Be specific where in the doc the issue is and what wording, image, or sample cod...

Fetching a Private Key From An Azure Key Vault Certificate

If you create a private certificate in Azure Key Vault and use the fancy features like auto rotation, you might like to be able to fetch the private key from the vault and rehydrate it as a X509Certificate2 class in your C# code. Here is how you do that: KeyVaultClient keyVaultClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(GetToken)); var certificateBundle = await keyVaultClient.GetCertificateAsync(certificateIdentifier); var certficiateSecret = await keyVaultClient.GetSecretAsync(certificateBundle.SecretIdentifier.Identifier); byte[] certificateDecoded = Convert.FromBase64String(certficiateSecret.Value); var certificate = new X509Certificate2(certificateDecoded, password: ""); The Certificate Bundle passed back from the  GetCertificateAsync call has a .Cer property, however that is just the bytes for the pubic key, if you do this: var publicCertificate = new X509Certificate2( certificateBundle.Cer ); The X509Certificate2 instance will onl...

Regex to search VSCode for Azure subscription keys

Image
Before you check in code, make sure the Azure subscription keys are removed or replaced with obvious markers. In VSCode, select the magnifying glass, the select the last icon on the line, "*." indicating the search is by regular expression. Enter [a-z0-9]{32} in the search text box and select enter. The search results appear below the search text box. Scan the results for any highlighted keys that are real key values.

Changing TLS setting for Azure web apps including Bot Framework

Image
If you need to change the TLS setting for you Azure web apps, including Bot Framework apps, go to the Azure portal. In the left navigation, select All Resources , sort the table by the type column. Any row with the type of app service may need the TLS setting updated based on on the service announcement here . On each service, select the SSL section , and change the Minimum TLS Version .

Community TypeScript conference in Seattle

Seattle is getting its own community-driven TypeScript conference March 12, 2018. Get your tickets now. 

Curl command for Microsoft Cognitive Services product QnA Maker

This is the curl command to send QnA Maker a question and receive the answer: curl -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key:<subscriptionKey>" -X POST -d '{"question":"<question>"}' https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/<appID>/generateAnswer <subscriptionKey> found on https://www.qnamaker.ai/UserSettings <appID> found in url when view app, ?kbid=<appID> <question> question such as "How do I ...?"

Debug mocha.js with VSCode

This is my cheat sheet for debugging the mocha.js project from VSCode while adding fixes to it. This is not about how to debug ANY project that is using mocha for testing. The mocha.js repository has a build system that builds into /bin/mocha. I don't use a package.json script. I just use a launch.json mocha test configuration: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version" : "0.2.0" , "configurations" : [ { "type" : "node" , "request" : "launch" , "name" : "Mocha Tests" , "program" : "${workspaceFolder}/bin/_mocha" , "args" : [ "--colors" , "${workspaceFolder}/test/reporters/dina.spec.js" ], "internalConsoleOptions" : "openOnSessionSta...