Azure Pipelines and Azure Functions won't be running on the same host, so there is no way for the environment variables to be injected between systems. You will have to use Azure KeyVault or something similar to achieve security of your secrets.
Azure KeyVault is an ideal choice when running on Azure and for Azure Functions, you could leverage Azure Key Vault References which allow seamless integration without changing your code. The secrets are stored in KeyVault but are fetched by the hosting environment securely using Managed Identity. Your code would try to fetch values from the environment as usual.