I'm trying to create a new container in an existing container instance (I assume you can have several containers in a container instance), but I get this error message:
(InvalidResourceLocation) The resource 'test-app' already exists in location 'australiasoutheast' in resource group 'algo_trading'. A resource with the same name cannot be created in location 'australiaeast'. Please select a new resource name.
Code: InvalidResourceLocation
Message: The resource 'test-app' already exists in location 'australiasoutheast' in resource group 'algo_trading'. A resource with the same name cannot be created in location 'australiaeast'. Please select a new resource name.
The image test-image
exists in ACR, the existing container instance is called test-app.
This is the yaml file and I try to create the container using the command:
az container create --resource-group <resource_group> --file docker_compose_test_app.yaml
name: test-app # Name of the existing container group
apiVersion: '2021-10-01'
location: australiaeast
properties:
containers:
- name: test-cont # name of the new container
properties:
image: test_image # container image in acr used to create the instance
resources:
requests:
cpu: 1
memoryInGb: 1.5
ports:
- port: 5000
osType: Linux
ipAddress:
type: Public
ports:
- protocol: tcp
port: 5000
tags: {exampleTag: tutorial}