I've created an environment variable and added it to a canvas app and later decided to remove the data connection and hence deleted the EV from the environment. Then when I tried to publish my canvas app, it gave me an error citing the dependency to that deleted environment variable even though I've removed it from the app as well.
"The request failed with error: '{"error":{"code":"0x8004f036","message":"The dependent component EnvironmentVariableDefinition (Id=new_PAR_SPList_SectionOwners) does not exist. Failure trying to associate it with CanvasApp (Id=105f8844-cc0b-4d39-b0ce-c2d9724c08eb) as a dependency. Missing dependency lookup type = EntityNameLookup."}}'."
The highlighted text in bold above is the name of the environment variable that has been deleted from the environment and it did not just get removed from the solution. The order in which the removal took place is as follows:
Please shed some light on how this issue could be resolved as there is limited guidance on the web.
The request failed with error: '{"error":{"code":"0x8004f036","message":"The dependent component Entity (Id=c00_title) does not exist. Failure trying to associate it with CanvasApp (Id=de6bd968-e985-4a2b-93cd-e9d6b111d5d3) as a dependency. Missing dependency lookup type = EntityNameLookup."}}'. The correlation Id is '18aa5023-14dd-495c-bdc4-9767aafa5e67'.
Session ID: 9e15e380-8f7c-44f2-b330-27a46258490a
I have had this issue, and resolved it by deleting the connections and recreating them. My Canvas app is set to automatically create environment variables. so when I recreated the connections it fixed the issues with missing variables.
@Shujaath_Khan - Thank you for the references.
I've used the solution approach from the beginning and cleared the cache multiple times. The deleted environment variable reference is present in the unmanaged layer of the canvas app under "cdsdependencies" and "connectionreferences" properties. I've tried exporting the solution and editing the customizations.xml to remove the references and zipped the package and imported it again. This approach worked for me and I was able to finally publish the app after importing the new version.
Hi @yvsuhas
Similar thread on deleting on environment variables here :
https://powerusers.microsoft.com/t5/Building-Power-Apps/Removing-Environment-Variables/td-p/1211048
Suspect some traces of variable may be present, recommend to have your PowerApp as part of solution.
try clearing cache in browser
Hope it helps.
Thanks