title: Azure credentials have not been set up or have expired
body: <p>I have scheduled a PowerShell script to execute a pipeline in Azure. 
  Have generated the login script(ProfileContext.ctx) using Login-AzureRMAccount</p>
  
  <p>Below is the code to schedule:</p>
  
  <pre><code>$path = "D:\ProfileContext.ctx"
  Import-AzureRmContext -Path $path
  $dfn = "salesprod"
  $rgn = "sale-dw"
  $df=Get-AzureRmDataFactory -ResourceGroupName $rgn -Name $dfn
  
  $ISTstartdate = get-date
  
  #Set Pipeline active period
  $UTCstartdate = $ISTstartdate.touniversaltime().addminutes(5)
  $UTCenddt = $UTCstartdate.AddHours(5)
  
  $pipelinename = "SalesPipeline"
  
  Set-AzureRmDataFactoryPipelineActivePeriod -ResourceGroupName $rgn -PipelineName $pipelinename -DataFactoryName $dfn -StartDateTime $UTCstartdate -EndDateTime $UTCenddt -Force 
  </code></pre>
  
  <p>Above code works fine for 2 or 3 days but then I start getting below issue:</p>
  
  <p>Your Azure credentials have not been set up or have expired, please run Login-AzureRMAccount to set up your Azure credentials.
  At D:\RunPipeline.ps1
  Below are the version nos:</p>
  
  <ol>
  <li>PSVersion - 5.0.10586.117 </li>
  <li>Azure - 4.2.1</li>
  </ol>