0

I am deploying in Azure using Cloud Service. I need to add global url rewrite rule in each of the nodes. These global rewrite rules are stored in the applicationHost.config file and the way I read it, this file can be modified using the xml transform method.

I've prepared my applicationHost.xdt file - but how do I get this transform to run when deploying the cloud service?

Note, there are plenty of examples/articles that describe how to deploy/run it in azure application service. I need to do it in a cloud service instead, which is different.

Aleks G
  • 56,435
  • 29
  • 168
  • 265

1 Answers1

0

Isn't the applicationHost.xdt only for App Service environments (ie. Web Apps)? As far as I know it isn't a generic applicationHost.config transform for use outside of Web Apps.

For cloud services you would use a startup task to automate appcmd commands. For example - https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-startup-tasks-common#block-a-specific-ip-address:

@echo off
@echo Installing "IPv4 Address and Domain Restrictions" feature 
powershell -ExecutionPolicy Unrestricted -command "Install-WindowsFeature Web-IP-Security"
@echo Unlocking configuration for "IPv4 Address and Domain Restrictions" feature 
%windir%\system32\inetsrv\AppCmd.exe unlock config -section:system.webServer/security/ipSecurity
kwill
  • 10,867
  • 1
  • 28
  • 26
  • Quite likely, as I couldn't figure out how to use it in my case. In the end I did use the startup scripts. I already had a powershell script that executed on startup - I just added corresponding commands into it. – Aleks G Oct 23 '18 at 06:40