I hereby claim:
- I am nbellocam on github.
- I am nbellocam (https://keybase.io/nbellocam) on keybase.
- I have a public key whose fingerprint is EB79 EFAA 5DA5 88F2 22E9 B8C0 DCC7 25C1 D211 D902
To claim this, I am signing this object:
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| xcode-select --install | |
| echo >> ~/.zprofile | |
| echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| brew update | |
| export PATH="/opt/homebrew/bin:$PATH" |
| module.exports = function (context, req) { | |
| context.log('JavaScript HTTP trigger function processed a request.'); | |
| if (req.query.email && req.query.name) { | |
| const userEmail = req.query.email; | |
| const userDisplayName = req.query.name; | |
| getToken().then(token => { | |
| /* INVITE A USER TO YOUR TENANT */ | |
| var options = { |
| // ... | |
| module.exports = function (context, req) { | |
| context.log('Starting function'); | |
| if (req.query.name) { | |
| const name = req.query.name; | |
| context.log('Parameters OK. Next: get token'); | |
| getToken().then(token => { | |
| context.log('Token OK. Next: create the group'); | |
| createGroup(token, name) |
| const name = 'MyGroup'; | |
| getToken().then(token => { | |
| console.log('Token OK. Next: create the group'); | |
| createGroup(token, name) | |
| .then(result => { | |
| console.log('Everything OK.'); | |
| console.log(result); | |
| }).catch(() => { | |
| console.log('An error occurred while creating the group'); |
| var adal = require('adal-node'); | |
| const TENANT = "{tenant-name-here}.onmicrosoft.com"; | |
| const CLIENT_ID = "{Application-id-here}"; | |
| const CLIENT_SECRET = "{Application-key-here}"; | |
| function getToken() { | |
| return new Promise((resolve, reject) => { | |
| const authContext = new adal.AuthenticationContext(`https://login.microsoftonline.com/${TENANT}`); | |
| authContext.acquireTokenWithClientCredentials(GRAPH_URL, CLIENT_ID, CLIENT_SECRET, (err, tokenRes) => { |
| var request = require('request'); | |
| function createGroup(token, name) { | |
| return new Promise((resolve, reject) => { | |
| const options = { | |
| method: 'POST', | |
| url: 'https://graph.microsoft.com/v1.0/groups/', | |
| headers: { | |
| 'Authorization': 'Bearer ' + token, | |
| 'content-type': 'application/json' |
| const msRestAzure = require('ms-rest-azure'); | |
| const ContainerInstanceManagementClient = require("azure-arm-containerinstance"); | |
| const AzureServiceClient = msRestAzure.AzureServiceClient; | |
| const clientId = process.env['CLIENT_ID']; | |
| const secret = process.env['APPLICATION_SECRET']; | |
| const domain = process.env['DOMAIN']; //also known as tenantId | |
| const subscriptionId = process.env['AZURE_SUBSCRIPTION_ID']; | |
| const resourceGroup = 'YourResourceGroupName'; |
I hereby claim:
To claim this, I am signing this object:
| services.AddMvc().AddJsonOptions(options => | |
| { | |
| options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); | |
| options.SerializerSettings.DefaultValueHandling = DefaultValueHandling.Include; | |
| options.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; | |
| }); |