visual studio 2012 - Publishing Web.Config to Azure removes Azure storage connection string -
i've got web.config contains sql connection string , azure blob storage connection string.
a web.config transformation replaces local sql connection string azure one.
when publish site azure, blob storage connection string deleted , replaced duplicate sql connection string, blob storage string's name.
the way i've found fix log in via ftp , manually change erroneous storage connection string correct 1 local machine.
how vs publish web config azure , leave alone!!!
web.config
<connectionstrings> <add name="defaultconnection" connectionstring="data source=(localdb)\v11.0;attachdbfilename=|datadirectory|\.mdf;integrated security=true" providername="system.data.sqlclient" /> <add name="storageconnectionstring" connectionstring="defaultendpointsprotocol=https;accountname=;accountkey=" /> </connectionstrings>
web.release.config
<connectionstrings> <add name="defaultconnection" connectionstring="server=.database.windows.net,1433;database=;user id=@;password=!;trusted_connection=false;encrypt=true;connection timeout=30;" providername="system.data.sqlclient" xdt:transform="setattributes" xdt:locator="match(name)"/>
i had similar issue yours. i'm not sure why when define connection strings in "configure tab" in azure portal , associate "linked resource" on linked resource tab may override properties in web.config transform causing unexpected results. 1 of options when set new azure website linking (or creating new) database associate website - thereby automatically assigning related connection string may try override transform operation defined in web.release.config.
check , see if removing connection strings , linked resources inside "azure portal" fixes problem. make sure have both production database , storage connections strings defined in web.release.config.
Comments
Post a Comment