This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func_name=<the name of the function app> | |
# global id for Microsoft Graph | |
graph_name=00000003-0000-0000-c000-000000000000 | |
graph_id=$(az ad sp show --id 00000003-0000-0000-c000-000000000000 --query id -o tsv) | |
managed_identity=$(az ad sp list --display-name $func_name --query '[0]' -o json) | |
mi_object_id=$(echo $managed_identity | jq .id -r) | |
mi_app_id=$(echo $managed_identity | jq .appId -r) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
authsettingsv2_list_url="https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<group_name>/providers/Microsoft.Web/sites/<site_name>/config/authsettingsv2/list?api-version=2020-09-01" | |
authsettingsv2_url="https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<group_name>/providers/Microsoft.Web/sites/<site_name>/config/authsettingsv2?api-version=2020-09-01" | |
az rest --method GET --url $authsettings_list_url > authsettingsv2_list_url.json | |
// modify json | |
az rest --method PUT --url authsettingsv2_url --body @./authsettingsv2.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<policies> | |
<inbound> | |
<check-header name="X-Azure-FDID" failed-check-httpcode="403" failed-check-error-message="" ignore-case="true"> | |
<value>475128ed-cf0a-494d-8178-cc2580e9e5d9</value> | |
</check-header> | |
</inbound> | |
<backend> | |
<forward-request /> | |
</backend> | |
<outbound /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Duration twelveHourTimeout = Duration.ofHours(12); | |
DirectConnectionConfig connectionConfig = new DirectConnectionConfig(); | |
connectionConfig.setIdleConnectionTimeout(twelveHourTimeout); | |
connectionConfig.setIdleEndpointTimeout(twelveHourTimeout); | |
client = new CosmosClientBuilder() | |
.endpoint(AccountSettings.HOST) | |
.key(AccountSettings.MASTER_KEY) | |
.consistencyLevel(ConsistencyLevel.EVENTUAL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<policies> | |
<inbound> | |
<base /> | |
<rate-limit calls="30" renewal-period="10" /> | |
</inbound> | |
<backend> | |
<base /> | |
</backend> | |
<outbound> | |
<base /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Terraform version 0.13 | |
# variables | |
variable "apis" { | |
type = map | |
default = { | |
conferenceApi = { | |
name = "conference-api" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function() { function getText() { var text = $('textarea[data-id*=description]').text(); return text; } function viewDescription() { var alertText = { text: getText(), title: "Description" }; var alertOptions = { height: '90%', width: '90%' }; Xrm.Navigation.openAlertDialog(alertText, alertOptions); setTimeout(() => $('span[id*=dialogMessageTextLine]').css('margin-top', '5px'), 300); } viewDescription(); })(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setting the script to authenticate using the system access token on the Azure DevOps Build Agent | |
# Set the agent job to "Allow scripts to access OAuth token" in the build | |
$pat = "Bearer $env:System_AccessToken" | |
# this will be the correlation value used to collect all the builds | |
$sourceVersion = $env:BUILD_SOURCEVERSION | |
Write-Output ("##vso[task.setvariable variable=sourceVersion;]$sourceVersion") | |
$organizationName = ([System.Uri]$env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI).Host.split('.')[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# variables | |
$location="<selected region>" | |
$name_suffix="<your student id>" | |
$group_name="identitylab" | |
# create the group | |
New-AzureRmResourceGroup -Name $group_name -Location $location | |
$template_uri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/active-directory-new-domain/azuredeploy.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "f54fd36e-57c8-4408-a870-3ef2b3b4b685", | |
"acceptMappedClaims": null, | |
"accessTokenAcceptedVersion": null, | |
"addIns": [], | |
"allowPublicClient": null, | |
"appId": "da66ee7b-d762-4e19-8d7c-66a9974baeab", | |
"appRoles": [ | |
{ | |
"allowedMemberTypes": [ |
NewerOlder