Skip to content

Instantly share code, notes, and snippets.

Avatar

Fabrício Sanchez fabriciosanchez

View GitHub Profile
@fabriciosanchez
fabriciosanchez / az-aci-deploy.azcli
Created Jan 30, 2022
Deploys a new ACI with docker image from ACR
View az-aci-deploy.azcli
az container create \
-g $RG \
-n your-aci-name \
--image $ACR_NAME.azurecr.io/your-image-name-in-acr:version \
--registry-login-server $ACR_NAME.azurecr.io \
--registry-username $(az keyvault secret show --vault-name $AKV_NAME --name $ACR_NAME-pull-usr --query value -o tsv) \
--registry-password $(az keyvault secret show --vault-name $AKV_NAME --name $ACR_NAME-pull-pwd --query value -o tsv) \
--dns-name-label your-aci-fqdn \
--query "{FQDN:ipAddress.fqdn}" \
--output table
@fabriciosanchez
fabriciosanchez / az-akv-sp.azcli
Created Jan 30, 2022
Creates a new vault, creates a new service principal and attributes proper permissions to it.
View az-akv-sp.azcli
# CREATING A NEW KEY VAULT
az keyvault create -g $RG --name $AKV_NAME
# CREATING A SERVICE PRINCIPAL AND STORING IT (USER AND PASSWORD) INTO AKV
az keyvault secret set \
--vault-name $AKV_NAME \
--name $ACR_NAME-pull-pwd \
--value $(az ad sp create-for-rbac \
--name $ACR_NAME-pull \
--scopes $(az acr show --name $ACR_NAME --query id --output tsv) \
View gist:5515a4b251216abb580952f1872b4750
# BUILDS A NEW IMAGE BY LEVERAGING ACR TASKS
az acr build --registry $ACR_NAME --image your-image-name-in-acr:version .
@fabriciosanchez
fabriciosanchez / az-acr-create.azcli
Created Jan 30, 2022
Creates a new ACR with admin account enabled
View az-acr-create.azcli
# IF THERE IS NO ACR ALREADY CREATED, EXECUTE THIS STEP.
# IF YOU ALREADY HAVE AN ACR YOU'D LIKE TO USE, SKIP THIS STEP.
az acr create -n $ACR_NAME -g $RG --sku Standard --admin-enabled true
@fabriciosanchez
fabriciosanchez / az-login-resource-group-creation.azcli
Created Jan 30, 2022
Define global variables, logs the user into Azure and creates a new resource group
View az-login-resource-group-creation.azcli
# GLOBAL VARIABLES
ACR_NAME=your acr name
RG=your resource group
RG_ACI=your additional resource group
LOCATION=your location
AKV_NAME=your key vault name
# GETS USER LOGGED IN AZURE TENANT
az login
View payload-diabetes.json
{
"Inputs": {
"WebServiceInput0": [
{
"AGE": 59,
"SEX": 2,
"BMI": 32.1,
"BP": 101,
"S1": 157,
"S2": 93.2,
View clickstream.manifest.cdm.json
{
"jsonSchemaSemanticVersion": "1.0.0",
"imports": [],
"manifestName": "clickstream",
"explanation": "CDM standard entities",
"entities": [
{
"type": "LocalEntity",
"entityName": "Comments",
"entityPath": "Comments.cdm.json/Comments"
View Comments.cdm.json
{
"$schema": "../schema.cdm.json",
"jsonSchemaSemanticVersion": "1.0.0",
"imports": [
{
"corpusPath": "/foundations.cdm.json"
},
{
"corpusPath": "/meanings.cdm.json"
}
@fabriciosanchez
fabriciosanchez / ag-update.ps1
Created Apr 11, 2020
Updates the application gateway.
View ag-update.ps1
$appgw = Set-AzApplicationGateway `
-ApplicationGateway $appgw
@fabriciosanchez
fabriciosanchez / ag-request-routing.ps1
Created Apr 11, 2020
Creates the request routing piece.
View ag-request-routing.ps1
$appgw = Add-AzApplicationGatewayRequestRoutingRule `
-ApplicationGateway $appgw `
-Name "apim-api-external-rule" `
-RuleType PathBasedRouting `
-HttpListener $listener `
-BackendAddressPool $Pool `
-BackendHttpSettings $poolSettings `
-UrlPathMap $pathMap