RESOURCE_GROUP=cg-rsakeys-test RESOURCE_GROUP_LOCATION=westus KEY_VAULT_NAME=cg-rsakeys-test-kv
az group create -l $RESOURCE_GROUP_LOCATION -n $RESOURCE_GROUP
az group list -o table
# Alternative to filter down in a large subscription
az group list --query "[?starts_with(name,'cg')]" -o table
# Or to directly check on this one
az group list --query "[?name=='$RESOURCE_GROUP']" -o table
az sshkey create --name "mySSHKey" --resource-group "$RESOURCE_GROUP"
Snowflake Ready Private Key (per docs) See openssl docs for more info
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
Snowflake docs on public key Again, see openssl docs
openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
Note that ssh-keygen is also on the bash shell in Azure Cloud Shell. If using the online shell, consider creating keys in the clouddrive. Not sure what security considerations are per terminal instance.
az keyvault create --location $RESOURCE_GROUP_LOCATION --name $KEY_VAULT_NAME --resource-group "$RESOURCE_GROUP"
az keyvault secret set --vault-name $KEY_VAULT_NAME --name "PublicKey" --file rsa_key.pub
az keyvault secret set --vault-name $KEY_VAULT_NAME --name "PrivateKey" --file rsa_key.p8