Skip to content

Instantly share code, notes, and snippets.

View haray-isao's full-sized avatar

HARA Yuichiro haray-isao

  • Colorkrew Inc.
  • Tokyo, Japan
View GitHub Profile
# 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 \
# 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> \
# 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 \
{
"$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."
}
},
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: azure-vote-back
spec:
replicas: 1
template:
metadata:
labels:
app: azure-vote-back

Azure CLI Examples

Select your subscription

List subscriptions your have access to.

az account list
az account list –-output table
az account list –o table
## 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
{
"$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"
}
},

Azure Database for PostgreSQL で様々なCollationでソートを試してみる

Japanese_Japan.932 C en-US English_United States.1252
う゛
う゛ う゛ う゛
workflow Stop-Start-AzureVM2
{
Param
(
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]
[String]
$credentialName,
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]
[String]
$ResourceGroup,