Web Slot
HTML5 Slot Machine. This is a modern proof of concept casino slot machine game, built using only vanilla HTML, CSS and JavaScript. No Flash or Frameworks required. Allowing for an amazing low bundle size and blazing fast performance. Built using the Web Animations API. Fully responsive for great UX on mobile, web. Often Web Components will leverage Shadow DOM features. Shadow DOM is commonly used for CSS encapsulation. However, Shadow DOM has another useful feature called Slots. The Slot API is a content projection API that allows HTML content from the host application to be rendered into your component template.
Template format
To create a Microsoft.Web/sites/slots resource, add the following JSON to the resources section of your template.
Property values
The following tables describe the values you need to set in the schema.
Microsoft.Web/sites/slots object
Name | Type | Required | Value |
---|---|---|---|
name | string | Yes | Name of the deployment slot to create or update. By default, this API attempts to create or modify the production slot. |
type | enum | Yes | slots -or- Microsoft.Web/sites/slots See Set name and type for child resources. |
apiVersion | enum | Yes | 2020-09-01 |
kind | string | No | Kind of resource. |
location | string | Yes | Resource Location. |
tags | object | No | Resource tags. |
systemData | object | No | The system metadata relating to this resource. - SystemData object |
properties | object | Yes | Site resource specific properties - SiteProperties object |
identity | object | No | ManagedServiceIdentity object |
resources | array | No |
SystemData object
Name | Type | Required | Value |
---|---|---|---|
createdBy | string | No | The identity that created the resource. |
createdByType | enum | No | The type of identity that created the resource. - User, Application, ManagedIdentity, Key |
lastModifiedAt | string | No | The type of identity that last modified the resource. |
SiteProperties object
Name | Type | Required | Value |
---|---|---|---|
enabled | boolean | No | true if the app is enabled; otherwise, false . Setting this value to false disables the app (takes the app offline). |
hostNameSslStates | array | No | Hostname SSL states are used to manage the SSL bindings for app's hostnames. - HostNameSslState object |
serverFarmId | string | No | Resource ID of the associated App Service plan, formatted as: '/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}'. |
reserved | boolean | No | true if reserved; otherwise, false . |
isXenon | boolean | No | Obsolete: Hyper-V sandbox. |
hyperV | boolean | No | Hyper-V sandbox. |
siteConfig | object | No | Configuration of the app. - SiteConfig object |
scmSiteAlsoStopped | boolean | No | true to stop SCM (KUDU) site when the app is stopped; otherwise, false . The default is false . |
hostingEnvironmentProfile | object | No | App Service Environment to use for the app. - HostingEnvironmentProfile object |
clientAffinityEnabled | boolean | No | true to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is true . |
clientCertEnabled | boolean | No | true to enable client certificate authentication (TLS mutual authentication); otherwise, false . Default is false . |
clientCertMode | enum | No | This composes with ClientCertEnabled setting.- ClientCertEnabled: false means ClientCert is ignored.- ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required.- ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. - Required or Optional |
clientCertExclusionPaths | string | No | client certificate authentication comma-separated exclusion paths |
hostNamesDisabled | boolean | No | true to disable the public hostnames of the app; otherwise, false . If true , the app is only accessible via API management process. |
customDomainVerificationId | string | No | Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. |
containerSize | integer | No | Size of the function container. |
dailyMemoryTimeQuota | integer | No | Maximum allowed daily memory-time quota (applicable on dynamic apps only). |
cloningInfo | object | No | If specified during app creation, the app is cloned from a source app. - CloningInfo object |
httpsOnly | boolean | No | HttpsOnly: configures a web site to accept only https requests. Issues redirect forhttp requests |
redundancyMode | enum | No | Site redundancy mode. - None, Manual, Failover, ActiveActive, GeoRedundant |
ManagedServiceIdentity object
Name | Type | Required | Value |
---|---|---|---|
type | enum | No | Type of managed service identity. - SystemAssigned, UserAssigned, SystemAssigned, UserAssigned, None |
userAssignedIdentities | object | No | The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} |
HostNameSslState object
Name | Type | Required | Value |
---|---|---|---|
name | string | No | Hostname. |
sslState | enum | No | SSL type. - Disabled, SniEnabled, IpBasedEnabled |
virtualIP | string | No | Virtual IP address assigned to the hostname if IP based SSL is enabled. |
thumbprint | string | No | SSL certificate thumbprint. |
toUpdate | boolean | No | Set to true to update existing hostname. |
hostType | enum | No | Indicates whether the hostname is a standard or repository hostname. - Standard or Repository |
SiteConfig object
Name | Type | Required | Value |
---|---|---|---|
numberOfWorkers | integer | No | Number of workers. |
defaultDocuments | array | No | Default documents. - string |
netFrameworkVersion | string | No | .NET Framework version. |
phpVersion | string | No | Version of PHP. |
pythonVersion | string | No | Version of Python. |
nodeVersion | string | No | Version of Node.js. |
powerShellVersion | string | No | Version of PowerShell. |
linuxFxVersion | string | No | Linux App Framework and version |
windowsFxVersion | string | No | Xenon App Framework and version |
requestTracingEnabled | boolean | No | true if request tracing is enabled; otherwise, false . |
requestTracingExpirationTime | string | No | Request tracing expiration time. |
remoteDebuggingEnabled | boolean | No | true if remote debugging is enabled; otherwise, false . |
remoteDebuggingVersion | string | No | Remote debugging version. |
httpLoggingEnabled | boolean | No | true if HTTP logging is enabled; otherwise, false . |
logsDirectorySizeLimit | integer | No | HTTP logs directory size limit. |
detailedErrorLoggingEnabled | boolean | No | true if detailed error logging is enabled; otherwise, false . |
publishingUsername | string | No | Publishing user name. |
appSettings | array | No | Application settings. - NameValuePair object |
connectionStrings | array | No | Connection strings. - ConnStringInfo object |
handlerMappings | array | No | Handler mappings. - HandlerMapping object |
documentRoot | string | No | Document root. |
scmType | enum | No | SCM type. - None, Dropbox, Tfs, LocalGit, GitHub, CodePlexGit, CodePlexHg, BitbucketGit, BitbucketHg, ExternalGit, ExternalHg, OneDrive, VSO, VSTSRM |
use32BitWorkerProcess | boolean | No | true to use 32-bit worker process; otherwise, false . |
webSocketsEnabled | boolean | No | true if WebSocket is enabled; otherwise, false . |
alwaysOn | boolean | No | true if Always On is enabled; otherwise, false . |
javaVersion | string | No | Java version. |
javaContainer | string | No | Java container. |
javaContainerVersion | string | No | Java container version. |
appCommandLine | string | No | App command line to launch. |
managedPipelineMode | enum | No | Managed pipeline mode. - Integrated or Classic |
virtualApplications | array | No | Virtual applications. - VirtualApplication object |
loadBalancing | enum | No | Site load balancing. - WeightedRoundRobin, LeastRequests, LeastResponseTime, WeightedTotalTraffic, RequestHash |
experiments | object | No | This is work around for polymorphic types. - Experiments object |
limits | object | No | Site limits. - SiteLimits object |
autoHealEnabled | boolean | No | true if Auto Heal is enabled; otherwise, false . |
autoHealRules | object | No | Auto Heal rules. - AutoHealRules object |
tracingOptions | string | No | Tracing options. |
vnetName | string | No | Virtual Network name. |
vnetRouteAllEnabled | boolean | No | Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. |
vnetPrivatePortsCount | integer | No | The number of private ports assigned to this app. These will be assigned dynamically on runtime. |
cors | object | No | Cross-Origin Resource Sharing (CORS) settings. - CorsSettings object |
push | object | No | Push endpoint settings. - PushSettings object |
apiDefinition | object | No | Information about the formal API definition for the app. - ApiDefinitionInfo object |
apiManagementConfig | object | No | Azure API management settings linked to the app. - ApiManagementConfig object |
autoSwapSlotName | string | No | Auto-swap slot name. |
localMySqlEnabled | boolean | No | true to enable local MySQL; otherwise, false . |
managedServiceIdentityId | integer | No | Managed Service Identity Id |
xManagedServiceIdentityId | integer | No | Explicit Managed Service Identity Id |
ipSecurityRestrictions | array | No | IP security restrictions for main. - IpSecurityRestriction object |
scmIpSecurityRestrictions | array | No | IP security restrictions for scm. - IpSecurityRestriction object |
scmIpSecurityRestrictionsUseMain | boolean | No | IP security restrictions for scm to use main. |
http20Enabled | boolean | No | Http20Enabled: configures a web site to allow clients to connect over http2.0 |
minTlsVersion | enum | No | MinTlsVersion: configures the minimum version of TLS required for SSL requests. - 1.0, 1.1, 1.2 |
scmMinTlsVersion | enum | No | ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. - 1.0, 1.1, 1.2 |
ftpsState | enum | No | State of FTP / FTPS service. - AllAllowed, FtpsOnly, Disabled |
preWarmedInstanceCount | integer | No | Number of preWarmed instances.This setting only applies to the Consumption and Elastic Plans |
healthCheckPath | string | No | Health check path |
HostingEnvironmentProfile object
Name | Type | Required | Value |
---|---|---|---|
id | string | No | Resource ID of the App Service Environment. |
CloningInfo object
Name | Type | Required | Value |
---|---|---|---|
correlationId | string | No | Correlation ID of cloning operation. This ID ties multiple cloning operationstogether to use the same snapshot. - globally unique identifier |
overwrite | boolean | No | true to overwrite destination app; otherwise, false . |
cloneCustomHostNames | boolean | No | true to clone custom hostnames from source app; otherwise, false . |
cloneSourceControl | boolean | No | true to clone source control from source app; otherwise, false . |
sourceWebAppId | string | Yes | ARM resource ID of the source app. App resource ID is of the form /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. |
sourceWebAppLocation | string | No | Location of source app ex: West US or North Europe |
hostingEnvironment | string | No | App Service Environment. |
appSettingsOverrides | object | No | Application setting overrides for cloned app. If specified, these settings override the settings cloned from source app. Otherwise, application settings from source app are retained. |
configureLoadBalancing | boolean | No | true to configure load balancing for source and destination app. |
trafficManagerProfileId | string | No | ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. |
trafficManagerProfileName | string | No | Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist. |
NameValuePair object
Name | Type | Required | Value |
---|---|---|---|
name | string | No | Pair name. |
value | string | No | Pair value. |
ConnStringInfo object
Name | Type | Required | Value |
---|---|---|---|
name | string | No | Name of connection string. |
connectionString | string | No | Connection string value. |
type | enum | No | Type of database. - MySql, SQLServer, SQLAzure, Custom, NotificationHub, ServiceBus, EventHub, ApiHub, DocDb, RedisCache, PostgreSQL |
HandlerMapping object
Name | Type | Required | Value |
---|---|---|---|
extension | string | No | Requests with this extension will be handled using the specified FastCGI application. |
scriptProcessor | string | No | The absolute path to the FastCGI application. |
arguments | string | No | Command-line arguments to be passed to the script processor. |
VirtualApplication object
Name | Type | Required | Value |
---|---|---|---|
virtualPath | string | No | Virtual path. |
physicalPath | string | No | Physical path. |
preloadEnabled | boolean | No | true if preloading is enabled; otherwise, false . |
virtualDirectories | array | No | Virtual directories for virtual application. - VirtualDirectory object |
Experiments object
Name | Type | Required | Value |
---|---|---|---|
rampUpRules | array | No | List of ramp-up rules. - RampUpRule object |
SiteLimits object
Name | Type | Required | Value |
---|---|---|---|
maxPercentageCpu | number | No | Maximum allowed CPU usage percentage. |
maxMemoryInMb | integer | No | Maximum allowed memory usage in MB. |
maxDiskSizeInMb | integer | No | Maximum allowed disk size usage in MB. |
AutoHealRules object
Name | Type | Required | Value |
---|---|---|---|
triggers | object | No | Conditions that describe when to execute the auto-heal actions. - AutoHealTriggers object |
actions | object | No | Actions to be executed when a rule is triggered. - AutoHealActions object |
CorsSettings object
Name | Type | Required | Value |
---|---|---|---|
allowedOrigins | array | No | Gets or sets the list of origins that should be allowed to make cross-origincalls (for example: http://example.com:12345). Use '*' to allow all. - string |
supportCredentials | boolean | No | Gets or sets whether CORS requests with credentials are allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentialsfor more details. |
PushSettings object
Name | Type | Required | Value |
---|---|---|---|
kind | string | No | Kind of resource. |
systemData | object | No | The system metadata relating to this resource. - SystemData object |
properties | object | No | PushSettings resource specific properties - PushSettingsProperties object |
ApiDefinitionInfo object
Name | Type | Required | Value |
---|---|---|---|
url | string | No | The URL of the API definition. |
ApiManagementConfig object
Name | Type | Required | Value |
---|---|---|---|
id | string | No | APIM-Api Identifier. |
IpSecurityRestriction object
Name | Type | Required | Value |
---|---|---|---|
ipAddress | string | No | IP address the security restriction is valid for.It can be in form of pure ipv4 address (required SubnetMask property) orCIDR notation such as ipv4/mask (leading bit match). For CIDR,SubnetMask property must not be specified. |
subnetMask | string | No | Subnet mask for the range of IP addresses the restriction is valid for. |
vnetSubnetResourceId | string | No | Virtual network resource id |
action | string | No | Allow or Deny access for this IP range. |
priority | integer | No | Priority of IP restriction rule. |
name | string | No | IP restriction rule name. |
description | string | No | IP restriction rule description. |
headers | object | No | IP restriction rule headers.X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). The matching logic is ..- If the property is null or empty (default), all hosts(or lack of) are allowed.- A value is compared using ordinal-ignore-case (excluding port number).- Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com but not the root domain contoso.com or multi-level foo.bar.contoso.com- Unicode host names are allowed but are converted to Punycode for matching.X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples).The matching logic is ..- If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed.- If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property.X-Azure-FDID and X-FD-HealthProbe.The matching logic is exact match. |
VirtualDirectory object
Name | Type | Required | Value |
---|---|---|---|
virtualPath | string | No | Path to virtual application. |
physicalPath | string | No | Physical path. |
RampUpRule object
Name | Type | Required | Value |
---|---|---|---|
actionHostName | string | No | Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. |
reroutePercentage | number | No | Percentage of the traffic which will be redirected to ActionHostName . |
changeStep | number | No | In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches nMinReroutePercentage or MaxReroutePercentage . Site metrics are checked every N minutes specified in ChangeIntervalInMinutes .nCustom decision algorithm can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl . |
changeIntervalInMinutes | integer | No | Specifies interval in minutes to reevaluate ReroutePercentage. |
minReroutePercentage | number | No | Specifies lower boundary above which ReroutePercentage will stay. |
maxReroutePercentage | number | No | Specifies upper boundary below which ReroutePercentage will stay. |
changeDecisionCallbackUrl | string | No | Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts.https://www.siteextensions.net/packages/TiPCallback/ |
name | string | No | Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment. |
AutoHealTriggers object
Name | Type | Required | Value |
---|---|---|---|
requests | object | No | A rule based on total requests. - RequestsBasedTrigger object |
privateBytesInKB | integer | No | A rule based on private bytes. |
statusCodes | array | No | A rule based on status codes. - StatusCodesBasedTrigger object |
slowRequests | object | No | A rule based on request execution time. - SlowRequestsBasedTrigger object |
AutoHealActions object
Name | Type | Required | Value |
---|---|---|---|
actionType | enum | No | Predefined action to be taken. - Recycle, LogEvent, CustomAction |
customAction | object | No | Custom action to be taken. - AutoHealCustomAction object |
minProcessExecutionTime | string | No | Minimum time the process must executebefore taking the action |
PushSettingsProperties object
Name | Type | Required | Value |
---|---|---|---|
isPushEnabled | boolean | Yes | Gets or sets a flag indicating whether the Push endpoint is enabled. |
tagWhitelistJson | string | No | Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. |
tagsRequiringAuth | string | No | Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint.Tags can consist of alphanumeric characters and the following:'_', '@', '#', '.', ':', '-'. Validation should be performed at the PushRequestHandler. |
dynamicTagsJson | string | No | Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. |
RequestsBasedTrigger object
Name | Type | Required | Value |
---|---|---|---|
count | integer | No | Request Count. |
timeInterval | string | No | Time interval. |
StatusCodesBasedTrigger object
Name | Type | Required | Value |
---|---|---|---|
status | integer | No | HTTP status code. |
subStatus | integer | No | Request Sub Status. |
win32Status | integer | No | Win32 error code. |
count | integer | No | Request Count. |
timeInterval | string | No | Time interval. |
SlowRequestsBasedTrigger object
Name | Type | Required | Value |
---|---|---|---|
timeTaken | string | No | Time taken. |
count | integer | No | Request Count. |
timeInterval | string | No | Time interval. |
AutoHealCustomAction object
Name | Type | Required | Value |
---|---|---|---|
exe | string | No | Executable to be run. |
parameters | string | No | Parameters for the executable. |
Quickstart templates
The following quickstart templates deploy this resource type.
Template | Description |
---|---|
Web App with custom Deployment slots | This template provides an easy way to deploy a web app with custom deployment slots on Azure Web Apps. |
Azure deployment slots are a fantastic feature of Azure App Services. They allow developers to have multiple versions of their application running at the same time with the added bonus of being able to re-route traffic between each instance at the press of a button. They can, however, generate a lot of confusion if you don't fully understand how they work.
So what exactly are Azure Deployment Slots?
Let's assume we have a web app running on Azure App Services. We'll call it http://site.com. When you create a new web application, Azure creates a deployment slot for you, typically called production. However, it's possible to add additional deployment slots.
Put simply, a deployment slot is another web application. It has it's own URL, it could have its own database, connection strings, etc. It can be configured any way you see fit. But why would you want to have two web applications? The most common reason is so that we can have a place to deploy new features to, rather than going straight to production, which can be a little risky.
To accomplish this, we would create a deployment slot called staging.The staging slot is where you would deploy all new changes to your application to validate that everything is working before the changes actually go live to your users. Think of it like a test environment. A test environment that's really easy to spin up and manage. Let's create a deployment slot called staging and have it be accessible via http://site-staging.com
Creating a Deployment Slot
Creating a deployment slot is pretty simple. Open your Azure portal and navigate to your Web App resource. Once there, you should be able to see a menu item labeled Deployment slots.
Clicking on the Add Slot button opens the space to add a new deployment slot. Here you can specify the name of the slot (I used staging) and if you want to copy any pre-existing configurations (such as your current production deployment slot). Press OK and you're all set!
When the deployment slot is first created, it is empty. So you'll want to deploy your latest and greatest changes to your staging environment (or just re-deploy your current production version to get something up and running). Deploying to your new slot is really no different than deploying to your production slot. Using the same tooling, just select the staging slot, rather than the production slot.
At this point, we have two instances of our web application running. One is our production instance, supporting all of our production traffic and another staging environment that we are using for testing the latest and greatest features. When you are satisfied with your tests, you will need to swap the staging and production slots so that your users can benefit from your new features.
Swapping Deployment Slots
Swapping deployment slots routes traffic from the source slot to the target slot. In our case, we want to swap the staging and production slots. This will route our users to the staging app (where our newest changes are) when they navigate to http://site.com.
While that is the easiest way to describe what is happening, there is a lot that is going on behind the scenes that is useful to know.
When Swapping... Source and Target Matter
When performing a swap, you are presented with a source and a target. This may be a little confusing at first. Why would it matter? A swap is just flipping two things! While the end result will be the same, the key takeaway is that up-time is not guaranteed for the source slot.
This is because when you perform a swap, this is what is really happening:
- First, the staging slot needs to go through some setting changes. This causes the staging site to restart, which is fine.
- Next, the staging site gets warmed up, by having a request sent to its root path (i.e. '/'), and waiting for it to complete.
- Now that the staging site is warm, it gets swapped into production. There is no down time, since it goes straight from one warm site to another one.
- Finally, the site that used to be production (and is now staging) also needs to get some settings applied, causing it to restart. Again, this is fine since it happens to the staging site.
This process guarantees that your destination slot will always been warm and your users won't experience any downtime when the swap happens. Users may experience performance issues when navigating to the staging environment, but this is acceptable as it's not really a production environment.
When Swapping... Settings Are Swapped Too
Spoiler Alert: Not all settings are swapped. It is important to remember that when performing a swap, the settings of a deployment slot are also swapped.. but not all of them.
Some settings make sense to keep specific to the slot, these are called slot settings and can be configured in the Azure portal.
When a setting has been flagged as a slot setting it will not be applied to the target site. This is useful for settings such as connection strings. Maybe you want to have a dedicated database for your staging environment so you create a slot setting to hold a connection string that connects to a database specifically set up for your staging environment.
Some settings will be swapped during the swap process. There are settings that are not marked as a 'slot setting' under the Application Settings section. This can be useful for a couple of reasons, one of which could be to introduce a new slot setting.
If at first we apply the setting to staging, perform the swap, and then apply the setting to the staging environment again (the old production app), it's possible to add a new settings without incurring an application restart on the production application.
The Azure portal even tells you which settings will be applied before you perform the swap operation as shown below.
When Swapping... The Code Does Not Move
This was something I wasn't always quite sure about until I dug into it a little more and ran some of my own experiments. When you deploy changes to a deployment slot, that is where the changes will forever reside until you deploy over them. Consider the following scenario:
Version 1 of your application is deployed to your production deployment slot.
Version 2 of your application is deployed to your staging deployment slot.
Web Slot Casino Free Online Slots
As we learned previously, each deployment slot is its own web application. When a swap is performed, Azure swaps the virtual IP address of the source and destination and applies the appropriate settings. The code stays with their respective web applications, so the staging web app effectively becomes the production web app, and the production web app becomes the staging web app.
Put another way, imagine having two boxes. One box has black licorice it in labeled 'production', and the other box has KitKats inside of it labeled 'staging'.
Note: To get this analogy right, you just need to agree that KitKats are the superior candy.
Your customers are currently going to the black licorice box, but you realize it's time to give them an upgrade. So you swap the location of the boxes. You also swap the labels on the boxes. This puts the 'production' label on the KitKat box and the 'staging' label on the black licorice box. Directing your customers to the box of delicious KitKats. They obviously rejoice.
Admittedly, it's sort of a silly example, but I hope it clears up the fact that when you perform a swap, we aren't picking up whats inside the box and moving them to a different box. We're simply relabeling the boxes themselves.
Rolling Back Changes
If the ability to be able to test your changes before going live isn't enough of an incentive to begin leveraging deployment slots, the ability to roll back your changes at the press of a button should be enough to convince you.
After performing a swap, our users are now hitting the latest version of our application. If for some reason we missed something and we start noticing errors, all we have to do is swap again to put the system back into its previous state.
There's no need to open up Git, revert the commit, and re-deploy the change. We don't need to deploy anything at all! It's just a matter of routing our users back to the site that was working for them previously.
Testing in Production
There's also this nifty little feature that we can leverage called Testing in Production. Testing in Production is essentially Azure's implementation of a canary test. If you're unfamiliar with the term, it stems from the mining days where miners would bring a canary down with them into the mine. If the canary died, they'd know something was wrong with the air quality, warning them to leave the mine as soon as possible.
Web Solution Provider
We do canary testing by routing a small subset of users to our new feature. Continuing with the production and staging examples, what we do is take 5% of all traffic to our website and actually have them go to our staging environment with the remaining 95% continuing to hit our production environment. If we don't notice anything wrong, we can bump the 5% up to 10% or even 20%, until we've reached 100%. This way if anything were to go wrong, we've mitigated the number of users impacted by a bad change.
Web Sloth
If you're interested in trying this feature out, it is relatively simple to get going. Simply click on the Testing in Production menu item from within your App Service.
Web Slot Co
This will allow you to set the percentage of traffic that you want to see going to your staging slot (5% as shown in the figure) and production slot. That's all there is to it!
Wrapping Up
Best Online Slot Play
Deployment slots are incredibly easy to use and offer a wide range of features that make them hard to pass up. If you're hosting your application in Azure, definitely consider them for your current and/or next project!