Adding to cooldadtx suggestions.
Since you have posted the question on azure-webapps tag, I presume you're leveraging Azure App Service WebApps.
Just to highlight, Azure offers several ways to host websites: Azure App Service WebApps (PAAS solution), Virtual Machines (IAAS), Service Fabric and Cloud Services, etc. On an Azure Virtual Machine, hosting a website is just similar to what you do on prem.
On App Service, the deployment pretty much does only one thing: it deploys files into the wwwroot folder.manually copy some files over using Kudu Console.
You may access Kudu Console (https://<yourwebpp-name>.scm.azurewebsites.net/) [Debug console>cmd] and review the site root/ d:\home\site\wwwroot\ ]
As cooldadtx mentioned, it's due to the source files compiled into the DLL (lands on bin folder).
Also see this example - All of the .cs files, including .aspx.cs, .aspx.designer.cs, Master.cs, and Master.designer.cs files are omitted. All of this code has been compiled into the ContosoUniversity.dll and ContosoUniversity.pdb files that you'll find in the bin folder. Because only the .dll is needed to run the application, and you specified earlier that only files needed to run the application should be deployed, no .cs files were copied to the destination environment. The obj folder and the ContosoUniversity.csproj and .csproj.user files are omitted for the same reason.
Typically, it's the same framework behavior on Azure as well. On a flip side, if an app doesn't work locally, it mostly never works on Azure as well.
-----------------------------------------------------------------------------------------------------------------------
To benefit the community, find the right answers, please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’.