Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_linux_function_app with docker does not produce expected results #16483

Closed
1 task done
elliotchaim opened this issue Apr 21, 2022 · 2 comments · Fixed by #18194
Closed
1 task done

azurerm_linux_function_app with docker does not produce expected results #16483

elliotchaim opened this issue Apr 21, 2022 · 2 comments · Fixed by #18194

Comments

@elliotchaim
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.1.7

AzureRM Provider Version

~>1.1.7

Affected Resource(s)/Data Source(s)

azurerm_linux_function_app

Terraform Configuration Files

resource "azurerm_linux_function_app" "example" {
  name                = "example"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  service_plan_id             = data.azurerm_service_plan.example.id
  storage_account_name        = azurerm_storage_account.example.name
  functions_extension_version = "~4"

  site_config {
    always_on = true
    ftps_state = "Disabled"

    application_stack {
      docker {
        registry_url      = "https://registry.hub.docker.com"
        image_name        = "username/imagename"
        image_tag         = "latest"
        registry_username = "username"
        registry_password = var.dockerhub_password
      }
    }
  }

  app_settings = {
    WEBSITE_WEBDEPLOY_USE_SCM           = true
    ASPNETCORE_ENVIRONMENT              = "Production"
    FUNCTIONS_WORKER_RUNTIME            = "dotnet-isolated"
    WEBSITES_ENABLE_APP_SERVICE_STORAGE = false
  }
}


### Debug Output/Panic Output

```shell
2022-04-21T05:56:19.959Z ERROR - Pull image threw Exception: Input string was not in a correct format.
2022-04-21T05:56:19.959Z INFO - Pulling image from Docker hub: https://registry.hub.docker.com/username/imagename:latest
2022-04-21T05:56:19.960Z ERROR - DockerApiException: Docker API responded with status code=BadRequest, response={"message":"invalid reference format"}

2022-04-21T05:56:19.961Z WARN - Image pull failed. Defaulting to local copy if present.
2022-04-21T05:56:19.963Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
2022-04-21T05:56:19.967Z INFO - Stopping site example because it failed during startup.
2022-04-21T05:58:46.398Z INFO - Pulling image: https://registry.hub.docker.com/username/imagename:latest
2022-04-21T05:58:46.400Z ERROR - DockerApiException: Docker API responded with status code=BadRequest, response={"message":"invalid reference format"}


### Expected Behaviour

1. The **Full Image Name and Tag** setting has a value of `username/imagename:latest`
2. The app service successfully pulls the docker image

### Actual Behaviour

1. The **Full Image Name and Tag** setting has a value of `https://username/imagename`
2. The app service is unable to pull the docker image

### Steps to Reproduce

1. `terraform apply`
2. Find the functions app in the Azure Portal
3. Click on **Deployment Center**
    a. Inspect the value of the **Full Image Name and Tag** setting
4. Click on **Logs** to view the app service output

### Important Factoids

_No response_

### References

NB: `azurerm_linux_web_app` resources configured with docker work as expected.
@github-actions github-actions bot removed the bug label Apr 21, 2022
@elliotchaim
Copy link
Author

Removing the https:// prefix from the registry_url fixed this issue, which is confusing for two reasons

  1. It contradicts Microsoft's documentation
  2. It is inconsistent with configuration of azurerm_linux_web_app resources

@github-actions
Copy link

github-actions bot commented Mar 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants