az account list
az account list –-output table
az account list –o table
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
# Get extension list | |
az vm extension image list --publisher microsoft -o table | grep malware | |
IaaSAntimalware Microsoft.Azure.Security.Test 1.5.2.0 | |
IaaSAntimalware Microsoft.Azure.Security 1.0.0.0 | |
IaaSAntimalware Microsoft.Azure.Security 1.1.0.0 | |
# Install antimalware to Windows VM | |
az vm extension set --name IaaSAntimalware \ | |
--publisher Microsoft.Azure.Security \ | |
--resource-group myResourceGroup \ |
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
# Add a secret to key vault | |
az keyvault secret set --vault-name <myKeyVault> \ | |
--name <mySecretName> \ | |
--value <mySecret> | |
# View the value | |
az keyvault secret show --vault-name <myKeyVault> --name <mySecretName> | |
# Authorize user to use the key or secret | |
az keyvault set-policy --name <myKeyVault> \ | |
--upn <username@domain> \ |
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
# Enable the Azure Key Vault provider | |
az provider register -n Microsoft.KeyVault | |
# Create a resource group | |
az group create --name myResourceGroup --location southeastasia | |
# Create Key Vault | |
keyvault_name=<myuniquekeyvaultname> | |
az keyvault create \ | |
--name $keyvault_name \ | |
--resource-group myResourceGroup \ | |
--location southeastasia \ |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"adminUsername": { | |
"type": "string", | |
"metadata": { | |
"description": "Username for the Virtual Machine." | |
} | |
}, |
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
apiVersion: apps/v1beta1 | |
kind: Deployment | |
metadata: | |
name: azure-vote-back | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: azure-vote-back |
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
## Application Gateway で HTTP --> HTTPS リダイレクト | |
$resourceGroupName = "リソースグループ名" | |
$appGwName = "Application Gateway 名" | |
$appGwFrontendIpName = "appGatewayFrontendIP" | |
$appgw = Get-AzureRmApplicationGateway -ResourceGroupName $resourceGroupName -Name $appGwName | |
# HTTP ポートの追加 | |
Add-AzureRmApplicationGatewayFrontendPort -Name httpPort -Port 80 -ApplicationGateway $appgw |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"applicationGatewayNameParm":{ | |
"type": "string", | |
"metadata": { | |
"description": "Application Gateway name" | |
} | |
}, |
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
workflow Stop-Start-AzureVM2 | |
{ | |
Param | |
( | |
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()] | |
[String] | |
$credentialName, | |
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()] | |
[String] | |
$ResourceGroup, |
NewerOlder