Making changes to your application in SF - artisticcheese/artisticcheesecontainer GitHub Wiki

#How to deploy new versions of your container application in SF To deploy new version of your application to service fabric you need to make changes to underlying application or service configuration files, change version numbers on all of them and redeploy it.
Example below actually based on issue I run into while deploying this artisticchese\iis:version1 application. My tag in docker hub actually was spelled with capital "V" while manifest called for lower case which resulted in failed application run. To modify edit servicemanifest.xml file to use proper casing.

<ContainerHost>
 <ImageName>artisticcheese/iis:Version1</ImageName>
</ContainerHost>

To deploy changed application version has to be changed in 4 different files. Visual Studio allows to simplify it during deployment phase.
Right click on Application and choose "Publish". Make sure checkbox "Upgrade Application" is checked.

Visual Studio script will provide detailed information about upgrade status while it's being performed

2>Copy application package succeeded
2>Registering application type...
2>Register application type succeeded
2>Start upgrading application...
2>
2>
2>ApplicationName                         : fabric:/Application2
2>ApplicationParameters                   : { "PI_InstanceCount" = "-1" }
2>TargetApplicationTypeVersion            : 1.0.3
2>UpgradeKind                             : Rolling
2>ForceRestart                            : False
2>UpgradeMode                             : Monitored
2>UpgradeReplicaSetCheckTimeout           : 49710.06:28:15
2>FailureAction                           : Rollback
2>HealthCheckRetryTimeout                 : 00:10:00
2>HealthCheckWaitDuration                 : 00:00:00
2>UpgradeDomainTimeout                    : 10675199.02:48:05.4775807
2>UpgradeTimeout                          : 10675199.02:48:05.4775807
2>ConsiderWarningAsError                  : 
2>MaxPercentUnhealthyPartitionsPerService : 
2>MaxPercentUnhealthyReplicasPerPartition : 
2>MaxPercentUnhealthyServices             : 
2>MaxPercentUnhealthyDeployedApplications : 
2>ServiceTypeHealthPolicyMap              : 
2>
2>Waiting for upgrade...
2>Waiting for upgrade...
2>Waiting for upgrade...
2>Waiting for upgrade...
2>Waiting for upgrade...
2>Waiting for upgrade...
2>Waiting for upgrade...
2>Waiting for upgrade...
2>Waiting for upgrade...

This will be also present in SF UI as well

We still deployed only Version1 of application which has a bug with missing "." in PI number. We need to upgrade application to Version2 to fix it. Plus we need to customize our application with environment variables to reset local administrator's username and password based on Environment Variables. Your ServiceManifest.xml will look like below

<CodePackage Name="Code" Version="1.0.3">
    <EntryPoint>
      <ContainerHost>
        <ImageName>artisticcheese/iis:Version2</ImageName>
      </ContainerHost>
    </EntryPoint>
    <EnvironmentVariables>
      <EnvironmentVariable Name="containeradmin" Value="contadmin"/>
      <EnvironmentVariable Name="containerpassword" Value="myPassword!"/>
    </EnvironmentVariables>

Deploy application again to see results fixing a bug.

PS c:\>1..3 | ForEach-Object {$b= "containerhost$_";Invoke-webrequest "http://$($b):20001/pi/service.svc/pi/40" | select @{N="Computer";Expression={$b}}, Content}
Computer       Content                                     
--------       -------                                     
containerhost1 "3.1415926535897932384626433832795028841971"
containerhost2 "3.1415926535897932384626433832795028841971"
containerhost3 "3.1415926535897932384626433832795028841971"

You also can verify that you in fact can login with username/password specified Environment Variables via IIS manager to IIS.

⚠️ **GitHub.com Fallback** ⚠️