Skip to content

Instantly share code, notes, and snippets.

View takekazuomi's full-sized avatar
:octocat:
on code

Takekazu Omi takekazuomi

:octocat:
on code
View GitHub Profile
@takekazuomi
takekazuomi / container.bicep
Created April 14, 2022 12:31
deploy ACA with MSI
param containerAppName string
param location string = resourceGroup().location
param environmentId string
param containerImage string
param containerPort int
param isExternalIngress bool
param secrets array = []
param env array = []
param minReplicas int = 0

memo

az network bastion ssh --name bastionhost --resource-group omivm04-rg \
  --target-resource-id /subscriptions/*****************/resourceGroups/omivm04-rg/providers/Microsoft.Compute/virtualMachines/flatcar \
  --auth-type ssh-key --username core --ssh-key ./.secure/vm-keys
-zsh

Container Apps のシークレット管理

いま結構中途半端って話

コンテナにsecretsがあって、それを別の場所から参照(ref)できる。 これはこれで良いんだけど、シークレットをKVに置くというAzureの基本ができない。 Issue見てると、案がいくつか出てる

  1. App Service のKV Refみたいのを書けるようにする
  2. Dapr のsecure storageを使えるようにする
@takekazuomi
takekazuomi / container-apps2.md
Created November 9, 2021 23:14
Container Apps のAPI Specの進行状況
title
Container AppsのAPI

bicepのtypelibに入ってない件、alex に、「api specのPRがマージされたれたら、行けるようになる。ETA は12/1」と返事をもらった。

Azure/bicep#784 (comment)

PR

@takekazuomi
takekazuomi / devcontainer.json
Created November 4, 2021 05:23
container-app-demo devcontainer.json
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.0/containers/dapr-dotnet
{
"name": "container-app-demo",
"dockerFile": "Dockerfile",
"build": {
"args": {
"VARIANT":"5.0",
"INSTALL_AZURE_CLI": "true"
}
{
"name": "azuremonitor/containerinsights/ciprod",
"tags": [
"20190419-014130z-cfg",
"20190424-001611z-cfk",
"20190424-005611z-cfn",
"20190425-231018z-cfp",
"20190426-224542z-cfs",
"20190427-094716z-cfv",
"20190427-123144z-cfy",

vnet にagwをdeployすると、what-ifに引っかかる

az deployment group what-if -g kinmugi-bicep01 -n deploy-18084242 \
        -f vnet.test.json  2>&1
Note: The result may contain false positive predictions (noise).
You can help us improve the accuracy of the result by opening an issue here: https://aka.ms/WhatIfIssues.

Resource and property changes are indicated with these symbols:
 - Delete
@takekazuomi
takekazuomi / invite.sh
Created January 7, 2021 09:48
Azure Static WebApps createUserInvitation script
#!/bin/bash
SUBSCRIPTION_ID=xxxxxxx
RESOURCE_GROUP_NAME=xxxxxxx
STATIC_SITE_NAME=xxxxxxx
DOMAIN=xxxxxxx.azurestaticapps.net
USER_DETAILS=xxxxxxx
cat << EOJ > properties.json
{
param vnet object
param vmName string = 'linux-vm'
param vmSize string = 'Standard_B1s'
param adminUsername string = 'takekazu.omi'
param adminPassword string {
secure: true
}
param subnetName string = 'subnet1'
param customData string = ''
param location string = resourceGroup().location
#!/usr/bin/env bash
###
# Add User with SSH KeyAuth
#
# set -x
set -ue -o pipefail
export LC_ALL=C