Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Website - Web.config transform fails "No element in the source document matches /configuration/system.identityModel/identityConfiguration"

Our ASP.NET Web Api project has two deployment configurations (.pubxml):

  1. Web deployment directly to Azure Websites.
  2. Package deployment to a local Zip file.

The Web deployment (1) works just fine. The Package deployment to a zip is failing with the following errors:

Warning 3   No element in the source document matches '/configuration/system.identityModel'     20  10  MyWebProject
Error   4   No element in the source document matches '/configuration/system.identityModel/identityConfiguration'       21  10  MyWebProject

Looking at the verbose logs, I can see it's failing during the Web.config transform.

        ParameterizeTransformXml:   No element in the source document matches '/configuration/appSettings/add[@key='ida:AudienceUri']'
        ParameterizeTransformXml:   Not executing SetTokenizedAttributes (transform line 7, 9)
        ParameterizeTransformXml:   No element in the source document matches '/configuration/appSettings/add[@key='ida:Realm']'
        ParameterizeTransformXml:   Not executing SetTokenizedAttributes (transform line 10, 9)
        ParameterizeTransformXml:   No element in the source document matches '/configuration/appSettings/add[@key='ida:FederationMetadataLocation']'
        ParameterizeTransformXml:   Not executing SetTokenizedAttributes (transform line 13, 9)
 Warning : No element in the source document matches '/configuration/system.identityModel'
        ParameterizeTransformXml:   Not executing RemoveAll (transform line 24, 14)
 Error : No element in the source document matches '/configuration/system.identityModel/identityConfiguration'
        ParameterizeTransformXml:   Not executing Insert (transform line 27, 9)
        ParameterizeTransformXml:   No element in the source document matches '/configuration/system.identityModel'
        ParameterizeTransformXml:   Not executing SetTokenizedAttributes (transform line 33, 9)
        ParameterizeTransformXml:   No element in the source document matches '/configuration/system.identityModel.services'
        ParameterizeTransformXml:   Not executing SetTokenizedAttributes (transform line 42, 9)
        ParameterizeTransformXml:   No element in the source document matches '/configuration/system.identityModel.services'
        ParameterizeTransformXml:   Not executing SetTokenizedAttributes (transform line 45, 9)
        ParameterizeTransformXml: Transformation failed
        Done executing task "ParameterizeTransformXml" -- FAILED.
        Done building target "_TransformWebConfigForAzureAuthenticationCore" in project "MyWebProject.csproj" -- FAILED.
Done building project "MyWebProject.csproj" -- FAILED.

What additional build information do I need to configure to get the Zip deployment past these errors? It works just fine if I do a direct web deployment.

like image 971
bartonm Avatar asked Feb 09 '15 17:02

bartonm


3 Answers

Check your publish settings to see if you have EnableADPublish set to true. That was my problem (I was configuring Azure AD Auth through other means), so I just set it to false and everything worked great.

<EnableADPublish>false</EnableADPublish>

Cheers, Jeff

like image 169
Jeff Tindall Avatar answered Nov 07 '22 06:11

Jeff Tindall


I added the below configuration explicitly:

<system.identityModel>
    <identityConfiguration>
      <audienceUris>        
      </audienceUris>
    </identityConfiguration>
</system.identityModel>

It is able to create the package finally!

like image 33
apoorva guru Avatar answered Nov 07 '22 08:11

apoorva guru


If you are using the publish wizard, make sure that "Enable Organizational Authentication" is unchecked**. This fixed it for me.

enter image description here

like image 3
AlbatrossCafe Avatar answered Nov 07 '22 07:11

AlbatrossCafe