Azure Frontdoor -Session values missing - azure-devops

We have enabled Azure Frontdoor for our web app, so when we try to get some session values, we get a null reference.But in case if we disable the Frontdoor it is working fine. Otherwise when it is enabled we often get null reference errors.
And when I implemented logs and checked, I get an
"Object reference is not set to an instance" in this part of **Code:
return (guid)SessionHelper.Retrieve (Session.scope.global, key)
Can someone help me to know, Is anything missing with the front door configuration or setting session values

The error "Object reference is not set to an instance" in this part of **Code:
Shows that you are trying to access an object that has not been instantiated / initialized properly.
Enabling azure Front door will be affecting the session state, causing the null reference error when you trying to access session values.
To overcome this issue, you can follow the below steps:
Check if the session state is being properly initialized and maintained across requests.
Check the Azure Front door configuration to see if it is affecting the session state in any way.
Check if any dependencies used in the code are null and causing the error.
If possible, try to isolate the code causing the error and debug it.
More details on session follow the link Session affinity
To create an Azure Front Door, follow the below doc
Quickstart: Create a Front Door for a highly available global web application

Related

Behavior of IBM Bluemix Swift Object Storage "X-Newest" flag

I am using the IBM Cloud Object Storage with Swift API on IBM Bluemix as seen here https://console.bluemix.net/catalog/infrastructure/object-storage-group.
I need to get the newest version of an object, or to know if it was deleted. To do so I use the X-Newest header flag in the request, but still I can get an object that was already deleted. Is there a known problem with this flag? Is it supported by the storage service? If it is, can you help to investigate why it happens?
Problematic scenario (Swift local client):
add an object
delete this object
pull this object (Get or Head) with X-Newest flag
and expect always to get "Object Not found" 404 status code (because it was deleted in the previous step). But in reality, sometimes I get this object back although it was deleted. Swift is eventually consistent, and without this flag, it would be a normal behavior. But with this flag, I should not get old versions of the object.
Do you know why it happens?

Is it possible to define a TFS instance as Development?

I am writing/testing a server side plug-in and am looking to derive if this is running on our development or production TFS instance to allow me to drive a slightly different process (e.g. add some obvious text to any email subjects that it sends out to ensure that people know it has derived from the development instance).
There is a "IsProduction" property that I can access via the requestContext variable (IVSSRequestContext.ServiceHost.IsProduction - was previously TeamFoundationRequestContext.TeamFoundationServicehost.IsProduction before TFS2015), but this property is set to true in both instances.
Does anyone know if/should this can be used for that purpose and if so, how it can be set as I can't find any documentation online and can't see anything obvious in the TFS Admin Console.
No, but I suggest using a global Environment variable (e.g. IsDevelopment).
Another option is to get the server URL (see code snippet) and use it to determine the environment, but I think it is less safe.
private Uri GetCollectionUriFromContext(IVssRequestContext requestContext)
{
ILocationService service = requestContext.GetService<ILocationService>();
return service.GetSelfReferenceUri(requestContext,
service.GetDefaultAccessMapping(requestContext));
}

How to tell which Azure app service (website) slot is "active"?

We have an Azure app service (website) which has an additional deployment slot called offline that we want to use when we have taken the main website offline for maintenance.
I am trying to write a PowerShell script that will switch between this offline slot and the production slot, or vice versa, depending on parameters passed to the script. However, the script must also perform additional actions when the switchover happens, hence it is important to know which slot is currently "active".
The problem is that I can't find a way of determining this. I'm using the Resource Manager cmdlets (*-AzureRm*), and although I can call:
Get-AzureRmWebAppSlot -ResourceGroupName xxx -Name websitename -Slot offline
the object that this returns has nothing in it that can help me, as far as I can tell. It's the same story for the object returned by Get-AzureRmWebApp.
As there doesn't seem to be a Resource Manager cmdlet for this, are there any other techniques I can use? All I can think of at the moment is to have a particular web page that only exists on the offline site, and check for the existence of that page by querying the live website: this should tell me which slot is currently live. This seems kind of hacky though.
You could setup a non-slot-specific app setting that identifies the app. That would be swapped along with the app when doing the swap.
E.g. set an app setting with key AppVersion and value Production on the production slot, and an app setting with the same key and value Offline on the offline slot.
You can get access to app settings with PowerShell like this:
(Get-AzureRmWebApp -ResourceGroupName your-resource-group -Name your-webapp).SiteConfig.AppSettings

Azure subscription disabled in portal but active on the account.windowsazure.com

I wanted to transfer resources (web apps) from an old subscription that had been disabled onto my new active subscription. I created a support request and they changed the disabled subscription into a Pay-As-You-Go -type and now using PowerShell I should be able to transfer my work over.
However I am still unable to access the old resource group in PS, for example when using Get-AzureRMResourceGroup only the new group I created comes up. I am also unable to do absolutely anything with my old work, even though the sub should now be active. I believe this is the reason I am unable to make the transfer. The title poses the actual dilemma that I believe is the root of my problems so, does anyone know a way to change this? Also I am happy to be corrected if I'm way off, or just be suggested an alternative approach.
Here's a silly picture to show the inconsistency I'm speaking of.

An exception of type 'System.ServiceModel.FaultException`1' occurred in mscorlib.dll but was not handled in user code

I am trying to consume WCF web service and get following error. Its a third party service so dont have much control over it.
I have tried making tracing work but nothing seems to work. Cant get tracing work
Error i get is
An exception of type 'System.ServiceModel.FaultException`1' occurred in mscorlib.dll but was not handled in user code
Additional information: Shared key was empty
Inner exception comes as Null and Reason is Shared Key is empty.
Has anyone came across this problem while consuming WCF web service.
Thanks
As it a third party webservice, they didn't provide me with the code which adds 'Shared Key' variable as its individual for each client.
Asked the client and they provided the code with my shared key and that fixed the problem.