Azure / container-apps-deploy-action

GitHub Action for building and deploying Azure Container Apps
MIT License
51 stars 30 forks source link

Location : Canada Central #17

Closed vikingua closed 1 year ago

vikingua commented 1 year ago

When I use container-apps-deploy-action I have Location : Canada Central for container-app, Log Analytics workspace and Container Apps Environment Can it be set somehow ?

vikingua commented 1 year ago

I read that Container Apps still not in production and available only in few locations, and Canada Central one of But I can create manually in West US without any issues

CodyCline commented 1 year ago

@vikingua I ran into the same problem just a few days ago! I'm not sure if location parameters are supported in this workflow. Consider using the azure cli instead and invoking the command az containerapp up like this:

steps:
  - name: Deploy Azure Container app
  - run: |
    az containerapp up \
      --environment "qualified-or-existing-env-name-here" \
      --name my-app \
      --resource-group ${{ secrets.RESOURCE_GROUP }} 
      --image index.docker.io/myusername/image:latest \
      --location "West US"

Reference: azure cli docs

Also, here are other qualified locations you can use for deployment which were obtained with this command (output may vary):

Input: az provider show -n Microsoft.App --query "resourceTypes[?resourceType=='managedEnvironments'].locations"

Output:

[
  [
    "Canada Central",
    "West Europe",
    "North Europe",
    ....
  ]
]

Hope this helps!

cormacpayne commented 1 year ago

@vikingua @CodyCline Hey folks, thanks for the comments and discussion; currently, this GitHub Action doesn't support setting the location of the Container App, but that's something I'll work on adding as an argument soon.

In the meanwhile, here's a comment from a developer on the az containerapp module (that this action uses) regarding the location determined for the Container App:

When creating a new ACA environment with up, the CLI tries to intelligently pick a suitable location (if the user didn't provide a location with --location) by doing the following:

  1. Get a list of locations the user's subscription can create environments in by calling the providers API
  2. For each location, attempt to create an environment in that location
  3. Continue when an environment was successfully created or error out if all locations were exhausted

As @CodyCline pointed out above, the list of providers listed for Container Apps may begin with "Canada Central", which would be the first location that would be tried as a suitable location for the environment and application.

Thanks for bringing this up -- I'll check into adding a location argument to override this default.

cormacpayne commented 1 year ago

@vikingua Hey there, this issue should be resolved in the latest release of the AzureContainerAppsRC task (0.1.8) -- I also updated our documentation to call out the code snippet that @CodyCline provided to get the valid locations that Container Apps can be deployed to within the current subscription.

Please feel free to let us know if there's anything else we can help with!

CodyCline commented 1 year ago

Thanks @cormacpayne !!!