icokpy/ok

Create method to do initial create of DB tables and stoage container

Closed this issue · 2 comments

Maybe docker container to run on ACI.

c-w commented

Here's an AZ CLI command that can be integrated into an ARM template that uses ACI to create the container:

az container create --resource-group changeme --name okpycreatecontainer --image microsoft/azure-cli:2.0.31 --command-line 'sh -c "az storage container create --account-name=$STORAGE_KEY --account-key=$STORAGE_SECRET --name=$STORAGE_CONTAINER"' --environment-variables STORAGE_CONTAINER=changeme STORAGE_KEY=changeme STORAGE_SECRET=changeme

c-w commented

And here's an ARM template fragment as per https://docs.microsoft.com/en-gb/azure/templates/microsoft.containerinstance/containergroups:

{
  "name": "okpycreateazureresources",
  "type": "Microsoft.ContainerInstance/containerGroups",
  "apiVersion": "2018-04-01",
  "location": "changeme",
  "tags": {},
  "properties": {
    "containers": [
      {
        "name": "okpycreateazurecontainer",
        "properties": {
          "image": "microsoft/azure-cli:2.0.31",
          "command": [
            "sh -c \"az storage container create --account-name=$STORAGE_KEY --account-key=$STORAGE_SECRET --name=$STORAGE_CONTAINER\""
          ],
          "environmentVariables": [
            {
              "name": "STORAGE_CONTAINER",
              "value": "changeme"
            },
            {
              "name": "STORAGE_KEY",
              "value": "changeme"
            },
            {
              "name": "STORAGE_SECRET",
              "value": "changeme"
            }
          ]
        }
      }
    ]
  }
}