Skip to content

Instantly share code, notes, and snippets.

View fabriciosanchez's full-sized avatar

Fabrício Sanchez fabriciosanchez

View GitHub Profile
@fabriciosanchez
fabriciosanchez / az-aci-deploy.azcli
Created January 30, 2022 18:38
Deploys a new ACI with docker image from ACR
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 January 30, 2022 18:27
Creates a new vault, creates a new service principal and attributes proper permissions to it.
# 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) \
@fabriciosanchez
fabriciosanchez / gist:5515a4b251216abb580952f1872b4750
Created January 30, 2022 17:53
Builds out a new docker image in ACR
# 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 January 30, 2022 17:40
Creates a new ACR with admin account enabled
# 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 January 30, 2022 17:29
Define global variables, logs the user into Azure and creates a new resource group
# 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
{
"Inputs": {
"WebServiceInput0": [
{
"AGE": 59,
"SEX": 2,
"BMI": 32.1,
"BP": 101,
"S1": 157,
"S2": 93.2,
{
"jsonSchemaSemanticVersion": "1.0.0",
"imports": [],
"manifestName": "clickstream",
"explanation": "CDM standard entities",
"entities": [
{
"type": "LocalEntity",
"entityName": "Comments",
"entityPath": "Comments.cdm.json/Comments"
{
"$schema": "../schema.cdm.json",
"jsonSchemaSemanticVersion": "1.0.0",
"imports": [
{
"corpusPath": "/foundations.cdm.json"
},
{
"corpusPath": "/meanings.cdm.json"
}
@fabriciosanchez
fabriciosanchez / ag-update.ps1
Created April 11, 2020 22:22
Updates the application gateway.
$appgw = Set-AzApplicationGateway `
-ApplicationGateway $appgw
@fabriciosanchez
fabriciosanchez / ag-request-routing.ps1
Created April 11, 2020 22:20
Creates the request routing piece.
$appgw = Add-AzApplicationGatewayRequestRoutingRule `
-ApplicationGateway $appgw `
-Name "apim-api-external-rule" `
-RuleType PathBasedRouting `
-HttpListener $listener `
-BackendAddressPool $Pool `
-BackendHttpSettings $poolSettings `
-UrlPathMap $pathMap