Skip to content

Instantly share code, notes, and snippets.

@kevinhillinger
Last active September 25, 2019 17:46
Show Gist options
  • Save kevinhillinger/b5edab3f75dc9b805a273d47cec678d0 to your computer and use it in GitHub Desktop.
Save kevinhillinger/b5edab3f75dc9b805a273d47cec678d0 to your computer and use it in GitHub Desktop.
Azure Meta Service Broker - Redis Cache Premium - PCF
# created the service broker via command
SECURITY_USER_NAME=<username>
SECURITY_USER_PASSWORD=<the password>
URL=http://meta-azure-service-broker.<public ip value here>.xip.io
cf create-service-broker meta-azure-service-broker $SECURITY_USER_NAME $SECURITY_USER_PASSWORD $URL
# enabled service for redis
cf enable-service-access azure-rediscache
# verify availability
cf marketplace
# deployed premium 1 instance to Azure
cf create-service azure-rediscache premiump1 rediscache88876 -c ./rediscache-config.json
# get name of vnet
az network vnet list
vnet={name of the vnet}
resource_group={name of the resource group}
# get the list of existing subnets
az network vnet subnet list -g $resource_group --vnet-name $vnet
# create the redis cache subnet as a /29 so we can use an available ip
az network vnet subnet create -n RedisCache --vnet-name $vnet -g $resource_group \
--address-prefixes "10.0.15.0/29"
# get the subnet id
subnetid=$(az network vnet subnet show -n RedisCache -g $resource_group --vnet-name $vnet -o tsv --query 'id')
redis_ip='10.0.15.4'
# update the redis cache config with the values
cd azure-redisconfig
cp rediscache-config.json tmp.json
jq --arg subnetid $subnetid '.parameters.subnetId = $subnetid' rediscache-config.json > temp.json
mv tmp.json rediscache-config.json
jq --arg staticIP $redis_ip '.parameters.staticIP = $staticIP' rediscache-config.json > temp.json
mv tmp.json rediscache-config.json
{
"resourceGroup": "cloudfoundryenv",
"location": "eastus",
"cacheName": "rediscache88876",
"parameters": {
"enableNonSslPort": false,
"subnetId": "/subscriptions/{subid}/resourceGroups/cloudfoundryenv/providers/Microsoft.Network/virtualNetworks/boshvnet-crp/subnets/RedisCache",
"staticIP": "10.0.15.4",
"shardCount": 1,
"tags": []
}
}
@kevinhillinger
Copy link
Author

This doesn't take into account the tile using the Ops Manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment